Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ORY397A

ORY397A.m

Go to the documentation of this file.
  1. 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
  1. ;
  1. Q
  1. EN ; Task off the rebuild of the 'D' cross-reference for file #100
  1. N ZTDTH,ZTIO,ZTSK,ZTRTN,ZTDESC
  1. D BMES^XPDUTL("Queueing Rebuild of the 'D' cross-reference for ORDERS file (#100)")
  1. S ZTDTH=$$FMADD^XLFDT($$NOW^XLFDT,0,0,0,10)
  1. S ZTRTN="TASK^ORY397A",ZTDESC="Rebuild of the 'D' xref for file #100"
  1. S ZTIO=""
  1. D ^%ZTLOAD
  1. I +$G(ZTSK)=0 D
  1. . D BMES^XPDUTL("Unable to queue the file #100 xref Rebuild, file a help desk ticket for assistance.")
  1. E D
  1. . D BMES^XPDUTL("DONE - Task #"_ZTSK)
  1. Q
  1. TASK ;
  1. N ORIFN,I,J,STOP,A,OR0,OR3,ORDIALOG,ORIT,STOP,ZTSTOP
  1. D MSG1("S")
  1. S STOP=0
  1. S ORIFN=$G(^OR(100,"D",0)) I ORIFN="" S ORIFN=" "
  1. F I=1:1 D Q:'ORIFN I STOP Q
  1. . S ORIFN=$O(^OR(100,ORIFN),-1) Q:'ORIFN
  1. . S OR0=$G(^OR(100,ORIFN,0)) Q:'OR0
  1. . S ORDIALOG=+$P(OR0,"^",5),A=ORDIALOG_";ORD(101.41," K ^OR(100,"D",A,ORIFN)
  1. . S OR3=$G(^OR(100,ORIFN,3)) Q:'OR3
  1. . S ORIT=$P(OR3,"^",4)
  1. . I $G(ORIT),ORIT?.E1";ORD(101.41," S ^OR(100,"D",ORIT,ORIFN)=""
  1. . S ^OR(100,"D",0)=ORIFN
  1. . I '(I#100000) D I STOP Q
  1. .. F J=1:1:510 H 1 I '(J#120) S STOP=$$REQ2STOP() I STOP Q
  1. I 'STOP K ^OR(100,"D",0) D MSG
  1. I STOP D MSG1("RS")
  1. Q
  1. MSG ;
  1. N XMSUB,XMY,XMTEXT,XMDUZ,ORTEXT,SITE,I,A
  1. S ORTEXT(1)="Rebuild of 'D' cross-reference completed for "_$$SITE^VASITE()
  1. S ORTEXT(2)=" "
  1. S XMDUZ=DUZ
  1. S XMSUB="Rebuild of 'D' cross-reference completed"
  1. S XMY("CRUMLEY.JAMIE@DOMAIN.EXT")="",XMY("THOMPSON.WILLIAM_ANTHONY@DOMAIN.EXT")=""
  1. S XMTEXT="ORTEXT("
  1. D ^XMD
  1. Q
  1. MSG1(ORTYP) ;
  1. N XMSUB,XMY,XMTEXT,XMDUZ,ORTEXT,SITE,I,A,ORTXT,ORSUB
  1. I ORTYP="S" S ORTXT="Rebuild of 'D' cross-reference STARTED for "_$$SITE^VASITE(),ORSUB="Rebuild of 'D' cross-reference started"
  1. I ORTYP="RS" S ORTXT="Rebuild of 'D' cross-reference STOP REQUESTED for "_$$SITE^VASITE(),ORSUB="Rebuild of D' cross-reference stop requested"
  1. S ORTEXT(1)=ORTXT
  1. S ORTEXT(2)=" "
  1. S XMDUZ=DUZ
  1. S XMSUB=ORSUB
  1. S XMY("CRUMLEY.JAMIE@DOMAIN.EXT")="",XMY("THOMPSON.WILLIAM_ANTHONY@DOMAIN.EXT")=""
  1. S XMTEXT="ORTEXT("
  1. D ^XMD
  1. Q
  1. REQ2STOP() ;
  1. ; Check for task stop request
  1. ; Returns 1 if stop request made.
  1. N STATUS,X
  1. S STATUS=0
  1. I '$D(ZTQUEUED) Q 0
  1. S X=$$S^%ZTLOAD()
  1. I X D ;
  1. . S STATUS=1
  1. . S X=$$S^%ZTLOAD("Received shutdown request")
  1. . S ZTSTOP=1
  1. ;
  1. Q STATUS