SD53P234 ;ALB/RBS - Patch SD*5.3*234 Install Utility Routine ; 3/12/01 1:03pm
;;5.3;Scheduling;**234,1015**;AUG 13, 1993;Build 21
;
; * Note: Patch SD*5.3*212 - Baseline Seeding must have been Run *
;
; This routine will search the PCMM HL7 TRANSMISSION (#404.471) file
; for 'A'ccepted Status HL7's whose Transmission Date/Time fall
; within the dates of Oct. 23, 2000 through Oct. 31, 2000.
; These HL7's will then have their Status changed to:
; 'M' (MARKED FOR RE-TRANSMIT) in the #404.471 file.
;
; The following criteria must be true:
; 1. Must have a Baseline Run Date...
; *** AND ***
; 1a. Baseline Run Date NOT GREATER THAN Oct. 31, 2000.
; 2. BEGIN Date equals: Oct. 22, 2000@23:59 = 3001022.2359
; *** OR ***
; the Baseline Run Date (whichever greater)
; 3. END Date equals: Nov. 1, 2000@00:00 = 3001101
; 4. STATUS equals ACCEPTED
; *** AND ***
; 4a. TRANSMISSION DATE/TIME is between the BEGIN & END dates
;
;
ENV ;Main entry point for Environment check point.
S XPDABORT=""
D PROGCHK(.XPDABORT) ;checks programmer variables
D PARMCHK(.XPDABORT) ;checks param file ien exists
;
N SCX
I $D(^XTMP("SD53P234")) D Q
.S SCX=$G(^XTMP("SD53P234",0))
.D BMES^XPDUTL("*****")
.D MES^XPDUTL("The PCMM HL7 Missing Message Re-queue has already run on: "_$$FMTE^XLFDT($P(SCX,U,2)))
.D MES^XPDUTL("Transport global will be removed. Install will Abort.")
.D MES^XPDUTL("*****")
.S XPDABORT=1 ;abort install & kill all transport globals
I XPDABORT="" K XPDABORT
;
Q
;
PRE ;Main entry point for Pre-init items.
;
Q
;
POST ;Main entry point for Post-init items.
;
Q:$D(^XTMP("SD53P234"))
D SETUP ;Setup ^XTMP audit global
D POST1 ;Update Client/Server files
D POST2 ;Search & MARK HL7's to be RE-TRANSMITTED
Q
;
PROGCHK(XPDABORT) ;checks for necessary programmer variables
;
I '$G(DUZ)!($G(DUZ(0))'="@")!('$G(DT))!($G(U)'="^") D
.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
;
PARMCHK(XPDABORT) ;checks for proper param file ien
;
I '$D(^SCTM(404.44,1)) D
.D BMES^XPDUTL("*****")
.D MES^XPDUTL("PCMM Parameter file does not have proper IEN (1).")
.D MES^XPDUTL("Installation aborted.")
.D MES^XPDUTL("*****")
.S XPDABORT=2
Q
;
POST1 ;Update client/server files.
;
I $$UPCLNLST^SCMCUT("SD*5.3*234^NullClient^1^0^0") D Q
.D MES^XPDUTL("Client/Server files updated.")
;
D MES^XPDUTL("Client/Server files NOT updated.")
Q
;
POST2 ;Loop (#404.471)-PCMM HL7 TRANSMISSION LOG file
; Search for HL7's with 'A'ccepted Status and Transmission D/T within
; the Beginning and Ending date's.
;
; begin date, end date, Baseline Run date, message variables, totals
N SCBDATE,SCEDATE,SCP212,SC1,SC2,SC3,SCTOT,SCTOTAL
S (SC1,SC2,SC3)="",(SCP212,SCTOT,SCTOTAL)=0
;
; begin/end search dates - October 23, 2000 through October 31, 2000
S SCBDATE=3001022.2359,SCEDATE=3001031.2359
;
; check for Baseline Run date
D CHECK(.SCP212)
Q:'SCP212
;
; search for messages to mark for retransmission
D LOOP
; total up all HL7's
D CNTZPC
; send user e-mail message...
D MSG(SCTOT,SCTOTAL,"")
; setup ^XTMP totals
N SCX
S SCX=$G(^XTMP("SD53P234",0)) ;temp AUDIT global
S $P(SCX,U,6)=SCTOT ;log total HL7's retransmitted
S $P(SCX,U,7)=SCTOTAL ;Total HL7's since Baseline
S ^XTMP("SD53P234",0)=SCX
;
K ^TMP($J,"SD53P234") ;clean up
Q
; *** END OF PROCESSING ***
;
CNTZPC ; Total Number HL7's since Baseline Seeding to current date
; Output; SCTOTAL = total HL7's since Baseline seeding
;
Q:'$D(^TMP($J,"SD53P234"))
N SCSEQ
S SCSEQ="" F S SCSEQ=$O(^TMP($J,"SD53P234",SCSEQ)) Q:SCSEQ="" S SCTOTAL=SCTOTAL+1
Q
;
LOOP ;Loop thru PCMM HL7 TRANSMISSION LOG file and find every entry
; with STATUS="A", and re-transmit.
; Output; SCTOT = total marked counter
;
N SCARR,SCERR,SCTRANI,SCTRANDT,SCX
S SCTRANI=0
F S SCTRANI=$O(^SCPT(404.471,"ASTAT","A",SCTRANI)) Q:SCTRANI="" D
.K SCARR,SCERR
.S SCX=SCTRANI_","
.D GETS^DIQ(404.471,SCX,".01;.02;.03;.04;.05","I","SCARR","SCERR")
.Q:$D(SCERR) ;error
.Q:$G(SCARR(404.471,SCX,.01,"I"))="" ;message control ID null
.Q:$G(SCARR(404.471,SCX,.02,"I"))="" ;patient DFN null
.Q:$G(SCARR(404.471,SCX,.03,"I"))="" ;transmission date/time null
.Q:$G(SCARR(404.471,SCX,.04,"I"))'="A" ;status not equal "A"ccepted
.Q:$G(SCARR(404.471,SCX,.05,"I"))="" ;ACK received date/time null
.S SCTRANDT=$G(SCARR(404.471,SCX,.03,"I"))
.; count actual number of 404.49 ZPC unique Provider ID's
.I SCTRANDT'<SCP212 D ZPC(SCTRANI) ;count all HL7's fm Baseline
.Q:SCTRANDT<SCBDATE ;begin date
.Q:SCTRANDT>SCEDATE ;end date
.;
.D STATUS^SCMCHLRR(SCTRANI,"M") ;change status to 'M'arked
.S SCTOT=SCTOT+1 ;total status changes
Q
;
ZPC(TRANI) ; count number of (#404.49,ien) pointers to Provider ID's
;
N SCSEQ,SCSEQI,SCZPCID
S (SCSEQ,SCSEQI,SCZPCID)=""
F S SCSEQ=$O(^SCPT(404.471,TRANI,"ZPC","B",SCSEQ)) Q:SCSEQ="" D
.F S SCSEQI=$O(^SCPT(404.471,TRANI,"ZPC","B",SCSEQ,SCSEQI)) Q:SCSEQI="" D
..S SCZPCID=$P($G(^SCPT(404.471,TRANI,"ZPC",SCSEQI,0)),"^",2)
..Q:'$D(^SCPT(404.49,SCZPCID))
..S ^TMP($J,"SD53P234",SCZPCID)=""
Q
;
MSG(SCTOT,SCTOTAL,SCXERR) ; send e-mail to user's
;
N DIFROM,SCX,SCXSITE,SCSTIME,SCETIME,SCTEXT,XMY,XMDUZ,XMSUB,XMTEXT,XMDUN,XMZ
S SCXSITE=$$SITE^VASITE
S SCX=$G(^XTMP("SD53P234",0)),SCSTIME=$P(SCX,U,3) ;start date/time
S SCETIME=$$NOW^XLFDT(),$P(SCX,U,4)=SCETIME ;end date/time
S XMDUZ=.5,XMY(XMDUZ)="",XMY(DUZ)="",XMTEXT="SCTEXT("
S XMY("G.PCMM TESTING@FORUM.VA.GOV")="" ;e-mail all sites totals to
S XMSUB="Patch SD*5.3*234 PCMM DATA NOT LOADED TO NPCD ("_$P(SCXSITE,U,3)_")"
;
S SCTEXT(1)=""
S SCTEXT(2)=" Facility Name: "_$P(SCXSITE,"^",2)
S SCTEXT(3)=" Station Number: "_$P(SCXSITE,"^",3)
S SCTEXT(4)=""
S SCTEXT(5)=" Date/Time job started: "_$$FMTE^XLFDT(SCSTIME)
S SCTEXT(6)=" Date/Time job stopped: "_$$FMTE^XLFDT(SCETIME)
S SCTEXT(7)=""
S SCTEXT(8)="Total HL7 messages Marked for Transmission to the AAC: "_SCTOT
S SCTEXT(9)="Total Provider ID records created since Baseline Run Date("_$$FMTE^XLFDT(SCP212)_"): "_SCTOTAL
I SCXERR]"" D
.S SCTEXT(10)=""
.S SCTEXT(11)=" * * * * E R R O R E N C O U N T E R E D * * * *"
.S SCTEXT(12)=""
.S SCTEXT(13)=SC1
.S SCTEXT(14)=SC2
.S SCTEXT(15)=""
D ^XMD
S ^XTMP("SD53P234",0)=SCX ;end date/time - temp audit global
Q
;
CHECK(SCP212) ; Determine whether or not the Baseline has run.
; Input: None
; Output:
; Function Value: Return date Baseline was run
;
N SCX
; setup first line of error msg.
S SC1="The PCMM HL7 Missing Message Re-queue Job was Aborted because:"
I '$D(^SCTM(404.44,1)) D Q
.S SC2=" Missing PCMM Parameter file entry."
.D MSG(0,0,1)
;
K ^TMP($J,"SD53P234")
S SCX=$$GET1^DIQ(404.44,"1,",17,"I","","^TMP($J,""SD53P234"")")
I $D(^TMP($J,"SD53P234")) D Q
.S SC2=" FileMan Error retrieving data from PCMM Parameter file."
.D MSG(0,0,1)
.K ^TMP($J,"SD53P234")
;
I SCX="" D Q
.S SC2=" No PCMM Baseline Run Date found in the PCMM Parameter file."
.D MSG(0,0,1)
;
; If Baseline Run date Greater the End search date, Quit
I SCX>SCEDATE D Q
.S SC2=" No PCMM HL7 Missing Message Retransmits required for your site."
.S SCP212=SCX D MSG(0,0,1) S SCP212=0
;
; If Baseline Run date Greater than Begin Search date,
; then use Baseline date
I SCX>SCBDATE S SCBDATE=SCX
;
S SCP212=SCX ;Baseline Run Date
Q
;
SETUP ; setup start processing time
; The ^XTMP global will be used as an audit trail for 30 days to
; prevent this process from running more than once.
; ^XTMP("SD53P234",0)=STRING
; STRING = 7 fields of data delimited by "^" up-arrow
; 1 = purge date = date ^XTMP global will be purged
; 2 = run date = date routine was run
; 3 = start d/t = start date & time of processing
; 4 = stop d/t = stop date & time of processing
; 5 = DUZ of User= ID # of user running process
; 6 = HL7 count = Total number or HL7's marked for retransmit
; 7 = TOTAL HL7'S that should be loaded from original Baseline.
;
N SCX
S $P(SCX,U)=$$HTFM^XLFDT(+$H+30),$P(SCX,U,2)=$$DT^XLFDT()
S $P(SCX,U,3)=$$NOW^XLFDT(),$P(SCX,U,5)=DUZ,$P(SCX,U,6)=0,$P(SCX,U,7)=0
S ^XTMP("SD53P234",0)=SCX
Q
SD53P234 ;ALB/RBS - Patch SD*5.3*234 Install Utility Routine ; 3/12/01 1:03pm
+1 ;;5.3;Scheduling;**234,1015**;AUG 13, 1993;Build 21
+2 ;
+3 ; * Note: Patch SD*5.3*212 - Baseline Seeding must have been Run *
+4 ;
+5 ; This routine will search the PCMM HL7 TRANSMISSION (#404.471) file
+6 ; for 'A'ccepted Status HL7's whose Transmission Date/Time fall
+7 ; within the dates of Oct. 23, 2000 through Oct. 31, 2000.
+8 ; These HL7's will then have their Status changed to:
+9 ; 'M' (MARKED FOR RE-TRANSMIT) in the #404.471 file.
+10 ;
+11 ; The following criteria must be true:
+12 ; 1. Must have a Baseline Run Date...
+13 ; *** AND ***
+14 ; 1a. Baseline Run Date NOT GREATER THAN Oct. 31, 2000.
+15 ; 2. BEGIN Date equals: Oct. 22, 2000@23:59 = 3001022.2359
+16 ; *** OR ***
+17 ; the Baseline Run Date (whichever greater)
+18 ; 3. END Date equals: Nov. 1, 2000@00:00 = 3001101
+19 ; 4. STATUS equals ACCEPTED
+20 ; *** AND ***
+21 ; 4a. TRANSMISSION DATE/TIME is between the BEGIN & END dates
+22 ;
+23 ;
ENV ;Main entry point for Environment check point.
+1 SET XPDABORT=""
+2 ;checks programmer variables
DO PROGCHK(.XPDABORT)
+3 ;checks param file ien exists
DO PARMCHK(.XPDABORT)
+4 ;
+5 NEW SCX
+6 IF $DATA(^XTMP("SD53P234"))
Begin DoDot:1
+7 SET SCX=$GET(^XTMP("SD53P234",0))
+8 DO BMES^XPDUTL("*****")
+9 DO MES^XPDUTL("The PCMM HL7 Missing Message Re-queue has already run on: "_$$FMTE^XLFDT($PIECE(SCX,U,2)))
+10 DO MES^XPDUTL("Transport global will be removed. Install will Abort.")
+11 DO MES^XPDUTL("*****")
+12 ;abort install & kill all transport globals
SET XPDABORT=1
End DoDot:1
QUIT
+13 IF XPDABORT=""
KILL XPDABORT
+14 ;
+15 QUIT
+16 ;
PRE ;Main entry point for Pre-init items.
+1 ;
+2 QUIT
+3 ;
POST ;Main entry point for Post-init items.
+1 ;
+2 IF $DATA(^XTMP("SD53P234"))
QUIT
+3 ;Setup ^XTMP audit global
DO SETUP
+4 ;Update Client/Server files
DO POST1
+5 ;Search & MARK HL7's to be RE-TRANSMITTED
DO POST2
+6 QUIT
+7 ;
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 ;
PARMCHK(XPDABORT) ;checks for proper param file ien
+1 ;
+2 IF '$DATA(^SCTM(404.44,1))
Begin DoDot:1
+3 DO BMES^XPDUTL("*****")
+4 DO MES^XPDUTL("PCMM Parameter file does not have proper IEN (1).")
+5 DO MES^XPDUTL("Installation aborted.")
+6 DO MES^XPDUTL("*****")
+7 SET XPDABORT=2
End DoDot:1
+8 QUIT
+9 ;
POST1 ;Update client/server files.
+1 ;
+2 IF $$UPCLNLST^SCMCUT("SD*5.3*234^NullClient^1^0^0")
Begin DoDot:1
+3 DO MES^XPDUTL("Client/Server files updated.")
End DoDot:1
QUIT
+4 ;
+5 DO MES^XPDUTL("Client/Server files NOT updated.")
+6 QUIT
+7 ;
POST2 ;Loop (#404.471)-PCMM HL7 TRANSMISSION LOG file
+1 ; Search for HL7's with 'A'ccepted Status and Transmission D/T within
+2 ; the Beginning and Ending date's.
+3 ;
+4 ; begin date, end date, Baseline Run date, message variables, totals
+5 NEW SCBDATE,SCEDATE,SCP212,SC1,SC2,SC3,SCTOT,SCTOTAL
+6 SET (SC1,SC2,SC3)=""
SET (SCP212,SCTOT,SCTOTAL)=0
+7 ;
+8 ; begin/end search dates - October 23, 2000 through October 31, 2000
+9 SET SCBDATE=3001022.2359
SET SCEDATE=3001031.2359
+10 ;
+11 ; check for Baseline Run date
+12 DO CHECK(.SCP212)
+13 IF 'SCP212
QUIT
+14 ;
+15 ; search for messages to mark for retransmission
+16 DO LOOP
+17 ; total up all HL7's
+18 DO CNTZPC
+19 ; send user e-mail message...
+20 DO MSG(SCTOT,SCTOTAL,"")
+21 ; setup ^XTMP totals
+22 NEW SCX
+23 ;temp AUDIT global
SET SCX=$GET(^XTMP("SD53P234",0))
+24 ;log total HL7's retransmitted
SET $PIECE(SCX,U,6)=SCTOT
+25 ;Total HL7's since Baseline
SET $PIECE(SCX,U,7)=SCTOTAL
+26 SET ^XTMP("SD53P234",0)=SCX
+27 ;
+28 ;clean up
KILL ^TMP($JOB,"SD53P234")
+29 QUIT
+30 ; *** END OF PROCESSING ***
+31 ;
CNTZPC ; Total Number HL7's since Baseline Seeding to current date
+1 ; Output; SCTOTAL = total HL7's since Baseline seeding
+2 ;
+3 IF '$DATA(^TMP($JOB,"SD53P234"))
QUIT
+4 NEW SCSEQ
+5 SET SCSEQ=""
FOR
SET SCSEQ=$ORDER(^TMP($JOB,"SD53P234",SCSEQ))
IF SCSEQ=""
QUIT
SET SCTOTAL=SCTOTAL+1
+6 QUIT
+7 ;
LOOP ;Loop thru PCMM HL7 TRANSMISSION LOG file and find every entry
+1 ; with STATUS="A", and re-transmit.
+2 ; Output; SCTOT = total marked counter
+3 ;
+4 NEW SCARR,SCERR,SCTRANI,SCTRANDT,SCX
+5 SET SCTRANI=0
+6 FOR
SET SCTRANI=$ORDER(^SCPT(404.471,"ASTAT","A",SCTRANI))
IF SCTRANI=""
QUIT
Begin DoDot:1
+7 KILL SCARR,SCERR
+8 SET SCX=SCTRANI_","
+9 DO GETS^DIQ(404.471,SCX,".01;.02;.03;.04;.05","I","SCARR","SCERR")
+10 ;error
IF $DATA(SCERR)
QUIT
+11 ;message control ID null
IF $GET(SCARR(404.471,SCX,.01,"I"))=""
QUIT
+12 ;patient DFN null
IF $GET(SCARR(404.471,SCX,.02,"I"))=""
QUIT
+13 ;transmission date/time null
IF $GET(SCARR(404.471,SCX,.03,"I"))=""
QUIT
+14 ;status not equal "A"ccepted
IF $GET(SCARR(404.471,SCX,.04,"I"))'="A"
QUIT
+15 ;ACK received date/time null
IF $GET(SCARR(404.471,SCX,.05,"I"))=""
QUIT
+16 SET SCTRANDT=$GET(SCARR(404.471,SCX,.03,"I"))
+17 ; count actual number of 404.49 ZPC unique Provider ID's
+18 ;count all HL7's fm Baseline
IF SCTRANDT'<SCP212
DO ZPC(SCTRANI)
+19 ;begin date
IF SCTRANDT<SCBDATE
QUIT
+20 ;end date
IF SCTRANDT>SCEDATE
QUIT
+21 ;
+22 ;change status to 'M'arked
DO STATUS^SCMCHLRR(SCTRANI,"M")
+23 ;total status changes
SET SCTOT=SCTOT+1
End DoDot:1
+24 QUIT
+25 ;
ZPC(TRANI) ; count number of (#404.49,ien) pointers to Provider ID's
+1 ;
+2 NEW SCSEQ,SCSEQI,SCZPCID
+3 SET (SCSEQ,SCSEQI,SCZPCID)=""
+4 FOR
SET SCSEQ=$ORDER(^SCPT(404.471,TRANI,"ZPC","B",SCSEQ))
IF SCSEQ=""
QUIT
Begin DoDot:1
+5 FOR
SET SCSEQI=$ORDER(^SCPT(404.471,TRANI,"ZPC","B",SCSEQ,SCSEQI))
IF SCSEQI=""
QUIT
Begin DoDot:2
+6 SET SCZPCID=$PIECE($GET(^SCPT(404.471,TRANI,"ZPC",SCSEQI,0)),"^",2)
+7 IF '$DATA(^SCPT(404.49,SCZPCID))
QUIT
+8 SET ^TMP($JOB,"SD53P234",SCZPCID)=""
End DoDot:2
End DoDot:1
+9 QUIT
+10 ;
MSG(SCTOT,SCTOTAL,SCXERR) ; send e-mail to user's
+1 ;
+2 NEW DIFROM,SCX,SCXSITE,SCSTIME,SCETIME,SCTEXT,XMY,XMDUZ,XMSUB,XMTEXT,XMDUN,XMZ
+3 SET SCXSITE=$$SITE^VASITE
+4 ;start date/time
SET SCX=$GET(^XTMP("SD53P234",0))
SET SCSTIME=$PIECE(SCX,U,3)
+5 ;end date/time
SET SCETIME=$$NOW^XLFDT()
SET $PIECE(SCX,U,4)=SCETIME
+6 SET XMDUZ=.5
SET XMY(XMDUZ)=""
SET XMY(DUZ)=""
SET XMTEXT="SCTEXT("
+7 ;e-mail all sites totals to
SET XMY("G.PCMM TESTING@FORUM.VA.GOV")=""
+8 SET XMSUB="Patch SD*5.3*234 PCMM DATA NOT LOADED TO NPCD ("_$PIECE(SCXSITE,U,3)_")"
+9 ;
+10 SET SCTEXT(1)=""
+11 SET SCTEXT(2)=" Facility Name: "_$PIECE(SCXSITE,"^",2)
+12 SET SCTEXT(3)=" Station Number: "_$PIECE(SCXSITE,"^",3)
+13 SET SCTEXT(4)=""
+14 SET SCTEXT(5)=" Date/Time job started: "_$$FMTE^XLFDT(SCSTIME)
+15 SET SCTEXT(6)=" Date/Time job stopped: "_$$FMTE^XLFDT(SCETIME)
+16 SET SCTEXT(7)=""
+17 SET SCTEXT(8)="Total HL7 messages Marked for Transmission to the AAC: "_SCTOT
+18 SET SCTEXT(9)="Total Provider ID records created since Baseline Run Date("_$$FMTE^XLFDT(SCP212)_"): "_SCTOTAL
+19 IF SCXERR]""
Begin DoDot:1
+20 SET SCTEXT(10)=""
+21 SET SCTEXT(11)=" * * * * E R R O R E N C O U N T E R E D * * * *"
+22 SET SCTEXT(12)=""
+23 SET SCTEXT(13)=SC1
+24 SET SCTEXT(14)=SC2
+25 SET SCTEXT(15)=""
End DoDot:1
+26 DO ^XMD
+27 ;end date/time - temp audit global
SET ^XTMP("SD53P234",0)=SCX
+28 QUIT
+29 ;
CHECK(SCP212) ; Determine whether or not the Baseline has run.
+1 ; Input: None
+2 ; Output:
+3 ; Function Value: Return date Baseline was run
+4 ;
+5 NEW SCX
+6 ; setup first line of error msg.
+7 SET SC1="The PCMM HL7 Missing Message Re-queue Job was Aborted because:"
+8 IF '$DATA(^SCTM(404.44,1))
Begin DoDot:1
+9 SET SC2=" Missing PCMM Parameter file entry."
+10 DO MSG(0,0,1)
End DoDot:1
QUIT
+11 ;
+12 KILL ^TMP($JOB,"SD53P234")
+13 SET SCX=$$GET1^DIQ(404.44,"1,",17,"I","","^TMP($J,""SD53P234"")")
+14 IF $DATA(^TMP($JOB,"SD53P234"))
Begin DoDot:1
+15 SET SC2=" FileMan Error retrieving data from PCMM Parameter file."
+16 DO MSG(0,0,1)
+17 KILL ^TMP($JOB,"SD53P234")
End DoDot:1
QUIT
+18 ;
+19 IF SCX=""
Begin DoDot:1
+20 SET SC2=" No PCMM Baseline Run Date found in the PCMM Parameter file."
+21 DO MSG(0,0,1)
End DoDot:1
QUIT
+22 ;
+23 ; If Baseline Run date Greater the End search date, Quit
+24 IF SCX>SCEDATE
Begin DoDot:1
+25 SET SC2=" No PCMM HL7 Missing Message Retransmits required for your site."
+26 SET SCP212=SCX
DO MSG(0,0,1)
SET SCP212=0
End DoDot:1
QUIT
+27 ;
+28 ; If Baseline Run date Greater than Begin Search date,
+29 ; then use Baseline date
+30 IF SCX>SCBDATE
SET SCBDATE=SCX
+31 ;
+32 ;Baseline Run Date
SET SCP212=SCX
+33 QUIT
+34 ;
SETUP ; setup start processing time
+1 ; The ^XTMP global will be used as an audit trail for 30 days to
+2 ; prevent this process from running more than once.
+3 ; ^XTMP("SD53P234",0)=STRING
+4 ; STRING = 7 fields of data delimited by "^" up-arrow
+5 ; 1 = purge date = date ^XTMP global will be purged
+6 ; 2 = run date = date routine was run
+7 ; 3 = start d/t = start date & time of processing
+8 ; 4 = stop d/t = stop date & time of processing
+9 ; 5 = DUZ of User= ID # of user running process
+10 ; 6 = HL7 count = Total number or HL7's marked for retransmit
+11 ; 7 = TOTAL HL7'S that should be loaded from original Baseline.
+12 ;
+13 NEW SCX
+14 SET $PIECE(SCX,U)=$$HTFM^XLFDT(+$HOROLOG+30)
SET $PIECE(SCX,U,2)=$$DT^XLFDT()
+15 SET $PIECE(SCX,U,3)=$$NOW^XLFDT()
SET $PIECE(SCX,U,5)=DUZ
SET $PIECE(SCX,U,6)=0
SET $PIECE(SCX,U,7)=0
+16 SET ^XTMP("SD53P234",0)=SCX
+17 QUIT