SD53252P ;ALB/JKT - ACRP TEMP FIX FOR RETRANS TO AUSTIN;19-SEP-2001 ; 9/24/01 12:30pm
;;5.3;Scheduling;**252,1015**;Aug 13, 1993;Build 21
;
MAIN ;Main entry point
;Queue marking of encounters and quit
N ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTSK
S ZTRTN="MARKENC^SD53252P"
S ZTDESC="Mark July 26-29 2001 encounters for retransmission"
S ZTDTH=$H
S ZTIO=""
D ^%ZTLOAD
I $G(ZTSK) D BMES^XPDUTL("Queued as task number "_ZTSK)
I '$G(ZTSK) D BMES^XPDUTL("** Unable to queue task **")
Q
;
MARKENC ;Mark encounters for transmission
N XMITPTR,EVNTDATE,NODE,ENCPTR,DELPTR,XMITCNT,ENCDATE
N ZMDUZ,ZTREQ,ZTSTOP
;Scan transmission file (#409.73) looking for encounters that were
;transmitted between July 26 and July 29, 2001.
;Mark those found for retransmission.
S XMITPTR=0
S ZTSTOP=$$S^%ZTLOAD("Starting check") Q:ZTSTOP
F XMITCNT=1:1 S XMITPTR=+$O(^SD(409.73,XMITPTR)) Q:'XMITPTR D Q:ZTSTOP
.S NODE=$G(^SD(409.73,XMITPTR,0))
.Q:NODE=""
.S EVNTDATE=+$P(NODE,"^",6)
.Q:(EVNTDATE<3010726)!(EVNTDATE>3010729)
.D STREEVNT^SCDXFU01(XMITPTR,0)
.D XMITFLAG^SCDXFU01(XMITPTR)
.S:'(XMITCNT#20) ZTSTOP=$$S^%ZTLOAD("Just checked entry #"_XMITPTR)
;User asked task to stop
I ZTSTOP S ZTSTOP=$$S^%ZTLOAD("Task stopped after entry #"_XMITPTR) Q
TST ;Send completion message to user
N XMTEXT,XMZ,XMY,XMSUB,SDTEXT,OFFSET
F OFFSET=1:1 S NODE=$T(MSGTXT+OFFSET) Q:$P(NODE,";",2)="END" S SDTEXT(OFFSET,0)=$P(NODE,";;",2)
S XMTEXT="SDTEXT("
S XMSUB="Marking of July 26-29 2001 encounters completed"
S XMDUZ="AmbCare"
S XMY(DUZ)=""
D ^XMD
;Done
S ZTREQ="@"
Q
MSGTXT ;Message text for task completion
;;
;;Marking of encounters for retransmission has run to completion.
;;Schedule the option SCDX AMBCAR NIGHTLY XMIT [Ambulatory Care Nightly
;;Transmission to NPCDB] so that transmission of these encounters to
;;Austin can begin. This option should already be scheduled to run
;;daily but starting it now will give as much time as possible for
;;transmission to occur since data submitted after 10/19/01 will not
;;be included in this year's snapshot.
;;
;;Reminder: The option SCDX AMBCAR NIGHTLY XMIT [Ambulatory Care Nightly
;;Transmission to NPCDB] should be scheduled to run on a daily basis.
;;
;END
;
SD53252P ;ALB/JKT - ACRP TEMP FIX FOR RETRANS TO AUSTIN;19-SEP-2001 ; 9/24/01 12:30pm
+1 ;;5.3;Scheduling;**252,1015**;Aug 13, 1993;Build 21
+2 ;
MAIN ;Main entry point
+1 ;Queue marking of encounters and quit
+2 NEW ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTSK
+3 SET ZTRTN="MARKENC^SD53252P"
+4 SET ZTDESC="Mark July 26-29 2001 encounters for retransmission"
+5 SET ZTDTH=$HOROLOG
+6 SET ZTIO=""
+7 DO ^%ZTLOAD
+8 IF $GET(ZTSK)
DO BMES^XPDUTL("Queued as task number "_ZTSK)
+9 IF '$GET(ZTSK)
DO BMES^XPDUTL("** Unable to queue task **")
+10 QUIT
+11 ;
MARKENC ;Mark encounters for transmission
+1 NEW XMITPTR,EVNTDATE,NODE,ENCPTR,DELPTR,XMITCNT,ENCDATE
+2 NEW ZMDUZ,ZTREQ,ZTSTOP
+3 ;Scan transmission file (#409.73) looking for encounters that were
+4 ;transmitted between July 26 and July 29, 2001.
+5 ;Mark those found for retransmission.
+6 SET XMITPTR=0
+7 SET ZTSTOP=$$S^%ZTLOAD("Starting check")
IF ZTSTOP
QUIT
+8 FOR XMITCNT=1:1
SET XMITPTR=+$ORDER(^SD(409.73,XMITPTR))
IF 'XMITPTR
QUIT
Begin DoDot:1
+9 SET NODE=$GET(^SD(409.73,XMITPTR,0))
+10 IF NODE=""
QUIT
+11 SET EVNTDATE=+$PIECE(NODE,"^",6)
+12 IF (EVNTDATE<3010726)!(EVNTDATE>3010729)
QUIT
+13 DO STREEVNT^SCDXFU01(XMITPTR,0)
+14 DO XMITFLAG^SCDXFU01(XMITPTR)
+15 IF '(XMITCNT#20)
SET ZTSTOP=$$S^%ZTLOAD("Just checked entry #"_XMITPTR)
End DoDot:1
IF ZTSTOP
QUIT
+16 ;User asked task to stop
+17 IF ZTSTOP
SET ZTSTOP=$$S^%ZTLOAD("Task stopped after entry #"_XMITPTR)
QUIT
TST ;Send completion message to user
+1 NEW XMTEXT,XMZ,XMY,XMSUB,SDTEXT,OFFSET
+2 FOR OFFSET=1:1
SET NODE=$TEXT(MSGTXT+OFFSET)
IF $PIECE(NODE,";",2)="END"
QUIT
SET SDTEXT(OFFSET,0)=$PIECE(NODE,";;",2)
+3 SET XMTEXT="SDTEXT("
+4 SET XMSUB="Marking of July 26-29 2001 encounters completed"
+5 SET XMDUZ="AmbCare"
+6 SET XMY(DUZ)=""
+7 DO ^XMD
+8 ;Done
+9 SET ZTREQ="@"
+10 QUIT
MSGTXT ;Message text for task completion
+1 ;;
+2 ;;Marking of encounters for retransmission has run to completion.
+3 ;;Schedule the option SCDX AMBCAR NIGHTLY XMIT [Ambulatory Care Nightly
+4 ;;Transmission to NPCDB] so that transmission of these encounters to
+5 ;;Austin can begin. This option should already be scheduled to run
+6 ;;daily but starting it now will give as much time as possible for
+7 ;;transmission to occur since data submitted after 10/19/01 will not
+8 ;;be included in this year's snapshot.
+9 ;;
+10 ;;Reminder: The option SCDX AMBCAR NIGHTLY XMIT [Ambulatory Care Nightly
+11 ;;Transmission to NPCDB] should be scheduled to run on a daily basis.
+12 ;;
+13 ;END
+14 ;