ORY397A ;ISP/JLC - POST FOR PATCH OR*3.0*397 ;Aug 01, 2019@15:46
;;3.0;ORDER ENTRY/RESULTS REPORTING;**397**;Dec 17, 1997;Build 22
;
Q
EN ; Task off the rebuild of the 'D' cross-reference for file #100
N ZTDTH,ZTIO,ZTSK,ZTRTN,ZTDESC
D BMES^XPDUTL("Queueing Rebuild of the 'D' cross-reference for ORDERS file (#100)")
S ZTDTH=$$FMADD^XLFDT($$NOW^XLFDT,0,0,0,10)
S ZTRTN="TASK^ORY397A",ZTDESC="Rebuild of the 'D' xref for file #100"
S ZTIO=""
D ^%ZTLOAD
I +$G(ZTSK)=0 D
. D BMES^XPDUTL("Unable to queue the file #100 xref Rebuild, file a help desk ticket for assistance.")
E D
. D BMES^XPDUTL("DONE - Task #"_ZTSK)
Q
TASK ;
N ORIFN,I,J,STOP,A,OR0,OR3,ORDIALOG,ORIT,STOP,ZTSTOP
D MSG1("S")
S STOP=0
S ORIFN=$G(^OR(100,"D",0)) I ORIFN="" S ORIFN=" "
F I=1:1 D Q:'ORIFN I STOP Q
. S ORIFN=$O(^OR(100,ORIFN),-1) Q:'ORIFN
. S OR0=$G(^OR(100,ORIFN,0)) Q:'OR0
. S ORDIALOG=+$P(OR0,"^",5),A=ORDIALOG_";ORD(101.41," K ^OR(100,"D",A,ORIFN)
. S OR3=$G(^OR(100,ORIFN,3)) Q:'OR3
. S ORIT=$P(OR3,"^",4)
. I $G(ORIT),ORIT?.E1";ORD(101.41," S ^OR(100,"D",ORIT,ORIFN)=""
. S ^OR(100,"D",0)=ORIFN
. I '(I#100000) D I STOP Q
.. F J=1:1:510 H 1 I '(J#120) S STOP=$$REQ2STOP() I STOP Q
I 'STOP K ^OR(100,"D",0) D MSG
I STOP D MSG1("RS")
Q
MSG ;
N XMSUB,XMY,XMTEXT,XMDUZ,ORTEXT,SITE,I,A
S ORTEXT(1)="Rebuild of 'D' cross-reference completed for "_$$SITE^VASITE()
S ORTEXT(2)=" "
S XMDUZ=DUZ
S XMSUB="Rebuild of 'D' cross-reference completed"
S XMY("CRUMLEY.JAMIE@DOMAIN.EXT")="",XMY("THOMPSON.WILLIAM_ANTHONY@DOMAIN.EXT")=""
S XMTEXT="ORTEXT("
D ^XMD
Q
MSG1(ORTYP) ;
N XMSUB,XMY,XMTEXT,XMDUZ,ORTEXT,SITE,I,A,ORTXT,ORSUB
I ORTYP="S" S ORTXT="Rebuild of 'D' cross-reference STARTED for "_$$SITE^VASITE(),ORSUB="Rebuild of 'D' cross-reference started"
I ORTYP="RS" S ORTXT="Rebuild of 'D' cross-reference STOP REQUESTED for "_$$SITE^VASITE(),ORSUB="Rebuild of D' cross-reference stop requested"
S ORTEXT(1)=ORTXT
S ORTEXT(2)=" "
S XMDUZ=DUZ
S XMSUB=ORSUB
S XMY("CRUMLEY.JAMIE@DOMAIN.EXT")="",XMY("THOMPSON.WILLIAM_ANTHONY@DOMAIN.EXT")=""
S XMTEXT="ORTEXT("
D ^XMD
Q
REQ2STOP() ;
; Check for task stop request
; Returns 1 if stop request made.
N STATUS,X
S STATUS=0
I '$D(ZTQUEUED) Q 0
S X=$$S^%ZTLOAD()
I X D ;
. S STATUS=1
. S X=$$S^%ZTLOAD("Received shutdown request")
. S ZTSTOP=1
;
Q STATUS
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORY397A 2405 printed Dec 13, 2024@02:41:45 Page 2
ORY397A ;ISP/JLC - POST FOR PATCH OR*3.0*397 ;Aug 01, 2019@15:46
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**397**;Dec 17, 1997;Build 22
+2 ;
+3 QUIT
EN ; Task off the rebuild of the 'D' cross-reference for file #100
+1 NEW ZTDTH,ZTIO,ZTSK,ZTRTN,ZTDESC
+2 DO BMES^XPDUTL("Queueing Rebuild of the 'D' cross-reference for ORDERS file (#100)")
+3 SET ZTDTH=$$FMADD^XLFDT($$NOW^XLFDT,0,0,0,10)
+4 SET ZTRTN="TASK^ORY397A"
SET ZTDESC="Rebuild of the 'D' xref for file #100"
+5 SET ZTIO=""
+6 DO ^%ZTLOAD
+7 IF +$GET(ZTSK)=0
Begin DoDot:1
+8 DO BMES^XPDUTL("Unable to queue the file #100 xref Rebuild, file a help desk ticket for assistance.")
End DoDot:1
+9 IF '$TEST
Begin DoDot:1
+10 DO BMES^XPDUTL("DONE - Task #"_ZTSK)
End DoDot:1
+11 QUIT
TASK ;
+1 NEW ORIFN,I,J,STOP,A,OR0,OR3,ORDIALOG,ORIT,STOP,ZTSTOP
+2 DO MSG1("S")
+3 SET STOP=0
+4 SET ORIFN=$GET(^OR(100,"D",0))
IF ORIFN=""
SET ORIFN=" "
+5 FOR I=1:1
Begin DoDot:1
+6 SET ORIFN=$ORDER(^OR(100,ORIFN),-1)
if 'ORIFN
QUIT
+7 SET OR0=$GET(^OR(100,ORIFN,0))
if 'OR0
QUIT
+8 SET ORDIALOG=+$PIECE(OR0,"^",5)
SET A=ORDIALOG_";ORD(101.41,"
KILL ^OR(100,"D",A,ORIFN)
+9 SET OR3=$GET(^OR(100,ORIFN,3))
if 'OR3
QUIT
+10 SET ORIT=$PIECE(OR3,"^",4)
+11 IF $GET(ORIT)
IF ORIT?.E1";ORD(101.41,"
SET ^OR(100,"D",ORIT,ORIFN)=""
+12 SET ^OR(100,"D",0)=ORIFN
+13 IF '(I#100000)
Begin DoDot:2
+14 FOR J=1:1:510
HANG 1
IF '(J#120)
SET STOP=$$REQ2STOP()
IF STOP
QUIT
End DoDot:2
IF STOP
QUIT
End DoDot:1
if 'ORIFN
QUIT
IF STOP
QUIT
+15 IF 'STOP
KILL ^OR(100,"D",0)
DO MSG
+16 IF STOP
DO MSG1("RS")
+17 QUIT
MSG ;
+1 NEW XMSUB,XMY,XMTEXT,XMDUZ,ORTEXT,SITE,I,A
+2 SET ORTEXT(1)="Rebuild of 'D' cross-reference completed for "_$$SITE^VASITE()
+3 SET ORTEXT(2)=" "
+4 SET XMDUZ=DUZ
+5 SET XMSUB="Rebuild of 'D' cross-reference completed"
+6 SET XMY("CRUMLEY.JAMIE@DOMAIN.EXT")=""
SET XMY("THOMPSON.WILLIAM_ANTHONY@DOMAIN.EXT")=""
+7 SET XMTEXT="ORTEXT("
+8 DO ^XMD
+9 QUIT
MSG1(ORTYP) ;
+1 NEW XMSUB,XMY,XMTEXT,XMDUZ,ORTEXT,SITE,I,A,ORTXT,ORSUB
+2 IF ORTYP="S"
SET ORTXT="Rebuild of 'D' cross-reference STARTED for "_$$SITE^VASITE()
SET ORSUB="Rebuild of 'D' cross-reference started"
+3 IF ORTYP="RS"
SET ORTXT="Rebuild of 'D' cross-reference STOP REQUESTED for "_$$SITE^VASITE()
SET ORSUB="Rebuild of D' cross-reference stop requested"
+4 SET ORTEXT(1)=ORTXT
+5 SET ORTEXT(2)=" "
+6 SET XMDUZ=DUZ
+7 SET XMSUB=ORSUB
+8 SET XMY("CRUMLEY.JAMIE@DOMAIN.EXT")=""
SET XMY("THOMPSON.WILLIAM_ANTHONY@DOMAIN.EXT")=""
+9 SET XMTEXT="ORTEXT("
+10 DO ^XMD
+11 QUIT
REQ2STOP() ;
+1 ; Check for task stop request
+2 ; Returns 1 if stop request made.
+3 NEW STATUS,X
+4 SET STATUS=0
+5 IF '$DATA(ZTQUEUED)
QUIT 0
+6 SET X=$$S^%ZTLOAD()
+7 ;
IF X
Begin DoDot:1
+8 SET STATUS=1
+9 SET X=$$S^%ZTLOAD("Received shutdown request")
+10 SET ZTSTOP=1
End DoDot:1
+11 ;
+12 QUIT STATUS