SD53P256 ;ALB/RPM - Pre/Post-Install;15-Nov-2001
;;5.3;Scheduling;**256**;Aug 13, 1993
;
;
ENV ;Main entry point for Environment check point.
;
S XPDABORT=""
D PROGCHK(.XPDABORT) ;checks programmer variables
I XPDABORT="" K XPDABORT
Q
;
;
PRE ;Main entry point for Pre-init items.
;
Q
;
;
POST ;Main entry point for Post-init items.
;
D POST1
Q
;
;
PROGCHK(XPDABORT) ;checks for necessary programmer variables
;
I '$G(DUZ)!($G(DUZ(0))'="@")!('$G(DT))!($G(U)'="^") DO
.D BMES^XPDUTL("*****")
.D MES^XPDUTL("Your programming variables are not set up properly.")
.D MES^XPDUTL("Installation aborted.")
.D MES^XPDUTL("*****")
.S XPDABORT=2
Q
;
POST1 ;Set up TaskMan to re-queue AmbCare records in the background
N ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSK
S ZTRTN="SCAN^SD53P256"
S ZTDESC="Re-queue AmbCare records for SD*5.3*256"
;Queue Task to start in 60 seconds
S ZTDTH=$$SCH^XLFDT("60S",$$NOW^XLFDT)
S ZTIO=""
D ^%ZTLOAD
D BMES^XPDUTL("*****")
D
. I $D(ZTSK)[0 D Q
. . D MES^XPDUTL("TaskMan task to requeue AmbCare records for SD*5.3*256 did not start.")
. . D MES^XPDUTL("Re-run post-install routine POST^SD53P256.")
. D MES^XPDUTL("Task "_ZTSK_" started to re-queue AmbCare records.")
. I $D(ZTSK("D")) D
. . D MES^XPDUTL("Task will start at "_$$HTE^XLFDT(ZTSK("D")))
D MES^XPDUTL("*****")
Q
;
SCAN ;Scan the OUTPATIENT CLASSIFICATION file (#409.42) for patients
;who have an Outpatient Classification Type of 6 - "HEAD AND/OR NECK
;CANCER". Use $$FINDXMIT^SCDXFU01 to find corresponding entry in
;TRANSMITTED OUTPATIENT ENCOUNTER file (#409.73).
;
N SDIEN ;Outpatient Classification file IEN
N SDTIEN ;Transmitted Outpatient Encounter file IEN
N SDENCPTR ;Outpatient Encounter file pointer
N SDTYPE6 ;Count of encounters w/Type 6
N SDREQUE ;Count of messages re-queued
N SDSTART ;start date/time
;
S SDSTART=$$NOW^XLFDT
S (SDIEN,SDREQUE,SDTYPE6)=0
F S SDIEN=$O(^SDD(409.42,"B",6,SDIEN)) Q:'SDIEN D
. S SDTYPE6=SDTYPE6+1
. S SDENCPTR=$P($G(^SDD(409.42,SDIEN,0)),U,2)
. Q:'SDENCPTR
. ;locate last transmitted message
. S SDTIEN=$$FINDXMIT^SCDXFU01(SDENCPTR)
. Q:'SDTIEN
. ;store event information
. D STREEVNT^SCDXFU01(SDTIEN,0)
. ;set transmission flag to 'YES'
. D XMITFLAG^SCDXFU01(SDTIEN)
. S SDREQUE=SDREQUE+1
;send completion MailMan message
D NOTIFY(SDSTART,SDREQUE,SDTYPE6)
;delete the task entry
S ZTREQ="@"
Q
;
NOTIFY(SDSTIME,SDREQ,SDTYP6) ;send job completion msg
;
; Input
; SDSTIME - job start date/time
; SDREQ - count of AmbCare messages re-queued
; SDTYP6 - count of Type 6 encounters
;
; Output
; none
;
N DIFROM,XMDUZ,XMSUB,XMTEXT,XMY,XMZ
N SDSITE,SDETIME,SDTEXT
S SDSITE=$$SITE^VASITE
S SDETIME=$$NOW^XLFDT
S XMDUZ="AmbCare Re-queue"
S XMSUB="Patch SD*5.3*256 Mill Bill Co-Pay Enhancements"
S XMTEXT="SDTEXT("
S XMY(DUZ)=""
S SDTEXT(1)=""
S SDTEXT(2)=" Facility Name: "_$P(SDSITE,U,2)
S SDTEXT(3)=" Station Number: "_$P(SDSITE,U,3)
S SDTEXT(4)=""
S SDTEXT(5)=" Date/Time job started: "_$$FMTE^XLFDT(SDSTIME)
S SDTEXT(6)=" Date/Time job stopped: "_$$FMTE^XLFDT(SDETIME)
S SDTEXT(7)=""
S SDTEXT(8)="Total Head/Neck Cancer Encounters: "_SDTYP6
S SDTEXT(9)="Total AmbCare records re-queued : "_SDREQ
D ^XMD
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSD53P256 3381 printed Dec 13, 2024@02:46:09 Page 2
SD53P256 ;ALB/RPM - Pre/Post-Install;15-Nov-2001
+1 ;;5.3;Scheduling;**256**;Aug 13, 1993
+2 ;
+3 ;
ENV ;Main entry point for Environment check point.
+1 ;
+2 SET XPDABORT=""
+3 ;checks programmer variables
DO PROGCHK(.XPDABORT)
+4 IF XPDABORT=""
KILL XPDABORT
+5 QUIT
+6 ;
+7 ;
PRE ;Main entry point for Pre-init items.
+1 ;
+2 QUIT
+3 ;
+4 ;
POST ;Main entry point for Post-init items.
+1 ;
+2 DO POST1
+3 QUIT
+4 ;
+5 ;
PROGCHK(XPDABORT) ;checks for necessary programmer variables
+1 ;
+2 IF '$GET(DUZ)!($GET(DUZ(0))'="@")!('$GET(DT))!($GET(U)'="^")
Begin DoDot:1
+3 DO BMES^XPDUTL("*****")
+4 DO MES^XPDUTL("Your programming variables are not set up properly.")
+5 DO MES^XPDUTL("Installation aborted.")
+6 DO MES^XPDUTL("*****")
+7 SET XPDABORT=2
End DoDot:1
+8 QUIT
+9 ;
POST1 ;Set up TaskMan to re-queue AmbCare records in the background
+1 NEW ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSK
+2 SET ZTRTN="SCAN^SD53P256"
+3 SET ZTDESC="Re-queue AmbCare records for SD*5.3*256"
+4 ;Queue Task to start in 60 seconds
+5 SET ZTDTH=$$SCH^XLFDT("60S",$$NOW^XLFDT)
+6 SET ZTIO=""
+7 DO ^%ZTLOAD
+8 DO BMES^XPDUTL("*****")
+9 Begin DoDot:1
+10 IF $DATA(ZTSK)[0
Begin DoDot:2
+11 DO MES^XPDUTL("TaskMan task to requeue AmbCare records for SD*5.3*256 did not start.")
+12 DO MES^XPDUTL("Re-run post-install routine POST^SD53P256.")
End DoDot:2
QUIT
+13 DO MES^XPDUTL("Task "_ZTSK_" started to re-queue AmbCare records.")
+14 IF $DATA(ZTSK("D"))
Begin DoDot:2
+15 DO MES^XPDUTL("Task will start at "_$$HTE^XLFDT(ZTSK("D")))
End DoDot:2
End DoDot:1
+16 DO MES^XPDUTL("*****")
+17 QUIT
+18 ;
SCAN ;Scan the OUTPATIENT CLASSIFICATION file (#409.42) for patients
+1 ;who have an Outpatient Classification Type of 6 - "HEAD AND/OR NECK
+2 ;CANCER". Use $$FINDXMIT^SCDXFU01 to find corresponding entry in
+3 ;TRANSMITTED OUTPATIENT ENCOUNTER file (#409.73).
+4 ;
+5 ;Outpatient Classification file IEN
NEW SDIEN
+6 ;Transmitted Outpatient Encounter file IEN
NEW SDTIEN
+7 ;Outpatient Encounter file pointer
NEW SDENCPTR
+8 ;Count of encounters w/Type 6
NEW SDTYPE6
+9 ;Count of messages re-queued
NEW SDREQUE
+10 ;start date/time
NEW SDSTART
+11 ;
+12 SET SDSTART=$$NOW^XLFDT
+13 SET (SDIEN,SDREQUE,SDTYPE6)=0
+14 FOR
SET SDIEN=$ORDER(^SDD(409.42,"B",6,SDIEN))
if 'SDIEN
QUIT
Begin DoDot:1
+15 SET SDTYPE6=SDTYPE6+1
+16 SET SDENCPTR=$PIECE($GET(^SDD(409.42,SDIEN,0)),U,2)
+17 if 'SDENCPTR
QUIT
+18 ;locate last transmitted message
+19 SET SDTIEN=$$FINDXMIT^SCDXFU01(SDENCPTR)
+20 if 'SDTIEN
QUIT
+21 ;store event information
+22 DO STREEVNT^SCDXFU01(SDTIEN,0)
+23 ;set transmission flag to 'YES'
+24 DO XMITFLAG^SCDXFU01(SDTIEN)
+25 SET SDREQUE=SDREQUE+1
End DoDot:1
+26 ;send completion MailMan message
+27 DO NOTIFY(SDSTART,SDREQUE,SDTYPE6)
+28 ;delete the task entry
+29 SET ZTREQ="@"
+30 QUIT
+31 ;
NOTIFY(SDSTIME,SDREQ,SDTYP6) ;send job completion msg
+1 ;
+2 ; Input
+3 ; SDSTIME - job start date/time
+4 ; SDREQ - count of AmbCare messages re-queued
+5 ; SDTYP6 - count of Type 6 encounters
+6 ;
+7 ; Output
+8 ; none
+9 ;
+10 NEW DIFROM,XMDUZ,XMSUB,XMTEXT,XMY,XMZ
+11 NEW SDSITE,SDETIME,SDTEXT
+12 SET SDSITE=$$SITE^VASITE
+13 SET SDETIME=$$NOW^XLFDT
+14 SET XMDUZ="AmbCare Re-queue"
+15 SET XMSUB="Patch SD*5.3*256 Mill Bill Co-Pay Enhancements"
+16 SET XMTEXT="SDTEXT("
+17 SET XMY(DUZ)=""
+18 SET SDTEXT(1)=""
+19 SET SDTEXT(2)=" Facility Name: "_$PIECE(SDSITE,U,2)
+20 SET SDTEXT(3)=" Station Number: "_$PIECE(SDSITE,U,3)
+21 SET SDTEXT(4)=""
+22 SET SDTEXT(5)=" Date/Time job started: "_$$FMTE^XLFDT(SDSTIME)
+23 SET SDTEXT(6)=" Date/Time job stopped: "_$$FMTE^XLFDT(SDETIME)
+24 SET SDTEXT(7)=""
+25 SET SDTEXT(8)="Total Head/Neck Cancer Encounters: "_SDTYP6
+26 SET SDTEXT(9)="Total AmbCare records re-queued : "_SDREQ
+27 DO ^XMD
+28 QUIT