ORY377 ;ISP/RFR - INSTALLATION ACTIONS FOR CPRS VERSION 31.B;Dec 20, 2019@15:10
;;3.0;ORDER ENTRY/RESULTS REPORTING;**377**;Dec 17, 1997;Build 582
Q
PRE ;PRE-INSTALL ACTIONS
N ORI,DIK,DA
F ORI=79,84:1:87,90 D
.I $D(^ORD(100.9,ORI,0)) D
..N ORMSG
..S ORMSG(1)=" WARNING:",ORMSG(2)=" A notification already exists in entry number "_ORI_" and will be overwritten."
..D BMES^XPDUTL(.ORMSG)
..S DIK="^ORD(100.9,",DA=ORI
..D ^DIK
S DIK="^ORD(101.24,",DA=1605
I $D(@(DIK_DA_",0)")) D
.D BMES^XPDUTL(" Deleting report "_$P($G(@(DIK_DA_",0)")),U)_"...")
.D ^DIK
.D MES^XPDUTL(" DONE")
Q
POST ;POST-INSTALL ACTIONS
D EN^ORY377O,AUTODC^ORY377O
D DLGBULL,NEWNOT,TOOLMENU
D SETPARAM,ADDPAR
Q
;
SETPARAM ;
D BMES^XPDUTL(" Setting value for parameter OR RELEASE FORM TEXT...")
N ORVAL,ORERR
S ORVAL="default"
S ORVAL(1)="Use Admit if the patient is newly admitted to the hospital or nursing"
S ORVAL(2)="home. Use Transfer if inpatient will move from one ward or treating team"
S ORVAL(3)="to another."
D EN^XPAR("PKG","OR RELEASE FORM TEXT","1",.ORVAL,.ORERR)
I +$G(ORERR)>0 D MES^XPDUTL(" ERROR #"_$P(ORERR,U)_": "_$P(ORERR,U,2)) Q
D MES^XPDUTL(" DONE")
D BMES^XPDUTL(" Setting value for parameter OR CPRS HELP DESK TEXT...")
N ORVAL,ORERR
S ORVAL="default"
S ORVAL(1)="your local CPRS help desk"
D EN^XPAR("PKG","OR CPRS HELP DESK TEXT","1",.ORVAL,.ORERR)
I +$G(ORERR)>0 D MES^XPDUTL(" ERROR #"_$P(ORERR,U)_": "_$P(ORERR,U,2)) Q
D MES^XPDUTL(" DONE")
D BMES^XPDUTL(" Setting value for parameter OR EXCLUDE FROM MIXCASE...")
N OREXMIX
S OREXMIX(1)="1^II"
S OREXMIX(2)="2^III"
S OREXMIX(3)="3^IV"
S OREXMIX(4)="4^VI"
S OREXMIX(5)="5^VII"
S OREXMIX(6)="6^VIII"
S OREXMIX(7)="7^IX"
S OREXMIX(8)="8^-VA"
S OREXMIX(9)="9^HCS"
S OREXMIX(10)="10^VAMC"
S OREXMIX(11)="11^VAMCROC"
D EN^XPAR("SYS","OR EXCLUDE FROM MIXCASE",.OREXMIX,.ORERR)
I +$G(ORERR)>0 D MES^XPDUTL(" ERROR #"_$P(ORERR,U)_": "_$P(ORERR,U,2)) Q
D MES^XPDUTL(" DONE")
Q
SENDDLG(ANAME) ;Return true if the current order dialog should be sent
I ANAME="FHW1" Q 1
I ANAME="FHW OP MEAL" Q 1
I ANAME="FHW8" Q 1
I ANAME="OR GTX DAYS SUPPLY" Q 1
I ANAME="RA OERR EXAM" Q 1
I ANAME="SD RTC" Q 1
Q 0
;
DLGBULL ;Send bulletin about modified dialogs (on first install)
N I,ORD
F I="FHW1","FHW OP MEAL","FHW8","GMRCOR CONSULT","GMRCOR REQUEST","SD RTC" S ORD(I)=""
D EN^ORYDLG(377,.ORD)
Q
N ORERR
D NDEL^XPAR("PKG","ORWT TOOLS MENU",.ORERR)
I ORERR D BMES^XPDUTL(" Error deleting existing PKG level tools menu items")
I 'ORERR D BMES^XPDUTL(" Deleted existing PKG level tools menu items.")
S ORERR=0
D ADD^XPAR("PKG","ORWT TOOLS MENU","1","Veteran Health Library=https://www.veteranshealthlibrary.domain.ext",.ORERR)
I ORERR D BMES^XPDUTL(" Error adding new PKG level tools menu item.")
I 'ORERR D BMES^XPDUTL(" Added new PKG level tools menu item.")
Q
NEWNOT ;Configure new notifications
N ENT,EXIT,INST,ORMSG,LINE,ORI,CONFIG
D BMES^XPDUTL(" Loading parameter values for new notifications...")
S ENT="PKG.ORDER ENTRY/RESULTS REPORTING"
D PRECIP(.CONFIG)
F ORI=79,84:1:87,90 D S EXIT=0
.F LINE=1:1 Q:$G(EXIT) D
..N TEXT,ORERROR
..S TEXT=$P($T(PARAM+LINE),";;",2)
..S INST=$P($G(^ORD(100.9,ORI,0)),U,1)
..I $P(TEXT," ")="ORB" D Q
...I $P(TEXT,U)["PROCESSING FLAG","^79^86^87^"[(U_ORI_U) S $P(TEXT,U,2)="Enabled"
...I $P(TEXT,U)["ORB PROVIDER RECIPIENTS",$D(CONFIG(INST))=1 S $P(TEXT,U,2)=CONFIG(INST)
...D EN^XPAR(ENT,$P(TEXT,U),INST,$P(TEXT,U,2),.ORERROR) ;ICR #2336
...I +ORERROR D
....S ORMSG(1)=" ",EXIT=2
....S ORMSG(2)="ERROR: Unable to configure the new "_INST_" notification"
....S ORMSG(3)="Kernel Parameter Tools Error #"_+ORERROR_": "_$P(ORERROR,U,2)
....D BMES^XPDUTL(.ORMSG)
..I TEXT="" S EXIT=1
D:$G(EXIT)<2 MES^XPDUTL(" Finished loading new notification values")
Q
SENDNOT(ANAME) ;Return true if the current notification should be sent
I ANAME="SMART ABNORMAL IMAGING RESULTS" Q 1
I ANAME="SMART NON-CRITICAL IMAGING RES" Q 1
I ANAME="PREG/LACT UNSAFE ORDERS" Q 1
I ANAME="PREGNANCY STATUS REVIEW" Q 1
I ANAME="LACTATION STATUS REVIEW" Q 1
I ANAME="SCHEDULED ALERT" Q 1
Q 0
ADDPAR ;Add ORQQTIU COPY/PASTE EXCLUDE APP parameter entry
N ERR,FLG,RSLT,X
D BMES^XPDUTL("Adding ""natspeak.exe"" to the ORQQTIU COPY/PASTE EXCLUDE APP parameter.")
K RSLT D GETLST^XPAR(.RSLT,"PKG.ORDER ENTRY/RESULTS REPORTING","ORQQTIU COPY/PASTE EXCLUDE APP","E")
S FLG=0
S X="" F S X=$O(RSLT(X)) Q:X="" I $P($G(RSLT(X)),U,1)="natspeak.exe" S FLG=1 Q
I FLG=1 D
. D BMES^XPDUTL("""natspeak.exe"" already exists in the ORQQTIU COPY/PASTE EXCLUDE APP parameter!")
. D MES^XPDUTL(" Aborting add process!")
I FLG=0 D
. K ERR
. S ERR=""
. D ADD^XPAR("PKG.ORDER ENTRY/RESULTS REPORTING","ORQQTIU COPY/PASTE EXCLUDE APP","natspeak.exe",,.ERR)
. I +ERR>0 D
.. D BMES^XPDUTL("Unable to add ""natspeak.exe"" to ORQQTIU COPY/PASTE EXCLUDE APP parameter")
.. D MES^XPDUTL("at Package level!")
.. D MES^XPDUTL(" ERROR: "_$P($G(ERR),U,2))
. I +ERR=0 D
.. D BMES^XPDUTL("""natspeak.exe"" successfully added to the ORQQTIU COPY/PASTE EXCLUDE APP")
.. D MES^XPDUTL(" parameter!")
Q
PARAM ;Default notification parameter values to load
;;ORB ARCHIVE PERIOD^30
;;ORB DELETE MECHANISM^All Recipients
;;ORB FORWARD BACKUP REVIEWER^0
;;ORB FORWARD SUPERVISOR^0
;;ORB FORWARD SURROGATES^0
;;ORB PROCESSING FLAG^Disabled
;;ORB PROVIDER RECIPIENTS^OP
;;ORB URGENCY^High
Q
PRECIP(CONFIG) ;Override default ORB PROVIDER RECIPIENTS parameter value in
;line tag PARAM
;CONFIG(NOTIFICATION_NAME)=PARAMETER_VALUE
K CONFIG
S CONFIG("PREG/LACT UNSAFE ORDERS")="OPR"
S CONFIG("PREGNANCY STATUS REVIEW")=""
S CONFIG("LACTATION STATUS REVIEW")=""
S CONFIG("SCHEDULED ALERT")=""
Q
SENDRPT(ORNAME) ;Return true if the current report should be sent
I ORNAME="ORRPW PHARMACY" Q 1
I ORNAME="ORRPW POTENTIALLY UNSAFE MEDS" Q 1
I ORNAME="ORCV WOMEN'S HEALTH" Q 1
I ORNAME="ORCV WOMEN'S HEALTH DETAILS" Q 1
I ORNAME="ORCV ALLERGIES" Q 1
I ORNAME="ORRP AP ALL" Q 1
I ORNAME="ORRPW LAB CY" Q 1
I ORNAME="ORRPW LAB EM" Q 1
I ORNAME="ORRPW LAB SP" Q 1
I ORNAME="ORL ANATOMIC PATHOLOGY" Q 1
I ORNAME="ORRPL LAB CY" Q 1
I ORNAME="ORRPL LAB EM" Q 1
I ORNAME="ORRPL LAB SP" Q 1
Q 0
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORY377 6479 printed Dec 13, 2024@02:41:35 Page 2
ORY377 ;ISP/RFR - INSTALLATION ACTIONS FOR CPRS VERSION 31.B;Dec 20, 2019@15:10
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**377**;Dec 17, 1997;Build 582
+2 QUIT
PRE ;PRE-INSTALL ACTIONS
+1 NEW ORI,DIK,DA
+2 FOR ORI=79,84:1:87,90
Begin DoDot:1
+3 IF $DATA(^ORD(100.9,ORI,0))
Begin DoDot:2
+4 NEW ORMSG
+5 SET ORMSG(1)=" WARNING:"
SET ORMSG(2)=" A notification already exists in entry number "_ORI_" and will be overwritten."
+6 DO BMES^XPDUTL(.ORMSG)
+7 SET DIK="^ORD(100.9,"
SET DA=ORI
+8 DO ^DIK
End DoDot:2
End DoDot:1
+9 SET DIK="^ORD(101.24,"
SET DA=1605
+10 IF $DATA(@(DIK_DA_",0)"))
Begin DoDot:1
+11 DO BMES^XPDUTL(" Deleting report "_$PIECE($GET(@(DIK_DA_",0)")),U)_"...")
+12 DO ^DIK
+13 DO MES^XPDUTL(" DONE")
End DoDot:1
+14 QUIT
POST ;POST-INSTALL ACTIONS
+1 DO EN^ORY377O
DO AUTODC^ORY377O
+2 DO DLGBULL
DO NEWNOT
DO TOOLMENU
+3 DO SETPARAM
DO ADDPAR
+4 QUIT
+5 ;
SETPARAM ;
+1 DO BMES^XPDUTL(" Setting value for parameter OR RELEASE FORM TEXT...")
+2 NEW ORVAL,ORERR
+3 SET ORVAL="default"
+4 SET ORVAL(1)="Use Admit if the patient is newly admitted to the hospital or nursing"
+5 SET ORVAL(2)="home. Use Transfer if inpatient will move from one ward or treating team"
+6 SET ORVAL(3)="to another."
+7 DO EN^XPAR("PKG","OR RELEASE FORM TEXT","1",.ORVAL,.ORERR)
+8 IF +$GET(ORERR)>0
DO MES^XPDUTL(" ERROR #"_$PIECE(ORERR,U)_": "_$PIECE(ORERR,U,2))
QUIT
+9 DO MES^XPDUTL(" DONE")
+10 DO BMES^XPDUTL(" Setting value for parameter OR CPRS HELP DESK TEXT...")
+11 NEW ORVAL,ORERR
+12 SET ORVAL="default"
+13 SET ORVAL(1)="your local CPRS help desk"
+14 DO EN^XPAR("PKG","OR CPRS HELP DESK TEXT","1",.ORVAL,.ORERR)
+15 IF +$GET(ORERR)>0
DO MES^XPDUTL(" ERROR #"_$PIECE(ORERR,U)_": "_$PIECE(ORERR,U,2))
QUIT
+16 DO MES^XPDUTL(" DONE")
+17 DO BMES^XPDUTL(" Setting value for parameter OR EXCLUDE FROM MIXCASE...")
+18 NEW OREXMIX
+19 SET OREXMIX(1)="1^II"
+20 SET OREXMIX(2)="2^III"
+21 SET OREXMIX(3)="3^IV"
+22 SET OREXMIX(4)="4^VI"
+23 SET OREXMIX(5)="5^VII"
+24 SET OREXMIX(6)="6^VIII"
+25 SET OREXMIX(7)="7^IX"
+26 SET OREXMIX(8)="8^-VA"
+27 SET OREXMIX(9)="9^HCS"
+28 SET OREXMIX(10)="10^VAMC"
+29 SET OREXMIX(11)="11^VAMCROC"
+30 DO EN^XPAR("SYS","OR EXCLUDE FROM MIXCASE",.OREXMIX,.ORERR)
+31 IF +$GET(ORERR)>0
DO MES^XPDUTL(" ERROR #"_$PIECE(ORERR,U)_": "_$PIECE(ORERR,U,2))
QUIT
+32 DO MES^XPDUTL(" DONE")
+33 QUIT
SENDDLG(ANAME) ;Return true if the current order dialog should be sent
+1 IF ANAME="FHW1"
QUIT 1
+2 IF ANAME="FHW OP MEAL"
QUIT 1
+3 IF ANAME="FHW8"
QUIT 1
+4 IF ANAME="OR GTX DAYS SUPPLY"
QUIT 1
+5 IF ANAME="RA OERR EXAM"
QUIT 1
+6 IF ANAME="SD RTC"
QUIT 1
+7 QUIT 0
+8 ;
DLGBULL ;Send bulletin about modified dialogs (on first install)
+1 NEW I,ORD
+2 FOR I="FHW1","FHW OP MEAL","FHW8","GMRCOR CONSULT","GMRCOR REQUEST","SD RTC"
SET ORD(I)=""
+3 DO EN^ORYDLG(377,.ORD)
+4 QUIT
+1 NEW ORERR
+2 DO NDEL^XPAR("PKG","ORWT TOOLS MENU",.ORERR)
+3 IF ORERR
DO BMES^XPDUTL(" Error deleting existing PKG level tools menu items")
+4 IF 'ORERR
DO BMES^XPDUTL(" Deleted existing PKG level tools menu items.")
+5 SET ORERR=0
+6 DO ADD^XPAR("PKG","ORWT TOOLS MENU","1","Veteran Health Library=https://www.veteranshealthlibrary.domain.ext",.ORERR)
+7 IF ORERR
DO BMES^XPDUTL(" Error adding new PKG level tools menu item.")
+8 IF 'ORERR
DO BMES^XPDUTL(" Added new PKG level tools menu item.")
+9 QUIT
NEWNOT ;Configure new notifications
+1 NEW ENT,EXIT,INST,ORMSG,LINE,ORI,CONFIG
+2 DO BMES^XPDUTL(" Loading parameter values for new notifications...")
+3 SET ENT="PKG.ORDER ENTRY/RESULTS REPORTING"
+4 DO PRECIP(.CONFIG)
+5 FOR ORI=79,84:1:87,90
Begin DoDot:1
+6 FOR LINE=1:1
if $GET(EXIT)
QUIT
Begin DoDot:2
+7 NEW TEXT,ORERROR
+8 SET TEXT=$PIECE($TEXT(PARAM+LINE),";;",2)
+9 SET INST=$PIECE($GET(^ORD(100.9,ORI,0)),U,1)
+10 IF $PIECE(TEXT," ")="ORB"
Begin DoDot:3
+11 IF $PIECE(TEXT,U)["PROCESSING FLAG"
IF "^79^86^87^"[(U_ORI_U)
SET $PIECE(TEXT,U,2)="Enabled"
+12 IF $PIECE(TEXT,U)["ORB PROVIDER RECIPIENTS"
IF $DATA(CONFIG(INST))=1
SET $PIECE(TEXT,U,2)=CONFIG(INST)
+13 ;ICR #2336
DO EN^XPAR(ENT,$PIECE(TEXT,U),INST,$PIECE(TEXT,U,2),.ORERROR)
+14 IF +ORERROR
Begin DoDot:4
+15 SET ORMSG(1)=" "
SET EXIT=2
+16 SET ORMSG(2)="ERROR: Unable to configure the new "_INST_" notification"
+17 SET ORMSG(3)="Kernel Parameter Tools Error #"_+ORERROR_": "_$PIECE(ORERROR,U,2)
+18 DO BMES^XPDUTL(.ORMSG)
End DoDot:4
End DoDot:3
QUIT
+19 IF TEXT=""
SET EXIT=1
End DoDot:2
End DoDot:1
SET EXIT=0
+20 if $GET(EXIT)<2
DO MES^XPDUTL(" Finished loading new notification values")
+21 QUIT
SENDNOT(ANAME) ;Return true if the current notification should be sent
+1 IF ANAME="SMART ABNORMAL IMAGING RESULTS"
QUIT 1
+2 IF ANAME="SMART NON-CRITICAL IMAGING RES"
QUIT 1
+3 IF ANAME="PREG/LACT UNSAFE ORDERS"
QUIT 1
+4 IF ANAME="PREGNANCY STATUS REVIEW"
QUIT 1
+5 IF ANAME="LACTATION STATUS REVIEW"
QUIT 1
+6 IF ANAME="SCHEDULED ALERT"
QUIT 1
+7 QUIT 0
ADDPAR ;Add ORQQTIU COPY/PASTE EXCLUDE APP parameter entry
+1 NEW ERR,FLG,RSLT,X
+2 DO BMES^XPDUTL("Adding ""natspeak.exe"" to the ORQQTIU COPY/PASTE EXCLUDE APP parameter.")
+3 KILL RSLT
DO GETLST^XPAR(.RSLT,"PKG.ORDER ENTRY/RESULTS REPORTING","ORQQTIU COPY/PASTE EXCLUDE APP","E")
+4 SET FLG=0
+5 SET X=""
FOR
SET X=$ORDER(RSLT(X))
if X=""
QUIT
IF $PIECE($GET(RSLT(X)),U,1)="natspeak.exe"
SET FLG=1
QUIT
+6 IF FLG=1
Begin DoDot:1
+7 DO BMES^XPDUTL("""natspeak.exe"" already exists in the ORQQTIU COPY/PASTE EXCLUDE APP parameter!")
+8 DO MES^XPDUTL(" Aborting add process!")
End DoDot:1
+9 IF FLG=0
Begin DoDot:1
+10 KILL ERR
+11 SET ERR=""
+12 DO ADD^XPAR("PKG.ORDER ENTRY/RESULTS REPORTING","ORQQTIU COPY/PASTE EXCLUDE APP","natspeak.exe",,.ERR)
+13 IF +ERR>0
Begin DoDot:2
+14 DO BMES^XPDUTL("Unable to add ""natspeak.exe"" to ORQQTIU COPY/PASTE EXCLUDE APP parameter")
+15 DO MES^XPDUTL("at Package level!")
+16 DO MES^XPDUTL(" ERROR: "_$PIECE($GET(ERR),U,2))
End DoDot:2
+17 IF +ERR=0
Begin DoDot:2
+18 DO BMES^XPDUTL("""natspeak.exe"" successfully added to the ORQQTIU COPY/PASTE EXCLUDE APP")
+19 DO MES^XPDUTL(" parameter!")
End DoDot:2
End DoDot:1
+20 QUIT
PARAM ;Default notification parameter values to load
+1 ;;ORB ARCHIVE PERIOD^30
+2 ;;ORB DELETE MECHANISM^All Recipients
+3 ;;ORB FORWARD BACKUP REVIEWER^0
+4 ;;ORB FORWARD SUPERVISOR^0
+5 ;;ORB FORWARD SURROGATES^0
+6 ;;ORB PROCESSING FLAG^Disabled
+7 ;;ORB PROVIDER RECIPIENTS^OP
+8 ;;ORB URGENCY^High
+9 QUIT
PRECIP(CONFIG) ;Override default ORB PROVIDER RECIPIENTS parameter value in
+1 ;line tag PARAM
+2 ;CONFIG(NOTIFICATION_NAME)=PARAMETER_VALUE
+3 KILL CONFIG
+4 SET CONFIG("PREG/LACT UNSAFE ORDERS")="OPR"
+5 SET CONFIG("PREGNANCY STATUS REVIEW")=""
+6 SET CONFIG("LACTATION STATUS REVIEW")=""
+7 SET CONFIG("SCHEDULED ALERT")=""
+8 QUIT
SENDRPT(ORNAME) ;Return true if the current report should be sent
+1 IF ORNAME="ORRPW PHARMACY"
QUIT 1
+2 IF ORNAME="ORRPW POTENTIALLY UNSAFE MEDS"
QUIT 1
+3 IF ORNAME="ORCV WOMEN'S HEALTH"
QUIT 1
+4 IF ORNAME="ORCV WOMEN'S HEALTH DETAILS"
QUIT 1
+5 IF ORNAME="ORCV ALLERGIES"
QUIT 1
+6 IF ORNAME="ORRP AP ALL"
QUIT 1
+7 IF ORNAME="ORRPW LAB CY"
QUIT 1
+8 IF ORNAME="ORRPW LAB EM"
QUIT 1
+9 IF ORNAME="ORRPW LAB SP"
QUIT 1
+10 IF ORNAME="ORL ANATOMIC PATHOLOGY"
QUIT 1
+11 IF ORNAME="ORRPL LAB CY"
QUIT 1
+12 IF ORNAME="ORRPL LAB EM"
QUIT 1
+13 IF ORNAME="ORRPL LAB SP"
QUIT 1
+14 QUIT 0