BLRPR30P ;IHS/OIT/MKK - IHS Lab PATCH 1030 Post Install Routine ;FEB 09, 2011 6:45 AM
;;5.2;IHS LABORATORY;**1030**;NOV 01, 1997
;
; Cloned from BLRPR27P
;
Q
;
EP ; EP
D EEP^BLRGMENU
Q
;
; Modify the Estimated Average Glucose (EAG) Delta Check so that only a
; NUMERIC A1C result will store data. If the A1C result is not numeric,
; DO NOT store anything.
MODEAGDC ; EP
NEW DESC,DESC1STR,DESC2STR,NAME,OVER1,OVER1STR,XCODE,XCODESTR
NEW A1CIEN,A1CDESC,CP,MESSAGE,TARGET
;
S CP=$P($T(+2),"*",3) ; Current Patch
;
D MKDELTA("HEMOGLOBIN A1C","ESTIMATED AVERAGE GLUCOSE","Modified by IHS Lab Patch "_CP)
Q
;
MKDELTA(F60TEST1,F60TEST2,FRMWHERE) ; EP
NEW EAGDNAME
;
S XCODESTR="S %X="""" X:$D(LRDEL(1)) LRDEL(1) W:+$G(%X)>0 "" ESTIMATED AVERAGE GLUCOSE:"",$P(%X,""^"") S:+$G(%X)>0 LRSB($$GETDNAM^BLREXECU("""_F60TEST2_"""))=%X K %,%X,%Y,%Z,%ZZ"
S OVER1STR="S %ZZ=$$GETDNAM^BLREXECU("""_F60TEST1_""") X:LRVRM>0 ""F %=%ZZ S %X(%)=$S(%=LRSB:X,$D(LRSB(%)):+LRSB(%),1:0)"" X:LRVRM>0 ""F %=%ZZ S %X(%)=$S($D(LRSB(%)):LRSB(%),1:0)"" S %X=$FN((((X)*28.7)-46.7),"""",0)"
S OVER1STR=OVER1STR_"_""^^!!!!!!^^!!!!!!mg/dl!!^^^^""_$G(DUZ(2))"
;
S NAME="EAG"
S EAGDNAME=$$GETDNAM^BLREXECU(F60TEST2)
S EAGDNAME=$P($G(^DD(63.04,EAGDNAME,0)),"^")
S XCODE=XCODESTR
S OVER1=OVER1STR
S DESC(1)="This delta check, when added to the A1C test, will calculate an Estimated"
S DESC(2)="Average Glucose (EAG) using the equation: EAG=((A1C)*28.7)-46.7. It will"
S DESC(3)="stuff the result into the "_EAGDNAME_" Location (Data Name). NOTE: if "
S DESC(4)="the result of the A1C test is not numeric, or if the EAG evaluates to a"
S DESC(5)="number < 1, no value will be inserted into the Estimated Average Glucose"
S DESC(6)="test."
D DLTADICA(NAME,XCODE,OVER1,.DESC,FRMWHERE)
;
Q
;
DLTADICA(NAME,XCODE,OVER1,DESC,FRMWHERE) ; EP
NEW DICT0,DICT1,FDA,ERRS,PTR
NEW HEREYAGO
;
D BMES^XPDUTL("Modifying "_NAME_" Delta Check")
;
D ^XBFMK
K ERRS,FDA,IENS,DIE
;
S DICT1="62.1"
S FDA(DICT1,"?+1,",.01)=NAME ; Find the Name node, or create it.
S FDA(DICT1,"?+1,",10)=XCODE ; Execute Code
S FDA(DICT1,"?+1,",20)=OVER1 ; Overflow 1
D UPDATE^DIE("S","FDA",,"ERRS")
;
I $D(ERRS("DIERR"))>0 D Q
. D SORRY^BLRPRE27("Error in modifying "_NAME_" Delta Check XECUTABLE CODE field.","NONFATAL")
;
D OKAY^BLRKIDSU(NAME_" Delta Check XECUTABLE CODE field modified.",5)
;
; Modify the Description
K ERRS
D FIND^DIC(62.1,"","","",NAME,"","","","","HEREYAGO") ; Get Pointer
S PTR=$G(HEREYAGO("DILIST",2,1))
M WPARRAY("WP")=DESC
D WP^DIE(62.1,PTR_",",30,"K","WPARRAY(""WP"")","ERRS")
;
I $D(ERRS("DIERR"))>0 D Q
. D SORRY^BLRPRE27("Error in modifying DESCRIPTION of "_NAME_" Delta Check.","NONFATAL")
;
D OKAY^BLRKIDSU(NAME_" Delta Check DESCRIPTION modified.",5)
;
; Modify the SITE NOTES DATE
K ERRS,FDA
S FDA(62.131,"?+1,"_PTR_",",.01)=$P($$NOW^XLFDT,".",1)
D UPDATE^DIE("S","FDA",,"ERRS")
;
I $D(ERRS("DIERR"))>0 D Q
. D SORRY^BLRPRE27("Error in modifying SITES NOTES DATE of "_NAME_" Delta Check.","NONFATAL")
;
D OKAY^BLRKIDSU(NAME_" Delta Check SITES NOTES DATE modified.",5)
;
; Modify the TEXT
K ERRS,WPARRAY
S WPARRAY("WP",1)=FRMWHERE
D WP^DIE(62.131,"1,"_PTR_",",1,"K","WPARRAY(""WP"")","ERRS")
;
I $D(ERRS("DIERR"))>0 D Q
. D SORRY^BLRPRE27("Error in modifying TEXT of "_NAME_" Delta Check.","NONFATAL")
;
D OKAY^BLRKIDSU(NAME_" Delta Check TEXT modified.",5)
D MES^XPDUTL(NAME_" Delta Check Successfully Modified.")
D MES^XPDUTL("")
Q
;
; Create new Estimated Average Glucose that will use GETREFR^BLRLINKU call to get
; Reference Ranges & Units to stuff into File 63
NEWEAG ; EP
NEW DESC,DESC1STR,DESC2STR,NAME,OVER1,OVER1STR,XCODE,XCODESTR
NEW A1CIEN,A1CDESC,CP,MESSAGE,TARGET
;
S CP=$P($T(+2),"*",3) ; Current Patch
;
D MKNDELTA("ESTIMATED AVERAGE GLUCOSE","Created by IHS Lab Patch "_CP,"MEAG")
Q
;
MKNDELTA(F60TEST2,FRMWHERE,EAGDNAME) ; EP
S XCODESTR="S %X="""" X:$D(LRDEL(1)) LRDEL(1) W:+$G(%X)>0 "" ESTIMATED AVERAGE GLUCOSE:"",$P(%X,""^"") S:+$G(%X)>0 LRSB($$GETDNAM^BLREXECU("""_F60TEST2_"""))=%X K %,%X,%Y,%Z,%ZZ"
S OVER1STR="S %ZZ=$$GETREFR^BLRUTIL3(""ESTIMATED AVERAGE GLUCOSE"") S %XX=$FN((((X)*28.7)-46.7),"""",0) S %YY=$S(%XX'>$P(%ZZ,""!"",2):""L"",%XX'<$P(%ZZ,""!"",3):""H"",1:"""") S %X=%XX_""^""_%YY_""^!!!!!!^^""_%ZZ_""^^^^""_$G(DUZ(2))"
;
S XCODE=XCODESTR
S OVER1=OVER1STR
S DESC(1)="This delta check, when added to the A1C test, will calculate an Estimated"
S DESC(2)="Average Glucose (EAG) using the equation:"
S DESC(3)=" EAG=((A1C)*28.7)-46.7."
S DESC(4)=" "
S DESC(5)="It will store the calculated result in the LAB DATA (# 63) File."
S DESC(6)="It will also store the UNITS, REFERENCE LOW, and REFERENCE HIGH values for"
S DESC(7)="the ESTIMATED AVERAGE GLUCOSE test in the LAB DATA (#63) file, if those"
S DESC(8)="entries exist."
S DESC(9)=" "
S DESC(10)="NOTE: if the result of the A1C test is not numeric, OR if the EAG"
S DESC(11)=" calculation < 1, then data will NOT be stored into the"
S DESC(12)=" Estimated Average Glucose test."
S DESC(13)=" "
;
D NDLTADIC(EAGDNAME,XCODE,OVER1,.DESC,FRMWHERE)
;
Q
;
; Adding NEW delta check
NDLTADIC(NAME,XCODE,OVER1,DESC,FRMWHERE) ; EP
NEW DICT0,DICT1,FDA,ERRS,PTR
NEW HEREYAGO
;
D BMES^XPDUTL("Adding "_NAME_" to Delta Check Dictionary")
;
D ^XBFMK
K ERRS,FDA,IENS,DIE
;
S DICT1="62.1"
S FDA(DICT1,"?+1,",.01)=NAME ; Find the Name node, or create it.
S FDA(DICT1,"?+1,",10)=XCODE ; Execute Code
S FDA(DICT1,"?+1,",20)=OVER1 ; Overflow 1
D UPDATE^DIE("S","FDA",,"ERRS")
;
I $D(ERRS("DIERR"))>0 D Q
. D SORRY^BLRPRE27("Error in adding "_NAME_" to the Delta Check Dictionary.","NONFATAL")
;
D OKAY^BLRKIDSU(NAME_" Delta Check added to Delta Check Dictionary.",5)
;
; Now, add the Description
K ERRS
D FIND^DIC(62.1,"","","",NAME,"","","","","HEREYAGO") ; Get Pointer
S PTR=$G(HEREYAGO("DILIST",2,1))
M WPARRAY("WP")=DESC
D WP^DIE(62.1,PTR_",",30,"K","WPARRAY(""WP"")","ERRS")
;
I $D(ERRS("DIERR"))>0 D Q
. D SORRY^BLRPRE27("Error in adding DESCRIPTION to "_NAME_" Delta Check in the Delta Check Dictionary.","NONFATAL")
;
D OKAY^BLRKIDSU(NAME_" Delta Check DESCRIPTION added to Delta Check Dictionary.",5)
;
; Now, add the SITE NOTES DATE
K ERRS,FDA
S FDA(62.131,"?+1,"_PTR_",",.01)=$P($$NOW^XLFDT,".",1)
D UPDATE^DIE("S","FDA",,"ERRS")
;
I $D(ERRS("DIERR"))>0 D Q
. D SORRY^BLRPRE27("Error in adding SITES NOTES DATE to "_NAME_" Delta Check in the Delta Check Dictionary.","NONFATAL")
;
; Now, add the TEXT
K ERRS,WPARRAY
S WPARRAY("WP",1)=FRMWHERE
D WP^DIE(62.131,"1,"_PTR_",",1,"K","WPARRAY(""WP"")","ERRS")
;
I $D(ERRS("DIERR"))>0 D Q
. D SORRY^BLRPRE27("Error in adding TEXT to "_NAME_" Delta Check in the Delta Check Dictionary.","NONFATAL")
;
D OKAY^BLRKIDSU(NAME_" Delta Check TEXT added to Delta Check Dictionary.",5)
D BMES^XPDUTL(NAME_" Successfully Added to Delta Check Dictionary")
Q
BLRPR30P ;IHS/OIT/MKK - IHS Lab PATCH 1030 Post Install Routine ;FEB 09, 2011 6:45 AM
+1 ;;5.2;IHS LABORATORY;**1030**;NOV 01, 1997
+2 ;
+3 ; Cloned from BLRPR27P
+4 ;
+5 QUIT
+6 ;
EP ; EP
+1 DO EEP^BLRGMENU
+2 QUIT
+3 ;
+4 ; Modify the Estimated Average Glucose (EAG) Delta Check so that only a
+5 ; NUMERIC A1C result will store data. If the A1C result is not numeric,
+6 ; DO NOT store anything.
MODEAGDC ; EP
+1 NEW DESC,DESC1STR,DESC2STR,NAME,OVER1,OVER1STR,XCODE,XCODESTR
+2 NEW A1CIEN,A1CDESC,CP,MESSAGE,TARGET
+3 ;
+4 ; Current Patch
SET CP=$PIECE($TEXT(+2),"*",3)
+5 ;
+6 DO MKDELTA("HEMOGLOBIN A1C","ESTIMATED AVERAGE GLUCOSE","Modified by IHS Lab Patch "_CP)
+7 QUIT
+8 ;
MKDELTA(F60TEST1,F60TEST2,FRMWHERE) ; EP
+1 NEW EAGDNAME
+2 ;
+3 SET XCODESTR="S %X="""" X:$D(LRDEL(1)) LRDEL(1) W:+$G(%X)>0 "" ESTIMATED AVERAGE GLUCOSE:"",$P(%X,""^"") S:+$G(%X)>0 LRSB($$GETDNAM^BLREXECU("""_F60TEST2_"""))=%X K %,%X,%Y,%Z,%ZZ"
+4 SET OVER1STR="S %ZZ=$$GETDNAM^BLREXECU("""_F60TEST1_""") X:LRVRM>0 ""F %=%ZZ S %X(%)=$S(%=LRSB:X,$D(LRSB(%)):+LRSB(%),1:0)"" X:LRVRM>0 ""F %=%ZZ S %X(%)=$S($D(LRSB(%)):LRSB(%),1:0)"" S %X=$FN((((X)*28.7)-46.7),"""",0)"
+5 SET OVER1STR=OVER1STR_"_""^^!!!!!!^^!!!!!!mg/dl!!^^^^""_$G(DUZ(2))"
+6 ;
+7 SET NAME="EAG"
+8 SET EAGDNAME=$$GETDNAM^BLREXECU(F60TEST2)
+9 SET EAGDNAME=$PIECE($GET(^DD(63.04,EAGDNAME,0)),"^")
+10 SET XCODE=XCODESTR
+11 SET OVER1=OVER1STR
+12 SET DESC(1)="This delta check, when added to the A1C test, will calculate an Estimated"
+13 SET DESC(2)="Average Glucose (EAG) using the equation: EAG=((A1C)*28.7)-46.7. It will"
+14 SET DESC(3)="stuff the result into the "_EAGDNAME_" Location (Data Name). NOTE: if "
+15 SET DESC(4)="the result of the A1C test is not numeric, or if the EAG evaluates to a"
+16 SET DESC(5)="number < 1, no value will be inserted into the Estimated Average Glucose"
+17 SET DESC(6)="test."
+18 DO DLTADICA(NAME,XCODE,OVER1,.DESC,FRMWHERE)
+19 ;
+20 QUIT
+21 ;
DLTADICA(NAME,XCODE,OVER1,DESC,FRMWHERE) ; EP
+1 NEW DICT0,DICT1,FDA,ERRS,PTR
+2 NEW HEREYAGO
+3 ;
+4 DO BMES^XPDUTL("Modifying "_NAME_" Delta Check")
+5 ;
+6 DO ^XBFMK
+7 KILL ERRS,FDA,IENS,DIE
+8 ;
+9 SET DICT1="62.1"
+10 ; Find the Name node, or create it.
SET FDA(DICT1,"?+1,",.01)=NAME
+11 ; Execute Code
SET FDA(DICT1,"?+1,",10)=XCODE
+12 ; Overflow 1
SET FDA(DICT1,"?+1,",20)=OVER1
+13 DO UPDATE^DIE("S","FDA",,"ERRS")
+14 ;
+15 IF $DATA(ERRS("DIERR"))>0
Begin DoDot:1
+16 DO SORRY^BLRPRE27("Error in modifying "_NAME_" Delta Check XECUTABLE CODE field.","NONFATAL")
End DoDot:1
QUIT
+17 ;
+18 DO OKAY^BLRKIDSU(NAME_" Delta Check XECUTABLE CODE field modified.",5)
+19 ;
+20 ; Modify the Description
+21 KILL ERRS
+22 ; Get Pointer
DO FIND^DIC(62.1,"","","",NAME,"","","","","HEREYAGO")
+23 SET PTR=$GET(HEREYAGO("DILIST",2,1))
+24 MERGE WPARRAY("WP")=DESC
+25 DO WP^DIE(62.1,PTR_",",30,"K","WPARRAY(""WP"")","ERRS")
+26 ;
+27 IF $DATA(ERRS("DIERR"))>0
Begin DoDot:1
+28 DO SORRY^BLRPRE27("Error in modifying DESCRIPTION of "_NAME_" Delta Check.","NONFATAL")
End DoDot:1
QUIT
+29 ;
+30 DO OKAY^BLRKIDSU(NAME_" Delta Check DESCRIPTION modified.",5)
+31 ;
+32 ; Modify the SITE NOTES DATE
+33 KILL ERRS,FDA
+34 SET FDA(62.131,"?+1,"_PTR_",",.01)=$PIECE($$NOW^XLFDT,".",1)
+35 DO UPDATE^DIE("S","FDA",,"ERRS")
+36 ;
+37 IF $DATA(ERRS("DIERR"))>0
Begin DoDot:1
+38 DO SORRY^BLRPRE27("Error in modifying SITES NOTES DATE of "_NAME_" Delta Check.","NONFATAL")
End DoDot:1
QUIT
+39 ;
+40 DO OKAY^BLRKIDSU(NAME_" Delta Check SITES NOTES DATE modified.",5)
+41 ;
+42 ; Modify the TEXT
+43 KILL ERRS,WPARRAY
+44 SET WPARRAY("WP",1)=FRMWHERE
+45 DO WP^DIE(62.131,"1,"_PTR_",",1,"K","WPARRAY(""WP"")","ERRS")
+46 ;
+47 IF $DATA(ERRS("DIERR"))>0
Begin DoDot:1
+48 DO SORRY^BLRPRE27("Error in modifying TEXT of "_NAME_" Delta Check.","NONFATAL")
End DoDot:1
QUIT
+49 ;
+50 DO OKAY^BLRKIDSU(NAME_" Delta Check TEXT modified.",5)
+51 DO MES^XPDUTL(NAME_" Delta Check Successfully Modified.")
+52 DO MES^XPDUTL("")
+53 QUIT
+54 ;
+55 ; Create new Estimated Average Glucose that will use GETREFR^BLRLINKU call to get
+56 ; Reference Ranges & Units to stuff into File 63
NEWEAG ; EP
+1 NEW DESC,DESC1STR,DESC2STR,NAME,OVER1,OVER1STR,XCODE,XCODESTR
+2 NEW A1CIEN,A1CDESC,CP,MESSAGE,TARGET
+3 ;
+4 ; Current Patch
SET CP=$PIECE($TEXT(+2),"*",3)
+5 ;
+6 DO MKNDELTA("ESTIMATED AVERAGE GLUCOSE","Created by IHS Lab Patch "_CP,"MEAG")
+7 QUIT
+8 ;
MKNDELTA(F60TEST2,FRMWHERE,EAGDNAME) ; EP
+1 SET XCODESTR="S %X="""" X:$D(LRDEL(1)) LRDEL(1) W:+$G(%X)>0 "" ESTIMATED AVERAGE GLUCOSE:"",$P(%X,""^"") S:+$G(%X)>0 LRSB($$GETDNAM^BLREXECU("""_F60TEST2_"""))=%X K %,%X,%Y,%Z,%ZZ"
+2 SET OVER1STR="S %ZZ=$$GETREFR^BLRUTIL3(""ESTIMATED AVERAGE GLUCOSE"") S %XX=$FN((((X)*28.7)-46.7),"""",0) S %YY=$S(%XX'>$P(%ZZ,""!"",2):""L"",%XX'<$P(%ZZ,""!"",3):""H"",1:"""") S %X=%XX_""^""_%YY_""^!!!!!!^^""_%ZZ_""^^^^""_$G(DUZ(2))"
+3 ;
+4 SET XCODE=XCODESTR
+5 SET OVER1=OVER1STR
+6 SET DESC(1)="This delta check, when added to the A1C test, will calculate an Estimated"
+7 SET DESC(2)="Average Glucose (EAG) using the equation:"
+8 SET DESC(3)=" EAG=((A1C)*28.7)-46.7."
+9 SET DESC(4)=" "
+10 SET DESC(5)="It will store the calculated result in the LAB DATA (# 63) File."
+11 SET DESC(6)="It will also store the UNITS, REFERENCE LOW, and REFERENCE HIGH values for"
+12 SET DESC(7)="the ESTIMATED AVERAGE GLUCOSE test in the LAB DATA (#63) file, if those"
+13 SET DESC(8)="entries exist."
+14 SET DESC(9)=" "
+15 SET DESC(10)="NOTE: if the result of the A1C test is not numeric, OR if the EAG"
+16 SET DESC(11)=" calculation < 1, then data will NOT be stored into the"
+17 SET DESC(12)=" Estimated Average Glucose test."
+18 SET DESC(13)=" "
+19 ;
+20 DO NDLTADIC(EAGDNAME,XCODE,OVER1,.DESC,FRMWHERE)
+21 ;
+22 QUIT
+23 ;
+24 ; Adding NEW delta check
NDLTADIC(NAME,XCODE,OVER1,DESC,FRMWHERE) ; EP
+1 NEW DICT0,DICT1,FDA,ERRS,PTR
+2 NEW HEREYAGO
+3 ;
+4 DO BMES^XPDUTL("Adding "_NAME_" to Delta Check Dictionary")
+5 ;
+6 DO ^XBFMK
+7 KILL ERRS,FDA,IENS,DIE
+8 ;
+9 SET DICT1="62.1"
+10 ; Find the Name node, or create it.
SET FDA(DICT1,"?+1,",.01)=NAME
+11 ; Execute Code
SET FDA(DICT1,"?+1,",10)=XCODE
+12 ; Overflow 1
SET FDA(DICT1,"?+1,",20)=OVER1
+13 DO UPDATE^DIE("S","FDA",,"ERRS")
+14 ;
+15 IF $DATA(ERRS("DIERR"))>0
Begin DoDot:1
+16 DO SORRY^BLRPRE27("Error in adding "_NAME_" to the Delta Check Dictionary.","NONFATAL")
End DoDot:1
QUIT
+17 ;
+18 DO OKAY^BLRKIDSU(NAME_" Delta Check added to Delta Check Dictionary.",5)
+19 ;
+20 ; Now, add the Description
+21 KILL ERRS
+22 ; Get Pointer
DO FIND^DIC(62.1,"","","",NAME,"","","","","HEREYAGO")
+23 SET PTR=$GET(HEREYAGO("DILIST",2,1))
+24 MERGE WPARRAY("WP")=DESC
+25 DO WP^DIE(62.1,PTR_",",30,"K","WPARRAY(""WP"")","ERRS")
+26 ;
+27 IF $DATA(ERRS("DIERR"))>0
Begin DoDot:1
+28 DO SORRY^BLRPRE27("Error in adding DESCRIPTION to "_NAME_" Delta Check in the Delta Check Dictionary.","NONFATAL")
End DoDot:1
QUIT
+29 ;
+30 DO OKAY^BLRKIDSU(NAME_" Delta Check DESCRIPTION added to Delta Check Dictionary.",5)
+31 ;
+32 ; Now, add the SITE NOTES DATE
+33 KILL ERRS,FDA
+34 SET FDA(62.131,"?+1,"_PTR_",",.01)=$PIECE($$NOW^XLFDT,".",1)
+35 DO UPDATE^DIE("S","FDA",,"ERRS")
+36 ;
+37 IF $DATA(ERRS("DIERR"))>0
Begin DoDot:1
+38 DO SORRY^BLRPRE27("Error in adding SITES NOTES DATE to "_NAME_" Delta Check in the Delta Check Dictionary.","NONFATAL")
End DoDot:1
QUIT
+39 ;
+40 ; Now, add the TEXT
+41 KILL ERRS,WPARRAY
+42 SET WPARRAY("WP",1)=FRMWHERE
+43 DO WP^DIE(62.131,"1,"_PTR_",",1,"K","WPARRAY(""WP"")","ERRS")
+44 ;
+45 IF $DATA(ERRS("DIERR"))>0
Begin DoDot:1
+46 DO SORRY^BLRPRE27("Error in adding TEXT to "_NAME_" Delta Check in the Delta Check Dictionary.","NONFATAL")
End DoDot:1
QUIT
+47 ;
+48 DO OKAY^BLRKIDSU(NAME_" Delta Check TEXT added to Delta Check Dictionary.",5)
+49 DO BMES^XPDUTL(NAME_" Successfully Added to Delta Check Dictionary")
+50 QUIT