ORY350 ;ISP/RFR - PRE- AND POST-INSTALL FOR PATCH OR*3.0*350 ;08/31/15 09:58
;;3.0;ORDER ENTRY/RESULTS REPORTING;**350**;Dec 17, 1997;Build 77
Q
PRE ;PRE-INSTALL SECTION
;DELETE EXISTING NOTIFICATION(S)
D PRE^ORY350B
N ORMSG,ORFDA,ORERROR,IDX
I $D(^ORD(100.9,78,0)) D
.S ORMSG(1)="WARNING:",ORMSG(2)="A notification already exists in entry number 78 and will be overwritten."
.D BMES^XPDUTL(.ORMSG)
.S ORFDA(100.9,"78,",.01)="@"
I $D(^ORD(100.9,73)) S ORFDA(100.9,"73,",.01)="@"
I $D(ORFDA) D
.D FILE^DIE(,"ORFDA","ORERROR")
.I $D(ORERROR) D Q
..K ORMSG
..S ORMSG(1)="ERROR: Unable to delete the existing notification."
..S ORMSG(2)="VA FileMan Error #"_ORERROR("DIERR",1)_":"
..F IDX=1:1:+$O(ORERROR("DIERR",1,"TEXT","A"),-1) D
...S ORMSG(IDX+2)=ORERROR("DIERR",1,"TEXT",IDX)
..D BMES^XPDUTL(.ORMSG)
..S XPDABORT=1
D BMES^XPDUTL(" Deleting data dictionaries:")
D MES^XPDUTL(" PROCESSING FLAGS FIELD (#2) IN OE/RR NOTIFICATIONS FILE")
N DIU
S DIU="100.92",DIU(0)="ST"
D EN^DIU2
D MES^XPDUTL(" Finished deleting data dictionaries")
Q
POST ;POST-INSTALL SECTION
N XPDIDTOT,ORSTNUM,ORPOST
S XPDIDTOT=8,ORSTNUM=0,ORPOST=1
D UPDATE^XPDID(1)
D UPDATE^XPDID(ORSTNUM)
D DLGBULL
D BMES^XPDUTL("Updating parameter values...")
D MOBVERS
D POST^ORY350B
D BMES^XPDUTL("DONE")
D UPDATE^XPDID(2)
S ORSTNUM=3
D BMES^XPDUTL("Correcting supply orderable items...")
D SUPPLY^ORY350A
D BMES^XPDUTL("DONE")
D UPDATE^XPDID(ORSTNUM)
S ORSTNUM=ORSTNUM+1
D BMES^XPDUTL("Correcting supply quick orders...")
I $$SQOCONV^ORY350A D BMES^XPDUTL("DONE")
D UPDATE^XPDID(ORSTNUM)
S ORSTNUM=ORSTNUM+1
D QUEUE("order cleanup/conversion","ORDCONV^ORY350(""?"")","OE/RR ORDER CLEANUP AND CONVERSION",.ORSTNUM)
D QUEUE("quick order dialog report","QODLGCON^ORY350","OE/RR QUICK ORDER DIALOG REPORT",.ORSTNUM)
D BMES^XPDUTL("Correcting existing order dialogs...")
N ARRAY,DLG,ITM
;
S ARRAY($$PTR^ORCD("PSO OERR"))=1 ;Outpatient Meds
S ARRAY($$PTR^ORCD("PSJ OR PAT OE"))=1 ;Unit Dose Meds
S ARRAY($$PTR^ORCD("PSH OERR"))=1 ;Non-VA Meds
S ARRAY($$PTR^ORCD("PSO SUPPLY"))=1 ;Supplies/Devices
;
S DLG="" F S DLG=$O(ARRAY(DLG)) Q:DLG="" D ;
. ; Find the index for the OR GTX SCHEDULE field
. S ITM=$O(^ORD(101.41,DLG,10,"D",$$PTR^ORCD("OR GTX SCHEDULE"),""))
. ; Does the field have the previous standard text?
. I $G(^ORD(101.41,DLG,10,ITM,9))="S:ORCAT=""I"" REQD=$$SCHREQ^PSJORPOE(OROUTE,OROI,$G(ORDRUG))" D ;
. . ; Add check for quick orders
. . S ^ORD(101.41,DLG,10,ITM,9)="I $G(ORTYPE)'=""Z"" S:ORCAT=""I"" REQD=$$SCHREQ^PSJORPOE(OROUTE,OROI,$G(ORDRUG))"
D BMES^XPDUTL("DONE")
D UPDATE^XPDID(ORSTNUM)
S ORSTNUM=ORSTNUM+1
D BMES^XPDUTL("Loading new notifications...")
I $$NOTIFI^ORY350A D BMES^XPDUTL("DONE")
D UPDATE^XPDID(ORSTNUM)
S ORSTNUM=ORSTNUM+1
Q
ORDCONV(ORIEN) ;LOOP THROUGH ALL ORDERS AND PERFORM THE NECESSARY ACTIONS (TASKED)
;PARAMETERS: ORIEN => STARTING ORDER NUMBER (REQUIRED)
N ORREP,ORRECP,ORSTAT
F S ORIEN=$O(^OR(100,ORIEN),-1) Q:+ORIEN=0!($G(ZTSTOP)=1) D
.;FOR HELD MEDICATION ORDERS, CHECK PHARMACY'S ORDER STATUS
.I $P($G(^OR(100,ORIEN,3)),U,3)=3,("^2^3^4^23^"[(U_$P($G(^OR(100,ORIEN,0)),U,11)_U)) D
..D MSG^ORMBLD(ORIEN,"SS")
.;STOP IF ASKED TO
.I ORIEN#1000=0,($$S^%ZTLOAD) N X S ZTSTOP=1,X=$$S^%ZTLOAD("Received shutdown request")
;SEND STATUS EMAIL
I +$G(ZTSTOP)=0 D
.S ORREP(1)="The order cleanup/conversion process was successfully completed."
E D
.K ORREP
.S ORREP(1)="The order cleanup/conversion process has unexpectedly stopped."
.S ORREP(2)="If you or the system manager did not stop the process, please check the"
.S ORREP(3)="error log and file a Remedy ticket for assistance."
.S ORREP(4)=""
.S ORREP(5)="To requeue the cleanup/conversion process, run ORDREST^ORY350 from the"
.S ORREP(6)="programmer prompt and when asked for the starting order number, enter"
.S ORREP(7)=ORIEN+1
S ORRECP(DUZ)=""
S ORSTAT=$$MAIL^ORUTL("ORREP(","PATCH OR*3.0*350 ORDER CLEANUP/CONVERSION STATUS",.ORRECP)
I +ORSTAT,($G(ZTSTOP)=1) D
.S ^XTMP("ORY350",0)=$$FMADD^XLFDT($$NOW^XLFDT,7,0,0,0)_U_$$NOW^XLFDT_U_"OR*3*350 POST-INSTALL DATA"
.S ^XTMP("ORY350","ORDER")=(ORIEN+1)
S ZTREQ="@"
Q
ORDREST ;ALLOW USER TO RESTART THE ORDER CLEANUP/CONVERSION PROCESS
N DIC,Y,X,DTOUT,DUOUT
S DIC="^OR(100,",DIC(0)="AEQX",DIC("A")="ENTER THE STARTING ORDER NUMBER FROM THE STATUS EMAIL: "
D ^DIC
Q:+Y<1
W !,"Queueing order cleanup/conversion..."
D QUEUE("order cleanup/conversion","ORDCONV^ORY350("_+Y_")","OE/RR ORDER CLEANUP AND CONVERSION")
Q
QODLGCON ;LOOP THROUGH ALL ORDER DIALOGS AND REPORT ON COMPLEX DIALOGS WITH TYPE NON-VA MEDICATIONS (TASKED)
N ORREP,ORNONDG,ORINSIEN,ORCOUNT,ORINIEN,ORIEN,ORSTAT,ORLINE
I '$D(ZTQUEUED) W "Assembling the non-VA medication quick order dialog report...",!
S ORLINE=1,ORREP=$NA(^TMP($J,"ORQODLGCON")) K @ORREP
S @ORREP@(ORLINE)="The following non-VA medication quick order dialogs contain a complex dose.",ORLINE=ORLINE+1
S @ORREP@(ORLINE)="",ORLINE=ORLINE+1
S @ORREP@(ORLINE)="QUICK ORDER DIALOG",ORLINE=ORLINE+1
S @ORREP@(ORLINE)=$$REPEAT^XLFSTR("-",72),ORLINE=ORLINE+1
S ORNONDG=+$O(^ORD(100.98,"B","NON-VA MEDICATIONS",0))
I ORNONDG=0 D
.K @ORREP
.S @ORREP@(ORLINE)="Unable to find the NON-VA MEDICATIONS display group in the DISPLAY",ORLINE=ORLINE+1
.S @ORREP@(ORLINE)="GROUP file (#100.98).",ORLINE=ORLINE+1
.S @ORREP@(ORLINE)="Please log a Remedy ticket for assistance.",ORLINE=ORLINE+1
.S @ORREP@(ORLINE)="",ORLINE=ORLINE+1
S ORINSIEN=+$O(^ORD(101.41,"B","OR GTX INSTRUCTIONS",0))
I ORINSIEN=0 D
.K @ORREP
.S @ORREP@(ORLINE)="Unable to find the OR GTX INSTRUCTIONS dialog in the ORDER DIALOG file",ORLINE=ORLINE+1
.S @ORREP@(ORLINE)="(#100.41).",ORLINE=ORLINE+1
.S @ORREP@(ORLINE)="Please log a Remedy ticket for assistance.",ORLINE=ORLINE+1
I ORNONDG&(ORINSIEN) D
.S ORIEN=0 F S ORIEN=$O(^ORD(101.41,ORIEN)) Q:+ORIEN=0!($G(ZTSTOP)=1) D
..Q:$P(^ORD(101.41,ORIEN,0),U,5)'=ORNONDG!($P(^ORD(101.41,ORIEN,0),U,1)="PSH OERR")!($P(^ORD(101.41,ORIEN,0),U,4)'="Q")
..;COUNT THE NUMBER OF OR GTX INSTRUCTIONS DIALOG INSTANCES
..S ORCOUNT=0,ORINIEN=""
..F S ORINIEN=$O(^ORD(101.41,ORIEN,6,"D",ORINSIEN,ORINIEN)) Q:+ORINIEN=0 S ORCOUNT=ORCOUNT+1
..;COMPLEX ORDERS HAVE MORE THAN ONE INSTANCE
..S:ORCOUNT>1 @ORREP@(ORLINE)=$P(^ORD(101.41,ORIEN,0),U,1),ORLINE=ORLINE+1
..;STOP IF ASKED TO
..I ORIEN#100=0,($$S^%ZTLOAD) N X S ZTSTOP=1,X=$$S^%ZTLOAD("Received shutdown request")
.I +$G(ZTSTOP)=0 D
..S @ORREP@(ORLINE)="",ORLINE=ORLINE+1
..S @ORREP@(ORLINE)="[END OF REPORT]",ORLINE=ORLINE+1
.E D
..S @ORREP@(ORLINE)="",ORLINE=ORLINE+1
..S @ORREP@(ORLINE)="The quick order dialog report process has unexpectedly stopped.",ORLINE=ORLINE+1
..S @ORREP@(ORLINE)="If you or the system manager did not stop the process, please check the",ORLINE=ORLINE+1
..S @ORREP@(ORLINE)="error log and file a Remedy ticket for assistance.",ORLINE=ORLINE+1
..S @ORREP@(ORLINE)="",ORLINE=ORLINE+1
I 'ORNONDG!('ORINSIEN)!($G(ZTSTOP)) D
.S @ORREP@(ORLINE)="To rerun the report, execute QODLGCON^ORY350 from the programmer prompt.",ORLINE=ORLINE+1
S ORSTAT=$$MAIL^ORUTL($P(ORREP,")",1)_",","NON-VA MEDICATION COMPLEX QUICK ORDER DIALOG REPORT",,"ORY350QORECIPS")
K @ORREP
I $D(ZTQUEUED)>0 S ZTREQ="@"
E W !,"Report successfully generated.",!
Q
QUEUE(ORMSG,ZTRTN,ZTDESC,ORCURITM) ;CREATE A SPECIFIED TASK
;PARAMETERS: ORMSG => STRING CONTAINING THE TEXT TO OUTPUT TO THE SCREEN
; ZTRTN => STRING CONTAINING THE ROUTINE TASKMAN SHOULD EXECUTE
; ZTDESC => STRING CONTAINING THE TASK'S DESCRIPTION
; ORCURITM => REFERENCE TO THE VARIABLE STORING THE NUMBER OF THE CURRENT ITEM
N ZTDTH,ZTIO,ZTSK
D BMES^XPDUTL("Queueing "_ORMSG_"...")
S ZTDTH=$$FMADD^XLFDT($$NOW^XLFDT,0,0,0,10)
S ZTIO=""
D ^%ZTLOAD
I +$G(ZTSK)=0 D
.I $G(ORPOST) D BMES^XPDUTL("Unable to queue the "_ORMSG_"; file a Remedy ticket for assistance.")
.E W "ERROR",!,"Unable to queue the "_ORMSG_"; file a Remedy ticket for assistance.",!
E D
.I $G(ORPOST) D
..D BMES^XPDUTL("DONE - Task #"_ZTSK)
..D UPDATE^XPDID(ORCURITM)
..S ORCURITM=ORCURITM+1
.E W "DONE",!,"Task #"_ZTSK,!
Q
;
MOBVERS ;set the package level MOB DLL version
D PUT^XPAR("PKG","OR MOB DLL VERSION",1,"2.0.16.0")
Q
;
SENDDLG(ANAME) ; Return true if the current order dialog should be sent
I ANAME="PSO OERR" Q 1
I ANAME="GMRCOR CONSULT" Q 1
I ANAME="GMRCOR REQUEST" Q 1
Q 0
;
DLGBULL ; send bulletin about modified dialogs <on first install>
N I,ORD
F I="PSO OERR","GMRCOR CONSULT","GMRCOR REQUEST" S ORD(I)=""
D EN^ORYDLG(350,.ORD)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORY350 8789 printed Nov 22, 2024@17:51:22 Page 2
ORY350 ;ISP/RFR - PRE- AND POST-INSTALL FOR PATCH OR*3.0*350 ;08/31/15 09:58
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**350**;Dec 17, 1997;Build 77
+2 QUIT
PRE ;PRE-INSTALL SECTION
+1 ;DELETE EXISTING NOTIFICATION(S)
+2 DO PRE^ORY350B
+3 NEW ORMSG,ORFDA,ORERROR,IDX
+4 IF $DATA(^ORD(100.9,78,0))
Begin DoDot:1
+5 SET ORMSG(1)="WARNING:"
SET ORMSG(2)="A notification already exists in entry number 78 and will be overwritten."
+6 DO BMES^XPDUTL(.ORMSG)
+7 SET ORFDA(100.9,"78,",.01)="@"
End DoDot:1
+8 IF $DATA(^ORD(100.9,73))
SET ORFDA(100.9,"73,",.01)="@"
+9 IF $DATA(ORFDA)
Begin DoDot:1
+10 DO FILE^DIE(,"ORFDA","ORERROR")
+11 IF $DATA(ORERROR)
Begin DoDot:2
+12 KILL ORMSG
+13 SET ORMSG(1)="ERROR: Unable to delete the existing notification."
+14 SET ORMSG(2)="VA FileMan Error #"_ORERROR("DIERR",1)_":"
+15 FOR IDX=1:1:+$ORDER(ORERROR("DIERR",1,"TEXT","A"),-1)
Begin DoDot:3
+16 SET ORMSG(IDX+2)=ORERROR("DIERR",1,"TEXT",IDX)
End DoDot:3
+17 DO BMES^XPDUTL(.ORMSG)
+18 SET XPDABORT=1
End DoDot:2
QUIT
End DoDot:1
+19 DO BMES^XPDUTL(" Deleting data dictionaries:")
+20 DO MES^XPDUTL(" PROCESSING FLAGS FIELD (#2) IN OE/RR NOTIFICATIONS FILE")
+21 NEW DIU
+22 SET DIU="100.92"
SET DIU(0)="ST"
+23 DO EN^DIU2
+24 DO MES^XPDUTL(" Finished deleting data dictionaries")
+25 QUIT
POST ;POST-INSTALL SECTION
+1 NEW XPDIDTOT,ORSTNUM,ORPOST
+2 SET XPDIDTOT=8
SET ORSTNUM=0
SET ORPOST=1
+3 DO UPDATE^XPDID(1)
+4 DO UPDATE^XPDID(ORSTNUM)
+5 DO DLGBULL
+6 DO BMES^XPDUTL("Updating parameter values...")
+7 DO MOBVERS
+8 DO POST^ORY350B
+9 DO BMES^XPDUTL("DONE")
+10 DO UPDATE^XPDID(2)
+11 SET ORSTNUM=3
+12 DO BMES^XPDUTL("Correcting supply orderable items...")
+13 DO SUPPLY^ORY350A
+14 DO BMES^XPDUTL("DONE")
+15 DO UPDATE^XPDID(ORSTNUM)
+16 SET ORSTNUM=ORSTNUM+1
+17 DO BMES^XPDUTL("Correcting supply quick orders...")
+18 IF $$SQOCONV^ORY350A
DO BMES^XPDUTL("DONE")
+19 DO UPDATE^XPDID(ORSTNUM)
+20 SET ORSTNUM=ORSTNUM+1
+21 DO QUEUE("order cleanup/conversion","ORDCONV^ORY350(""?"")","OE/RR ORDER CLEANUP AND CONVERSION",.ORSTNUM)
+22 DO QUEUE("quick order dialog report","QODLGCON^ORY350","OE/RR QUICK ORDER DIALOG REPORT",.ORSTNUM)
+23 DO BMES^XPDUTL("Correcting existing order dialogs...")
+24 NEW ARRAY,DLG,ITM
+25 ;
+26 ;Outpatient Meds
SET ARRAY($$PTR^ORCD("PSO OERR"))=1
+27 ;Unit Dose Meds
SET ARRAY($$PTR^ORCD("PSJ OR PAT OE"))=1
+28 ;Non-VA Meds
SET ARRAY($$PTR^ORCD("PSH OERR"))=1
+29 ;Supplies/Devices
SET ARRAY($$PTR^ORCD("PSO SUPPLY"))=1
+30 ;
+31 ;
SET DLG=""
FOR
SET DLG=$ORDER(ARRAY(DLG))
if DLG=""
QUIT
Begin DoDot:1
+32 ; Find the index for the OR GTX SCHEDULE field
+33 SET ITM=$ORDER(^ORD(101.41,DLG,10,"D",$$PTR^ORCD("OR GTX SCHEDULE"),""))
+34 ; Does the field have the previous standard text?
+35 ;
IF $GET(^ORD(101.41,DLG,10,ITM,9))="S:ORCAT=""I"" REQD=$$SCHREQ^PSJORPOE(OROUTE,OROI,$G(ORDRUG))"
Begin DoDot:2
+36 ; Add check for quick orders
+37 SET ^ORD(101.41,DLG,10,ITM,9)="I $G(ORTYPE)'=""Z"" S:ORCAT=""I"" REQD=$$SCHREQ^PSJORPOE(OROUTE,OROI,$G(ORDRUG))"
End DoDot:2
End DoDot:1
+38 DO BMES^XPDUTL("DONE")
+39 DO UPDATE^XPDID(ORSTNUM)
+40 SET ORSTNUM=ORSTNUM+1
+41 DO BMES^XPDUTL("Loading new notifications...")
+42 IF $$NOTIFI^ORY350A
DO BMES^XPDUTL("DONE")
+43 DO UPDATE^XPDID(ORSTNUM)
+44 SET ORSTNUM=ORSTNUM+1
+45 QUIT
ORDCONV(ORIEN) ;LOOP THROUGH ALL ORDERS AND PERFORM THE NECESSARY ACTIONS (TASKED)
+1 ;PARAMETERS: ORIEN => STARTING ORDER NUMBER (REQUIRED)
+2 NEW ORREP,ORRECP,ORSTAT
+3 FOR
SET ORIEN=$ORDER(^OR(100,ORIEN),-1)
if +ORIEN=0!($GET(ZTSTOP)=1)
QUIT
Begin DoDot:1
+4 ;FOR HELD MEDICATION ORDERS, CHECK PHARMACY'S ORDER STATUS
+5 IF $PIECE($GET(^OR(100,ORIEN,3)),U,3)=3
IF ("^2^3^4^23^"[(U_$PIECE($GET(^OR(100,ORIEN,0)),U,11)_U))
Begin DoDot:2
+6 DO MSG^ORMBLD(ORIEN,"SS")
End DoDot:2
+7 ;STOP IF ASKED TO
+8 IF ORIEN#1000=0
IF ($$S^%ZTLOAD)
NEW X
SET ZTSTOP=1
SET X=$$S^%ZTLOAD("Received shutdown request")
End DoDot:1
+9 ;SEND STATUS EMAIL
+10 IF +$GET(ZTSTOP)=0
Begin DoDot:1
+11 SET ORREP(1)="The order cleanup/conversion process was successfully completed."
End DoDot:1
+12 IF '$TEST
Begin DoDot:1
+13 KILL ORREP
+14 SET ORREP(1)="The order cleanup/conversion process has unexpectedly stopped."
+15 SET ORREP(2)="If you or the system manager did not stop the process, please check the"
+16 SET ORREP(3)="error log and file a Remedy ticket for assistance."
+17 SET ORREP(4)=""
+18 SET ORREP(5)="To requeue the cleanup/conversion process, run ORDREST^ORY350 from the"
+19 SET ORREP(6)="programmer prompt and when asked for the starting order number, enter"
+20 SET ORREP(7)=ORIEN+1
End DoDot:1
+21 SET ORRECP(DUZ)=""
+22 SET ORSTAT=$$MAIL^ORUTL("ORREP(","PATCH OR*3.0*350 ORDER CLEANUP/CONVERSION STATUS",.ORRECP)
+23 IF +ORSTAT
IF ($GET(ZTSTOP)=1)
Begin DoDot:1
+24 SET ^XTMP("ORY350",0)=$$FMADD^XLFDT($$NOW^XLFDT,7,0,0,0)_U_$$NOW^XLFDT_U_"OR*3*350 POST-INSTALL DATA"
+25 SET ^XTMP("ORY350","ORDER")=(ORIEN+1)
End DoDot:1
+26 SET ZTREQ="@"
+27 QUIT
ORDREST ;ALLOW USER TO RESTART THE ORDER CLEANUP/CONVERSION PROCESS
+1 NEW DIC,Y,X,DTOUT,DUOUT
+2 SET DIC="^OR(100,"
SET DIC(0)="AEQX"
SET DIC("A")="ENTER THE STARTING ORDER NUMBER FROM THE STATUS EMAIL: "
+3 DO ^DIC
+4 if +Y<1
QUIT
+5 WRITE !,"Queueing order cleanup/conversion..."
+6 DO QUEUE("order cleanup/conversion","ORDCONV^ORY350("_+Y_")","OE/RR ORDER CLEANUP AND CONVERSION")
+7 QUIT
QODLGCON ;LOOP THROUGH ALL ORDER DIALOGS AND REPORT ON COMPLEX DIALOGS WITH TYPE NON-VA MEDICATIONS (TASKED)
+1 NEW ORREP,ORNONDG,ORINSIEN,ORCOUNT,ORINIEN,ORIEN,ORSTAT,ORLINE
+2 IF '$DATA(ZTQUEUED)
WRITE "Assembling the non-VA medication quick order dialog report...",!
+3 SET ORLINE=1
SET ORREP=$NAME(^TMP($JOB,"ORQODLGCON"))
KILL @ORREP
+4 SET @ORREP@(ORLINE)="The following non-VA medication quick order dialogs contain a complex dose."
SET ORLINE=ORLINE+1
+5 SET @ORREP@(ORLINE)=""
SET ORLINE=ORLINE+1
+6 SET @ORREP@(ORLINE)="QUICK ORDER DIALOG"
SET ORLINE=ORLINE+1
+7 SET @ORREP@(ORLINE)=$$REPEAT^XLFSTR("-",72)
SET ORLINE=ORLINE+1
+8 SET ORNONDG=+$ORDER(^ORD(100.98,"B","NON-VA MEDICATIONS",0))
+9 IF ORNONDG=0
Begin DoDot:1
+10 KILL @ORREP
+11 SET @ORREP@(ORLINE)="Unable to find the NON-VA MEDICATIONS display group in the DISPLAY"
SET ORLINE=ORLINE+1
+12 SET @ORREP@(ORLINE)="GROUP file (#100.98)."
SET ORLINE=ORLINE+1
+13 SET @ORREP@(ORLINE)="Please log a Remedy ticket for assistance."
SET ORLINE=ORLINE+1
+14 SET @ORREP@(ORLINE)=""
SET ORLINE=ORLINE+1
End DoDot:1
+15 SET ORINSIEN=+$ORDER(^ORD(101.41,"B","OR GTX INSTRUCTIONS",0))
+16 IF ORINSIEN=0
Begin DoDot:1
+17 KILL @ORREP
+18 SET @ORREP@(ORLINE)="Unable to find the OR GTX INSTRUCTIONS dialog in the ORDER DIALOG file"
SET ORLINE=ORLINE+1
+19 SET @ORREP@(ORLINE)="(#100.41)."
SET ORLINE=ORLINE+1
+20 SET @ORREP@(ORLINE)="Please log a Remedy ticket for assistance."
SET ORLINE=ORLINE+1
End DoDot:1
+21 IF ORNONDG&(ORINSIEN)
Begin DoDot:1
+22 SET ORIEN=0
FOR
SET ORIEN=$ORDER(^ORD(101.41,ORIEN))
if +ORIEN=0!($GET(ZTSTOP)=1)
QUIT
Begin DoDot:2
+23 if $PIECE(^ORD(101.41,ORIEN,0),U,5)'=ORNONDG!($PIECE(^ORD(101.41,ORIEN,0),U,1)="PSH OERR")!($PIECE(^ORD(101.41,ORIEN,0),U,4)'="Q")
QUIT
+24 ;COUNT THE NUMBER OF OR GTX INSTRUCTIONS DIALOG INSTANCES
+25 SET ORCOUNT=0
SET ORINIEN=""
+26 FOR
SET ORINIEN=$ORDER(^ORD(101.41,ORIEN,6,"D",ORINSIEN,ORINIEN))
if +ORINIEN=0
QUIT
SET ORCOUNT=ORCOUNT+1
+27 ;COMPLEX ORDERS HAVE MORE THAN ONE INSTANCE
+28 if ORCOUNT>1
SET @ORREP@(ORLINE)=$PIECE(^ORD(101.41,ORIEN,0),U,1)
SET ORLINE=ORLINE+1
+29 ;STOP IF ASKED TO
+30 IF ORIEN#100=0
IF ($$S^%ZTLOAD)
NEW X
SET ZTSTOP=1
SET X=$$S^%ZTLOAD("Received shutdown request")
End DoDot:2
+31 IF +$GET(ZTSTOP)=0
Begin DoDot:2
+32 SET @ORREP@(ORLINE)=""
SET ORLINE=ORLINE+1
+33 SET @ORREP@(ORLINE)="[END OF REPORT]"
SET ORLINE=ORLINE+1
End DoDot:2
+34 IF '$TEST
Begin DoDot:2
+35 SET @ORREP@(ORLINE)=""
SET ORLINE=ORLINE+1
+36 SET @ORREP@(ORLINE)="The quick order dialog report process has unexpectedly stopped."
SET ORLINE=ORLINE+1
+37 SET @ORREP@(ORLINE)="If you or the system manager did not stop the process, please check the"
SET ORLINE=ORLINE+1
+38 SET @ORREP@(ORLINE)="error log and file a Remedy ticket for assistance."
SET ORLINE=ORLINE+1
+39 SET @ORREP@(ORLINE)=""
SET ORLINE=ORLINE+1
End DoDot:2
End DoDot:1
+40 IF 'ORNONDG!('ORINSIEN)!($GET(ZTSTOP))
Begin DoDot:1
+41 SET @ORREP@(ORLINE)="To rerun the report, execute QODLGCON^ORY350 from the programmer prompt."
SET ORLINE=ORLINE+1
End DoDot:1
+42 SET ORSTAT=$$MAIL^ORUTL($PIECE(ORREP,")",1)_",","NON-VA MEDICATION COMPLEX QUICK ORDER DIALOG REPORT",,"ORY350QORECIPS")
+43 KILL @ORREP
+44 IF $DATA(ZTQUEUED)>0
SET ZTREQ="@"
+45 IF '$TEST
WRITE !,"Report successfully generated.",!
+46 QUIT
QUEUE(ORMSG,ZTRTN,ZTDESC,ORCURITM) ;CREATE A SPECIFIED TASK
+1 ;PARAMETERS: ORMSG => STRING CONTAINING THE TEXT TO OUTPUT TO THE SCREEN
+2 ; ZTRTN => STRING CONTAINING THE ROUTINE TASKMAN SHOULD EXECUTE
+3 ; ZTDESC => STRING CONTAINING THE TASK'S DESCRIPTION
+4 ; ORCURITM => REFERENCE TO THE VARIABLE STORING THE NUMBER OF THE CURRENT ITEM
+5 NEW ZTDTH,ZTIO,ZTSK
+6 DO BMES^XPDUTL("Queueing "_ORMSG_"...")
+7 SET ZTDTH=$$FMADD^XLFDT($$NOW^XLFDT,0,0,0,10)
+8 SET ZTIO=""
+9 DO ^%ZTLOAD
+10 IF +$GET(ZTSK)=0
Begin DoDot:1
+11 IF $GET(ORPOST)
DO BMES^XPDUTL("Unable to queue the "_ORMSG_"; file a Remedy ticket for assistance.")
+12 IF '$TEST
WRITE "ERROR",!,"Unable to queue the "_ORMSG_"; file a Remedy ticket for assistance.",!
End DoDot:1
+13 IF '$TEST
Begin DoDot:1
+14 IF $GET(ORPOST)
Begin DoDot:2
+15 DO BMES^XPDUTL("DONE - Task #"_ZTSK)
+16 DO UPDATE^XPDID(ORCURITM)
+17 SET ORCURITM=ORCURITM+1
End DoDot:2
+18 IF '$TEST
WRITE "DONE",!,"Task #"_ZTSK,!
End DoDot:1
+19 QUIT
+20 ;
MOBVERS ;set the package level MOB DLL version
+1 DO PUT^XPAR("PKG","OR MOB DLL VERSION",1,"2.0.16.0")
+2 QUIT
+3 ;
SENDDLG(ANAME) ; Return true if the current order dialog should be sent
+1 IF ANAME="PSO OERR"
QUIT 1
+2 IF ANAME="GMRCOR CONSULT"
QUIT 1
+3 IF ANAME="GMRCOR REQUEST"
QUIT 1
+4 QUIT 0
+5 ;
DLGBULL ; send bulletin about modified dialogs <on first install>
+1 NEW I,ORD
+2 FOR I="PSO OERR","GMRCOR CONSULT","GMRCOR REQUEST"
SET ORD(I)=""
+3 DO EN^ORYDLG(350,.ORD)
+4 QUIT