AMER3P08 ;GDIT/HS/BEE - AMER v3.0 Patch 8 ENV Check/PST Check ; 07 Oct 2013 11:33 AM
;;3.0;ER VISIT SYSTEM;**8**;MAR 03, 2009;Build 23
;
;Check for AMER*3.0*7
I '$$INSTALLD("AMER*3.0*7") D FIX(2)
;
Q
;
PST ;Post installation front end
;
;Need to loop through old PRESENTING COMPLAINT (#8) field and move results to new
;PRESENTING COMPLAINT field (#23)
;
NEW AMERADM,X1,X2,X,II,QA3IEN
;
;Switch ER INPUT MAP QA3 entry to save in field 23 instead of field 8
S QA3IEN=$O(^AMER(2.3,"B","QA3",""))
I QA3IEN]"" D
. NEW AMERUPD,ERROR
. S AMERUPD(9009082.3,QA3IEN_",",.04)=23
. D FILE^DIE("","AMERUPD","ERROR")
;
;Move Presenting Complaint data from field 8 to field 23
;
;Reset Monitoring Global
K ^XTMP("AMERP8LOG")
;
;Get later date
S X1=DT,X2=60 D C^%DTC
;
;Set up Monitoring Global
S ^XTMP("AMERP8LOG",0)=X_U_DT_U_"Log of entries moved from old PC to new PC"
;
S (II,AMERADM)=0 F S AMERADM=$O(^AMERADM(AMERADM)) Q:'AMERADM D
. NEW OLDPC,NEWPC,AMERUPD,ERROR
. ;
. ;Retrieve new presenting complaint value (already converted)
. S NEWPC=$$GET1^DIQ(9009081,AMERADM_",",23,"I") Q:NEWPC]""
. ;
. ;Retrieve old presenting complaint value
. S OLDPC=$$GET1^DIQ(9009081,AMERADM_",",8,"I") Q:OLDPC=""
. ;
. ;Save to new
. S AMERUPD(9009081,AMERADM_",",23)=OLDPC
. D FILE^DIE("","AMERUPD","ERROR")
. S II=II+1,^XTMP("AMERP8LOG",9009081,II)=AMERADM_U_OLDPC
;
Q
;
INSTALLD(AMERSTAL) ;EP - Determine if patch AMERSTAL was installed, where
; AMERSTAL is the name of the INSTALL. E.g "AMER*3.0*7"
;
NEW AMERY,INST
;
S AMERY=$O(^XPD(9.7,"B",AMERSTAL,""))
S INST=$S(AMERY>0:1,1:0)
D IMES(AMERSTAL,INST)
Q INST
;
IMES(AMERSTAL,Y) ;Display message to screen
D MES^XPDUTL($$CJ^XLFSTR("Patch """_AMERSTAL_""" is"_$S(Y<1:" *NOT*",1:"")_" installed.",IOM))
Q
;
FIX(X) ;
KILL DIFQ
I X=3 S XPDQUIT=2 Q
S XPDQUIT=X
W *7,!,$$CJ^XLFSTR("This patch must be installed prior to the installation of AMER*3.0*7",IOM)
Q
AMER3P08 ;GDIT/HS/BEE - AMER v3.0 Patch 8 ENV Check/PST Check ; 07 Oct 2013 11:33 AM
+1 ;;3.0;ER VISIT SYSTEM;**8**;MAR 03, 2009;Build 23
+2 ;
+3 ;Check for AMER*3.0*7
+4 IF '$$INSTALLD("AMER*3.0*7")
DO FIX(2)
+5 ;
+6 QUIT
+7 ;
PST ;Post installation front end
+1 ;
+2 ;Need to loop through old PRESENTING COMPLAINT (#8) field and move results to new
+3 ;PRESENTING COMPLAINT field (#23)
+4 ;
+5 NEW AMERADM,X1,X2,X,II,QA3IEN
+6 ;
+7 ;Switch ER INPUT MAP QA3 entry to save in field 23 instead of field 8
+8 SET QA3IEN=$ORDER(^AMER(2.3,"B","QA3",""))
+9 IF QA3IEN]""
Begin DoDot:1
+10 NEW AMERUPD,ERROR
+11 SET AMERUPD(9009082.3,QA3IEN_",",.04)=23
+12 DO FILE^DIE("","AMERUPD","ERROR")
End DoDot:1
+13 ;
+14 ;Move Presenting Complaint data from field 8 to field 23
+15 ;
+16 ;Reset Monitoring Global
+17 KILL ^XTMP("AMERP8LOG")
+18 ;
+19 ;Get later date
+20 SET X1=DT
SET X2=60
DO C^%DTC
+21 ;
+22 ;Set up Monitoring Global
+23 SET ^XTMP("AMERP8LOG",0)=X_U_DT_U_"Log of entries moved from old PC to new PC"
+24 ;
+25 SET (II,AMERADM)=0
FOR
SET AMERADM=$ORDER(^AMERADM(AMERADM))
IF 'AMERADM
QUIT
Begin DoDot:1
+26 NEW OLDPC,NEWPC,AMERUPD,ERROR
+27 ;
+28 ;Retrieve new presenting complaint value (already converted)
+29 SET NEWPC=$$GET1^DIQ(9009081,AMERADM_",",23,"I")
IF NEWPC]""
QUIT
+30 ;
+31 ;Retrieve old presenting complaint value
+32 SET OLDPC=$$GET1^DIQ(9009081,AMERADM_",",8,"I")
IF OLDPC=""
QUIT
+33 ;
+34 ;Save to new
+35 SET AMERUPD(9009081,AMERADM_",",23)=OLDPC
+36 DO FILE^DIE("","AMERUPD","ERROR")
+37 SET II=II+1
SET ^XTMP("AMERP8LOG",9009081,II)=AMERADM_U_OLDPC
End DoDot:1
+38 ;
+39 QUIT
+40 ;
INSTALLD(AMERSTAL) ;EP - Determine if patch AMERSTAL was installed, where
+1 ; AMERSTAL is the name of the INSTALL. E.g "AMER*3.0*7"
+2 ;
+3 NEW AMERY,INST
+4 ;
+5 SET AMERY=$ORDER(^XPD(9.7,"B",AMERSTAL,""))
+6 SET INST=$SELECT(AMERY>0:1,1:0)
+7 DO IMES(AMERSTAL,INST)
+8 QUIT INST
+9 ;
IMES(AMERSTAL,Y) ;Display message to screen
+1 DO MES^XPDUTL($$CJ^XLFSTR("Patch """_AMERSTAL_""" is"_$SELECT(Y<1:" *NOT*",1:"")_" installed.",IOM))
+2 QUIT
+3 ;
FIX(X) ;
+1 KILL DIFQ
+2 IF X=3
SET XPDQUIT=2
QUIT
+3 SET XPDQUIT=X
+4 WRITE *7,!,$$CJ^XLFSTR("This patch must be installed prior to the installation of AMER*3.0*7",IOM)
+5 QUIT