Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: GMTSY104

GMTSY104.m

Go to the documentation of this file.
  1. GMTSY104 ;BP/WAT - POST-INSTALL PATCH 104 ;04/19/12 15:25
  1. ;;2.7;Health Summary;**104**;Oct 20, 1995;Build 38
  1. ;
  1. ;WP^DIE ;2053
  1. ;FIND1^DIC ;2051
  1. ;B/MES^XPDUTL 10141
  1. ;
  1. ; GMTS health check
  1. N GMTSNAME,I,COUNT,GMTSABRT S GMTSNAME="",COUNT=1,GMTSABRT=""
  1. D BMES^XPDUTL("CHECKING RECENT ADDITIONS TO HEALTH SUMMARY COMPONENT FILE")
  1. F I=252:1:256 Q:I>256!(GMTSABRT=2) D
  1. .S GMTSNAME=$P(^GMT(142.1,I,0),"^")
  1. .I GMTSNAME=$P($T(TEXT+COUNT),";;",2) D BMES^XPDUTL(GMTSNAME_": OK") S COUNT=COUNT+1 Q
  1. .D BMES^XPDUTL("The following Health Summary Component was not found in file 142.1:")
  1. .D MES^XPDUTL($P($T(TEXT+COUNT),";;",2))
  1. .D BMES^XPDUTL("Install will not proceed until this issue is resolved.")
  1. .D MES^XPDUTL("Transport global will remain on the system.")
  1. .D MES^XPDUTL("Use KIDS option XPD RESTART INSTALL when the issue is resovled.") S GMTSABRT=2
  1. I +$G(GMTSABRT)=2 S XPDQUIT=2 ;abort and leave global on system
  1. Q
  1. ;
  1. TEXT ;HS Names to Check
  1. ;;Medication Worksheet (Tool #2)
  1. ;;MAS CONTACTS
  1. ;;MAS MH CLINIC VISITS FUTURE
  1. ;;MH HIGH RISK PRF HX
  1. ;;MH TREATMENT COORDINATOR
  1. Q
  1. ;
  1. POST ;post-install
  1. ;update MHRF component description
  1. ;WP^DIE(FILE,IENS,FIELD,FLAGS,wp_root,msg_root)
  1. N GMTSIEN,MSG
  1. K ^TMP($J,"WP")
  1. D BMES^XPDUTL("Updating description for Health Summary Component MH HIGH RISK FOR SUICIDE")
  1. S ^TMP($J,"WP",1,0)="This component displays the assignment status and history for the "
  1. S ^TMP($J,"WP",2,0)="Category I (National) HIGH RISK FOR SUICIDE Patient Record Flag."
  1. S ^TMP($J,"WP",3,0)="Any assignment history found for the Category II (Local) High Risk for "
  1. S ^TMP($J,"WP",4,0)="Suicide flag will also be displayed."
  1. S GMTSIEN=$$FIND1^DIC(142.1,"","X","MH HIGH RISK PRF HX","B",,"MSG")
  1. I +$G(GMTSIEN)'>0 K ^TMP($J,"WP") D BMES^XPDUTL(" Error during lookup of MH HIGH RISK PRF HX component. ") D Q
  1. .I $D(MSG)>0 D AWRITE("MSG")
  1. K MSG
  1. D WP^DIE(142.1,GMTSIEN_",",3.5,"K","^TMP($J,""WP"")","MSG")
  1. I $D(MSG)>0 D AWRITE("MSG")
  1. D:$D(MSG)'>0 BMES^XPDUTL(" Update Successful ")
  1. Q
  1. ;
  1. AWRITE(REF) ;Write all the descendants of the array reference.
  1. ;REF is the starting array reference, for example A or ^TMP("SOME NAME",$J).
  1. N DONE,IND,LEN,LN,PROOT,ROOT,START,TEMP,GMTSTEXT
  1. I REF="" Q
  1. S LN=0
  1. S PROOT=$P(REF,")",1)
  1. ;Build the root so we can tell when we are done.
  1. S TEMP=$NA(@REF)
  1. S ROOT=$P(TEMP,")",1)
  1. S REF=$Q(@REF)
  1. I REF'[ROOT Q
  1. S DONE=0
  1. F Q:(REF="")!(DONE) D
  1. . S START=$F(REF,ROOT)
  1. . S LEN=$L(REF)
  1. . S IND=$E(REF,START,LEN)
  1. . S LN=LN+1,GMTSTEXT(LN)=PROOT_IND_"="_@REF
  1. . S REF=$Q(@REF)
  1. . I REF'[ROOT S DONE=1
  1. D MES^XPDUTL(.GMTSTEXT)
  1. Q
  1. ;