- DG53P423 ;ALB/RPM - Pre/Post-Install;Nov 13, 2001 ; 1/16/02 3:33pm
- ;;5.3;Registration;**423**;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 ;rebuild 'AST' index for file #28.11
- D POST2 ;requeue Head and Neck Cancer PTF messages
- 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 ;Rebuild the "AST" index for file #28.11
- N DIK,X
- I '$D(^DGNT(28.11,"AST")) D Q
- . D BMES^XPDUTL(" Re-index of 'AST' cross reference not needed.")
- D BMES^XPDUTL(" Please be patient while I re-index the 'AST' cross reference.")
- K ^DGNT(28.11,"AST")
- S DIK="^DGNT(28.11,",DIK(1)=".03^AST"
- D ENALL^DIK
- D BMES^XPDUTL(" The NOSE AND THROAT RADIUM HISTORY file (#28.11) 'AST' x-ref re-indexed.")
- Q
- ;
- POST2 ;Set up TaskMan to re-queue PTF records in the background
- N ZTDESC,ZTDTH,ZTIO,ZTQUEUED,ZTREQ,ZTRTN,ZTSAVE,ZTSK
- S ZTRTN="SCAN^DG53P423"
- S ZTDESC="Re-queue PTF records for DG*5.3*423"
- ;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 run to requeue PTF records for DG*5.3*423 was not started.")
- . .D MES^XPDUTL("Re-run Post Install routine POST2^DG53P423.")
- . D MES^XPDUTL("Task "_ZTSK_" started to requeue PTF records.")
- . I $D(ZTSK("D")) D
- . . D MES^XPDUTL("Task will start at "_$$HTE^XLFDT(ZTSK("D")))
- D MES^XPDUTL("*****")
- Q
- ;
- SCAN ;Scan the Nose and Throat Radium History file (#28.11) for patients
- ;who have a Screening Status of either 4:VERIFIED MILITARY MEDICAL
- ;RECORD AND DIAGNOSIS or 5:VERIFIED SERVICE RECORD AND DIAGNOSIS.
- ;Search the PTF records for any messages that would have
- ;been transmitted to the NPCD after the verification date and re-queue
- ;those messages.
- ;
- N DGSTART ;Job start date/time
- N DGTOTCNT ;count of verified patients
- N DGPTFCNT ;count of re-queued PTF records
- N DGMSG ;free text message/line count passed to NOTIFY
- N DGSTAT ;NTR Status value
- N DGIEN ;IEN for NTR History file
- N DGX ;generic index counter
- N DGNT ;array of NTR History file nodes
- N DGDTTMP ;temporary value of NTR verification date
- N DGDFN ;IEN to PATIENT file (#2)
- N DGDT ;NTR verification date
- N DGPTFARR ;array of PTF records to re-queue
- N DGQUIT ;job control flag
- ;
- S DGSTART=$$NOW^XLFDT
- S (DGMSG,DGQUIT,DGTOTCNT)=0
- S DGPTFCNT="0^0"
- S ZTREQ="@" ;delete task when finished
- L +^DGP(45.83):3 I '$T D Q
- . S DGMSG=2
- . S DGMSG(1)="PTF Transmission Currently Running - Patch Re-queue Job Stopping"
- . S DGMSG(2)="Re-run Post Install routine POST2^DG53P423."
- . D NOTIFY(DGSTART,DGTOTCNT,DGPTFCNT,.DGMSG)
- S DGDFN=0
- F S DGDFN=$O(^DGNT(28.11,"APR",DGDFN)) Q:'DGDFN D Q:DGQUIT
- . K DGPTFARR
- . S DGIEN=$O(^DGNT(28.11,"APR",DGDFN,1,0))
- . Q:'DGIEN
- . S DGDT=0
- . F DGX=0:1:2 D
- . . S DGNT(DGX)=$G(^DGNT(28.11,DGIEN,DGX))
- . . S DGDTTMP=+$P(DGNT(DGX),U,$S(DGX=0:7,1:2)) ;get date field
- . . I DGDTTMP>DGDT S DGDT=DGDTTMP
- . Q:'DGDT
- . Q:".4.5."'[("."_$P(DGNT(0),U,3)_".") ;only verified N/T
- . S DGTOTCNT=DGTOTCNT+1
- . ;search for any PTF records that were xmit'ed and re-queue them
- . I $$GETPTF(DGDFN,DGDT,.DGPTFARR) D REQPTF(.DGPTFARR,.DGPTFCNT)
- . I $$S^%ZTLOAD D Q
- . . S DGMSG=2
- . . S DGMSG(1)="Patch DG*5.3*423 PTF Re-queue Task Stopped by User"
- . . S DGMSG(2)="Re-run Post Install routine POST2^DG53P423."
- . . S (ZTSTOP,DGQUIT)=1
- L -^DGP(45.83)
- D NOTIFY(DGSTART,DGTOTCNT,DGPTFCNT,.DGMSG)
- Q
- ;
- GETPTF(DFN,DGDAT,DGPT) ;Find PTF records transmitted after the verification
- ; date. Build array subscripted by record numbers set equal to the
- ; PTF record type.
- ;
- ; Input
- ; DFN - IEN to PATIENT file (#2)
- ; DGDAT - date of NTR verification
- ; DGPT - array node passed by reference
- ;
- ; Output
- ; DGPT - array of PTF record types and queue dates (1:PTF,2:CENSUS)
- ; subscripted by PTF record # (ex. DGPT(1402)=2^3011212)
- ; function result - 0 : no records found
- ; 1 : records found
- ;
- N DGPTF ;PTF record number (file #45 IEN)
- N DGQDT ;Date Queued
- N DGRTY ;Record type
- N DGPT0 ;zero node of patient's PTF record
- ;
- I '$D(^DGPT("B",DFN)) Q 0
- S DGPTF=0
- F S DGPTF=$O(^DGPT("B",DFN,DGPTF)) Q:'DGPTF D
- . ;borrowed from DIC("S") in DREL^DGPTFDEL
- . I $D(^DGPT(DGPTF,0)),$D(^DGPT(DGPTF,70)),+^DGPT(DGPTF,70)>2901000,$D(^DGP(45.83,"C",DGPTF)) D
- . . S DGPT0=^DGPT(DGPTF,0),DGRTY=$P(DGPT0,U,11)
- . . S DGQDT=$O(^DGP(45.83,"C",DGPTF,0))
- . . I DGQDT_".999999">DGDAT,DGRTY>0,DGRTY<3 S DGPT(DGPTF)=DGRTY_U_DGQDT
- Q ($D(DGPT)>0)
- ;
- REQPTF(DGPTFT,DGPTFC) ;Re-queue the PTF record for transmission
- ; Input
- ; DGPTFT - array of PTF record #'s to resend for a patient
- ; DGPTFC - count of re-queued PTF records
- ;
- ; Output
- ; DGPTFC - count of re-queued PTF records PTF^CENSUS
- ; (ex. DGPTFC=4^1)
- ;
- N DGPTF ;PTF record number
- N DGRTY ;PTF record type (1:PTF, 2:CENSUS)
- N DGDAT ;Date of queuing for previous transmission
- ;
- S DGPTF=0
- F S DGPTF=$O(DGPTFT(DGPTF)) Q:'DGPTF D
- . S DGRTY=+DGPTFT(DGPTF),DGDAT=$P(DGPTFT(DGPTF),U,2)
- . I $$UNREL(DGPTF,DGDAT) D RELEASE(DGPTF) S $P(DGPTFC,U,DGRTY)=$P(DGPTFC,U,DGRTY)+1
- Q
- ;
- UNREL(DGPTF,DGDT) ;Unrelease the PTF record - borrowed from OK^DGPTFDEL
- ;
- ; Input:
- ; DGPTF - PTF record number
- ; DGDT - Date of Previously Queued Transmission
- ;
- ; Output:
- ; function result 1:success, 0:failure
- ;
- N DA,DIK ;FileMan variables
- ;
- S DA(1)=DGDT
- I 'DA(1) Q 0
- S DIK="^DGP(45.83,"_DA(1)_",""P"",",DA=DGPTF D ^DIK
- Q 1
- ;
- RELEASE(DGPTF) ;Re-release the PTF record - borrowed from REL^DGPTFREL
- ;
- ; Input:
- ; DGPTF - PTF record number
- ;
- ; Output:
- ; none
- ;
- N DA,DIC,DIE,DINUM,DR,X ;FileMan variables
- ;
- ;if date entry doesn't exist then create new entry and "P" node
- I '$D(^DGP(45.83,DT,0)) D
- . S (DINUM,X)=DT,DIC="^DGP(45.83,",DIC(0)="L"
- . K DD,DO
- . D FILE^DICN
- . K DINUM,DIC
- I '($D(^DGP(45.83,DT,"P",0))#2) S ^DGP(45.83,DT,"P",0)="^45.831PA^0^0"
- ;if transmission date exists then clear it to allow re-transmission
- I $P(^DGP(45.83,DT,0),U,2) D
- . S DA=DT,DIE="^DGP(45.83,",DR="1///@"
- . D ^DIE
- . K DA,DIE,DR
- ;add the PTF record to the queue
- S (DINUM,X)=DGPTF,DIC(0)="L",DA(1)=DT,DIC="^DGP(45.83,"_DT_",""P"","
- D FILE^DICN
- K DA,DIC,DINUM
- ;update RELEASE DATE and RELEASED BY fields in PTF CLOSE OUT file.
- S DA=DGPTF,DIE="^DGP(45.84,",DR="4////"_DT_";5////"_DUZ
- D ^DIE
- K DA,DIE,DR
- Q
- ;
- NOTIFY(DGSTIME,DGTOT,DGPTFNUM,DGMESS) ;send job msg
- ;
- ; Input
- ; DGSTIME - job start date/time
- ; DGTOT - count of patients checked
- ; DGPTFNUM - count of PTF messages re-queued
- ; DGMESS - free text message array for task stop or errors passed
- ; by reference
- ;
- ; Output
- ; none
- ;
- N DIFROM,XMDUZ,XMSUB,XMTEXT,XMY,XMZ
- N DGSITE,DGETIME,DGTEXT,DGI
- S DGSITE=$$SITE^VASITE
- S DGETIME=$$NOW^XLFDT
- S XMDUZ="PTF Re-queue"
- S XMSUB="Patch DG*5.3*423 Mill Bill Co-Pay Enhancements"
- S XMTEXT="DGTEXT("
- S XMY(DUZ)=""
- S DGTEXT(1)=""
- S DGTEXT(2)=" Facility Name: "_$P(DGSITE,U,2)
- S DGTEXT(3)=" Station Number: "_$P(DGSITE,U,3)
- S DGTEXT(4)=""
- S DGTEXT(5)=" Date/Time job started: "_$$FMTE^XLFDT(DGSTIME)
- S DGTEXT(6)=" Date/Time job stopped: "_$$FMTE^XLFDT(DGETIME)
- S DGTEXT(7)=""
- I $G(DGMESS) D
- . F DGI=1:1:DGMESS D
- . . S DGTEXT(7+DGI)="*** "_$E($G(DGMESS(DGI)),1,65)
- I '$G(DGMESS) D
- . S DGTEXT(8)="PTF Message Re-queue Complete"
- . S DGTEXT(9)="Total Verified patients in file (#28.11): "_DGTOT
- . S DGTEXT(10)="Total PTF records re-queued: "_$P(DGPTFNUM,U,1)
- . S DGTEXT(11)="Total CENSUS records re-queued: "_$P(DGPTFNUM,U,2)
- D ^XMD
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDG53P423 8321 printed Feb 19, 2025@00:05:45 Page 2
- DG53P423 ;ALB/RPM - Pre/Post-Install;Nov 13, 2001 ; 1/16/02 3:33pm
- +1 ;;5.3;Registration;**423**;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 ;rebuild 'AST' index for file #28.11
- DO POST1
- +3 ;requeue Head and Neck Cancer PTF messages
- DO POST2
- +4 QUIT
- +5 ;
- +6 ;
- 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 ;Rebuild the "AST" index for file #28.11
- +1 NEW DIK,X
- +2 IF '$DATA(^DGNT(28.11,"AST"))
- Begin DoDot:1
- +3 DO BMES^XPDUTL(" Re-index of 'AST' cross reference not needed.")
- End DoDot:1
- QUIT
- +4 DO BMES^XPDUTL(" Please be patient while I re-index the 'AST' cross reference.")
- +5 KILL ^DGNT(28.11,"AST")
- +6 SET DIK="^DGNT(28.11,"
- SET DIK(1)=".03^AST"
- +7 DO ENALL^DIK
- +8 DO BMES^XPDUTL(" The NOSE AND THROAT RADIUM HISTORY file (#28.11) 'AST' x-ref re-indexed.")
- +9 QUIT
- +10 ;
- POST2 ;Set up TaskMan to re-queue PTF records in the background
- +1 NEW ZTDESC,ZTDTH,ZTIO,ZTQUEUED,ZTREQ,ZTRTN,ZTSAVE,ZTSK
- +2 SET ZTRTN="SCAN^DG53P423"
- +3 SET ZTDESC="Re-queue PTF records for DG*5.3*423"
- +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 run to requeue PTF records for DG*5.3*423 was not started.")
- +12 DO MES^XPDUTL("Re-run Post Install routine POST2^DG53P423.")
- End DoDot:2
- QUIT
- +13 DO MES^XPDUTL("Task "_ZTSK_" started to requeue PTF 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 Nose and Throat Radium History file (#28.11) for patients
- +1 ;who have a Screening Status of either 4:VERIFIED MILITARY MEDICAL
- +2 ;RECORD AND DIAGNOSIS or 5:VERIFIED SERVICE RECORD AND DIAGNOSIS.
- +3 ;Search the PTF records for any messages that would have
- +4 ;been transmitted to the NPCD after the verification date and re-queue
- +5 ;those messages.
- +6 ;
- +7 ;Job start date/time
- NEW DGSTART
- +8 ;count of verified patients
- NEW DGTOTCNT
- +9 ;count of re-queued PTF records
- NEW DGPTFCNT
- +10 ;free text message/line count passed to NOTIFY
- NEW DGMSG
- +11 ;NTR Status value
- NEW DGSTAT
- +12 ;IEN for NTR History file
- NEW DGIEN
- +13 ;generic index counter
- NEW DGX
- +14 ;array of NTR History file nodes
- NEW DGNT
- +15 ;temporary value of NTR verification date
- NEW DGDTTMP
- +16 ;IEN to PATIENT file (#2)
- NEW DGDFN
- +17 ;NTR verification date
- NEW DGDT
- +18 ;array of PTF records to re-queue
- NEW DGPTFARR
- +19 ;job control flag
- NEW DGQUIT
- +20 ;
- +21 SET DGSTART=$$NOW^XLFDT
- +22 SET (DGMSG,DGQUIT,DGTOTCNT)=0
- +23 SET DGPTFCNT="0^0"
- +24 ;delete task when finished
- SET ZTREQ="@"
- +25 LOCK +^DGP(45.83):3
- IF '$TEST
- Begin DoDot:1
- +26 SET DGMSG=2
- +27 SET DGMSG(1)="PTF Transmission Currently Running - Patch Re-queue Job Stopping"
- +28 SET DGMSG(2)="Re-run Post Install routine POST2^DG53P423."
- +29 DO NOTIFY(DGSTART,DGTOTCNT,DGPTFCNT,.DGMSG)
- End DoDot:1
- QUIT
- +30 SET DGDFN=0
- +31 FOR
- SET DGDFN=$ORDER(^DGNT(28.11,"APR",DGDFN))
- if 'DGDFN
- QUIT
- Begin DoDot:1
- +32 KILL DGPTFARR
- +33 SET DGIEN=$ORDER(^DGNT(28.11,"APR",DGDFN,1,0))
- +34 if 'DGIEN
- QUIT
- +35 SET DGDT=0
- +36 FOR DGX=0:1:2
- Begin DoDot:2
- +37 SET DGNT(DGX)=$GET(^DGNT(28.11,DGIEN,DGX))
- +38 ;get date field
- SET DGDTTMP=+$PIECE(DGNT(DGX),U,$SELECT(DGX=0:7,1:2))
- +39 IF DGDTTMP>DGDT
- SET DGDT=DGDTTMP
- End DoDot:2
- +40 if 'DGDT
- QUIT
- +41 ;only verified N/T
- if ".4.5."'[("."_$PIECE(DGNT(0),U,3)_".")
- QUIT
- +42 SET DGTOTCNT=DGTOTCNT+1
- +43 ;search for any PTF records that were xmit'ed and re-queue them
- +44 IF $$GETPTF(DGDFN,DGDT,.DGPTFARR)
- DO REQPTF(.DGPTFARR,.DGPTFCNT)
- +45 IF $$S^%ZTLOAD
- Begin DoDot:2
- +46 SET DGMSG=2
- +47 SET DGMSG(1)="Patch DG*5.3*423 PTF Re-queue Task Stopped by User"
- +48 SET DGMSG(2)="Re-run Post Install routine POST2^DG53P423."
- +49 SET (ZTSTOP,DGQUIT)=1
- End DoDot:2
- QUIT
- End DoDot:1
- if DGQUIT
- QUIT
- +50 LOCK -^DGP(45.83)
- +51 DO NOTIFY(DGSTART,DGTOTCNT,DGPTFCNT,.DGMSG)
- +52 QUIT
- +53 ;
- GETPTF(DFN,DGDAT,DGPT) ;Find PTF records transmitted after the verification
- +1 ; date. Build array subscripted by record numbers set equal to the
- +2 ; PTF record type.
- +3 ;
- +4 ; Input
- +5 ; DFN - IEN to PATIENT file (#2)
- +6 ; DGDAT - date of NTR verification
- +7 ; DGPT - array node passed by reference
- +8 ;
- +9 ; Output
- +10 ; DGPT - array of PTF record types and queue dates (1:PTF,2:CENSUS)
- +11 ; subscripted by PTF record # (ex. DGPT(1402)=2^3011212)
- +12 ; function result - 0 : no records found
- +13 ; 1 : records found
- +14 ;
- +15 ;PTF record number (file #45 IEN)
- NEW DGPTF
- +16 ;Date Queued
- NEW DGQDT
- +17 ;Record type
- NEW DGRTY
- +18 ;zero node of patient's PTF record
- NEW DGPT0
- +19 ;
- +20 IF '$DATA(^DGPT("B",DFN))
- QUIT 0
- +21 SET DGPTF=0
- +22 FOR
- SET DGPTF=$ORDER(^DGPT("B",DFN,DGPTF))
- if 'DGPTF
- QUIT
- Begin DoDot:1
- +23 ;borrowed from DIC("S") in DREL^DGPTFDEL
- +24 IF $DATA(^DGPT(DGPTF,0))
- IF $DATA(^DGPT(DGPTF,70))
- IF +^DGPT(DGPTF,70)>2901000
- IF $DATA(^DGP(45.83,"C",DGPTF))
- Begin DoDot:2
- +25 SET DGPT0=^DGPT(DGPTF,0)
- SET DGRTY=$PIECE(DGPT0,U,11)
- +26 SET DGQDT=$ORDER(^DGP(45.83,"C",DGPTF,0))
- +27 IF DGQDT_".999999">DGDAT
- IF DGRTY>0
- IF DGRTY<3
- SET DGPT(DGPTF)=DGRTY_U_DGQDT
- End DoDot:2
- End DoDot:1
- +28 QUIT ($DATA(DGPT)>0)
- +29 ;
- REQPTF(DGPTFT,DGPTFC) ;Re-queue the PTF record for transmission
- +1 ; Input
- +2 ; DGPTFT - array of PTF record #'s to resend for a patient
- +3 ; DGPTFC - count of re-queued PTF records
- +4 ;
- +5 ; Output
- +6 ; DGPTFC - count of re-queued PTF records PTF^CENSUS
- +7 ; (ex. DGPTFC=4^1)
- +8 ;
- +9 ;PTF record number
- NEW DGPTF
- +10 ;PTF record type (1:PTF, 2:CENSUS)
- NEW DGRTY
- +11 ;Date of queuing for previous transmission
- NEW DGDAT
- +12 ;
- +13 SET DGPTF=0
- +14 FOR
- SET DGPTF=$ORDER(DGPTFT(DGPTF))
- if 'DGPTF
- QUIT
- Begin DoDot:1
- +15 SET DGRTY=+DGPTFT(DGPTF)
- SET DGDAT=$PIECE(DGPTFT(DGPTF),U,2)
- +16 IF $$UNREL(DGPTF,DGDAT)
- DO RELEASE(DGPTF)
- SET $PIECE(DGPTFC,U,DGRTY)=$PIECE(DGPTFC,U,DGRTY)+1
- End DoDot:1
- +17 QUIT
- +18 ;
- UNREL(DGPTF,DGDT) ;Unrelease the PTF record - borrowed from OK^DGPTFDEL
- +1 ;
- +2 ; Input:
- +3 ; DGPTF - PTF record number
- +4 ; DGDT - Date of Previously Queued Transmission
- +5 ;
- +6 ; Output:
- +7 ; function result 1:success, 0:failure
- +8 ;
- +9 ;FileMan variables
- NEW DA,DIK
- +10 ;
- +11 SET DA(1)=DGDT
- +12 IF 'DA(1)
- QUIT 0
- +13 SET DIK="^DGP(45.83,"_DA(1)_",""P"","
- SET DA=DGPTF
- DO ^DIK
- +14 QUIT 1
- +15 ;
- RELEASE(DGPTF) ;Re-release the PTF record - borrowed from REL^DGPTFREL
- +1 ;
- +2 ; Input:
- +3 ; DGPTF - PTF record number
- +4 ;
- +5 ; Output:
- +6 ; none
- +7 ;
- +8 ;FileMan variables
- NEW DA,DIC,DIE,DINUM,DR,X
- +9 ;
- +10 ;if date entry doesn't exist then create new entry and "P" node
- +11 IF '$DATA(^DGP(45.83,DT,0))
- Begin DoDot:1
- +12 SET (DINUM,X)=DT
- SET DIC="^DGP(45.83,"
- SET DIC(0)="L"
- +13 KILL DD,DO
- +14 DO FILE^DICN
- +15 KILL DINUM,DIC
- End DoDot:1
- +16 IF '($DATA(^DGP(45.83,DT,"P",0))#2)
- SET ^DGP(45.83,DT,"P",0)="^45.831PA^0^0"
- +17 ;if transmission date exists then clear it to allow re-transmission
- +18 IF $PIECE(^DGP(45.83,DT,0),U,2)
- Begin DoDot:1
- +19 SET DA=DT
- SET DIE="^DGP(45.83,"
- SET DR="1///@"
- +20 DO ^DIE
- +21 KILL DA,DIE,DR
- End DoDot:1
- +22 ;add the PTF record to the queue
- +23 SET (DINUM,X)=DGPTF
- SET DIC(0)="L"
- SET DA(1)=DT
- SET DIC="^DGP(45.83,"_DT_",""P"","
- +24 DO FILE^DICN
- +25 KILL DA,DIC,DINUM
- +26 ;update RELEASE DATE and RELEASED BY fields in PTF CLOSE OUT file.
- +27 SET DA=DGPTF
- SET DIE="^DGP(45.84,"
- SET DR="4////"_DT_";5////"_DUZ
- +28 DO ^DIE
- +29 KILL DA,DIE,DR
- +30 QUIT
- +31 ;
- NOTIFY(DGSTIME,DGTOT,DGPTFNUM,DGMESS) ;send job msg
- +1 ;
- +2 ; Input
- +3 ; DGSTIME - job start date/time
- +4 ; DGTOT - count of patients checked
- +5 ; DGPTFNUM - count of PTF messages re-queued
- +6 ; DGMESS - free text message array for task stop or errors passed
- +7 ; by reference
- +8 ;
- +9 ; Output
- +10 ; none
- +11 ;
- +12 NEW DIFROM,XMDUZ,XMSUB,XMTEXT,XMY,XMZ
- +13 NEW DGSITE,DGETIME,DGTEXT,DGI
- +14 SET DGSITE=$$SITE^VASITE
- +15 SET DGETIME=$$NOW^XLFDT
- +16 SET XMDUZ="PTF Re-queue"
- +17 SET XMSUB="Patch DG*5.3*423 Mill Bill Co-Pay Enhancements"
- +18 SET XMTEXT="DGTEXT("
- +19 SET XMY(DUZ)=""
- +20 SET DGTEXT(1)=""
- +21 SET DGTEXT(2)=" Facility Name: "_$PIECE(DGSITE,U,2)
- +22 SET DGTEXT(3)=" Station Number: "_$PIECE(DGSITE,U,3)
- +23 SET DGTEXT(4)=""
- +24 SET DGTEXT(5)=" Date/Time job started: "_$$FMTE^XLFDT(DGSTIME)
- +25 SET DGTEXT(6)=" Date/Time job stopped: "_$$FMTE^XLFDT(DGETIME)
- +26 SET DGTEXT(7)=""
- +27 IF $GET(DGMESS)
- Begin DoDot:1
- +28 FOR DGI=1:1:DGMESS
- Begin DoDot:2
- +29 SET DGTEXT(7+DGI)="*** "_$EXTRACT($GET(DGMESS(DGI)),1,65)
- End DoDot:2
- End DoDot:1
- +30 IF '$GET(DGMESS)
- Begin DoDot:1
- +31 SET DGTEXT(8)="PTF Message Re-queue Complete"
- +32 SET DGTEXT(9)="Total Verified patients in file (#28.11): "_DGTOT
- +33 SET DGTEXT(10)="Total PTF records re-queued: "_$PIECE(DGPTFNUM,U,1)
- +34 SET DGTEXT(11)="Total CENSUS records re-queued: "_$PIECE(DGPTFNUM,U,2)
- End DoDot:1
- +35 DO ^XMD
- +36 QUIT