source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SD53459A.m@ 1703

Last change on this file since 1703 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.9 KB
RevLine 
[613]1SD53459A ;ALB/MRY - Pre/Post-Install; 9/29/05
2 ;;5.3;Scheduling;**459**;Aug 13, 1993
3 ;
4 Q
5 ;
6POST ;Set up TaskMan to re-queue AmbCare records in the background
7 N ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSK
8 S ZTRTN="SCAN^SD53459A"
9 S ZTDESC="Re-queue AmbCare records for SD*5.3*459"
10 ;Queue Task to start in 60 seconds
11 S ZTDTH=$$SCH^XLFDT("60S",$$NOW^XLFDT)
12 S ZTIO=""
13 D ^%ZTLOAD
14 D BMES^XPDUTL("*****")
15 D
16 . I $D(ZTSK)[0 D Q
17 . . D MES^XPDUTL("TaskMan task to requeue AmbCare records for SD*5.3*459 did not start.")
18 . . D MES^XPDUTL("Re-run post-install routine POST^SD53459A.")
19 . D MES^XPDUTL("Task "_ZTSK_" started to re-queue AmbCare records.")
20 . I $D(ZTSK("D")) D
21 . . D MES^XPDUTL("Task will start at "_$$HTE^XLFDT(ZTSK("D")))
22 D MES^XPDUTL("*****")
23 Q
24 ;
25SCAN ;Scan the TRANSMITTED OUTPATIENT ENCOUNTER file (#409.73) for records
26 ;transmitted after the Katrina hurricanne. Use $$FINDXMIT^SCDXFU01
27 ;to find last corresponding entry in TRANSMITTED OUTPATIENT ENCOUNTER
28 ;file (#409.73).
29 ;
30 N SDTIEN ;Transmitted Outpatient Encounter file pointer
31 N SDENCPTR ;Outpatient Encounter file pointer
32 N SDREQUE ;Count of messages re-queued
33 N SDSTART ;start date/time
34 N SDXMITDT ;Xmit to NPCD counter
35 N SDERIDT ;Hurricane Katrina date
36 N DFN ;IEN to PATIENT file (#2)
37 N SDNAM ;Patient's name
38 N SDSSN ;Patient's ssn(last 4)
39 ;
40 K ^TMP("SD53459A",$J),^TMP("SD53459",$J)
41 S SDERIDT=3050826
42 S SDSTART=$$NOW^XLFDT
43 S SDREQUE=0
44 S SDXMITDT=SDERIDT-.00001
45 F S SDXMITDT=$O(^SD(409.73,"AACLST",SDXMITDT)) Q:'SDXMITDT D
46 . S SDTIEN=0
47 . F S SDTIEN=$O(^SD(409.73,"AACLST",SDXMITDT,SDTIEN)) Q:'SDTIEN D
48 . . S SDENCPTR=$P($G(^SD(409.73,SDTIEN,0)),U,2)
49 . . Q:'SDENCPTR
50 . . S DFN=$P($G(^SCE(SDENCPTR,0)),U,2)
51 . . Q:($$EMGRES^DGUTL(DFN)'="K")
52 . . S ^TMP("SD53459",$J,DFN)=SDTIEN ;build last transmitted ien
53 . . D DEM^VADPT
54 . . S SDNAM=$S($D(VADM(1)):VADM(1),1:" ")
55 . . S SDSSN=$S($D(VADM(2)):$P($P(VADM(2),"^",2),"-",3),1:" ")
56 . . S ^TMP("SD53459",$J,0,SDNAM,SDSSN,DFN)=$P($G(^SD(409.73,SDTIEN,0)),U)
57 . . ;locate last transmitted message
58 . . ;S SDTIEN=$$FINDXMIT^SCDXFU01(SDENCPTR)
59 . . ;Q:'SDTIEN
60 ;locate last transmitted message
61 S DFN=0
62 F S DFN=$O(^TMP("SD53459",$J,DFN)) Q:'DFN D
63 . S SDTIEN=^TMP("SD53459",$J,DFN)
64 . ;store event information
65 . D STREEVNT^SCDXFU01(SDTIEN,0)
66 . ;set transmission flag to 'YES'
67 . D XMITFLAG^SCDXFU01(SDTIEN)
68 . S SDREQUE=SDREQUE+1
69 ;send completion MailMan message
70 D NOTIFY(SDSTART,SDREQUE)
71 ;delete the task entry
72 S ZTREQ="@"
73 Q
74 ;
75NOTIFY(SDSTIME,SDREQ) ;send job completion msg
76 ;
77 ; Input
78 ; SDSTIME - job start date/time
79 ; SDREQ - count of AmbCare messages re-queued
80 ;
81 ; Output
82 ; none
83 ;
84 N DIFROM,XMDUZ,XMSUB,XMTEXT,XMY,XMZ
85 N SDSITE,SDETIME,SDTEXT,LINECT
86 S SDSITE=$$SITE^VASITE
87 S SDETIME=$$NOW^XLFDT
88 S XMDUZ="AmbCare Re-queue"
89 S XMSUB="Patch SD*5.3*459 Hurricane Katrina ERI (ACRP)"
90 S XMTEXT="^TMP(""SD53459A"",$J,"
91 S XMY(DUZ)=""
92 S XMY("AACVHANPCDERInotification@mail.va.gov")=""
93 S XMY("YORTY,M ROBERT@FORUM.VA.GOV")=""
94 S ^TMP("SD53459A",$J,1)=""
95 S ^TMP("SD53459A",$J,2)=" Facility Name: "_$P(SDSITE,U,2)
96 S ^TMP("SD53459A",$J,3)=" Station Number: "_$P(SDSITE,U,3)
97 S ^TMP("SD53459A",$J,4)=""
98 S ^TMP("SD53459A",$J,5)=" Date/Time job started: "_$$FMTE^XLFDT(SDSTIME)
99 S ^TMP("SD53459A",$J,6)=" Date/Time job stopped: "_$$FMTE^XLFDT(SDETIME)
100 S ^TMP("SD53459A",$J,7)=""
101 S ^TMP("SD53459A",$J,9)="Total AmbCare records re-queued : "_SDREQ
102 S ^TMP("SD53459A",$J,10)="Please Note: There is no user intervention required with the re-transmission"
103 S ^TMP("SD53459A",$J,11)="of the AmbCare records. They will be retransmitted via the nightly"
104 S ^TMP("SD53459A",$J,12)="background job that is scheduled at your site."
105 S ^TMP("SD53459A",$J,13)=""
106 S ^TMP("SD53459A",$J,14)="After the re-transmission is complete you may receive a Late ACRP Related"
107 S ^TMP("SD53459A",$J,15)="Activity Mailman message, if encounters occurred after the National"
108 S ^TMP("SD53459A",$J,16)="Patient Care Database was closed for yearly workload credit. Please"
109 S ^TMP("SD53459A",$J,17)="ignore/delete these messages, the records will still be retransmitted to AAC."
110 I SDREQ D
111 . Q ;don't list names
112 . S ^TMP("SD53459A",$J,18)=""
113 . S ^TMP("SD53459A",$J,19)="List of Transmitted Outpatient Encounters re-queued with a 'Katrina' indicator."
114 . S ^TMP("SD53459A",$J,20)=" #409.73"
115 . S ^TMP("SD53459A",$J,21)="SSN(L4) Number Patient"
116 . S ^TMP("SD53459A",$J,22)="-----------------------------------"
117 . S LINECT=23
118 . S SDNAM="" F S SDNAM=$O(^TMP("SD53459",$J,0,SDNAM)) Q:SDNAM="" D
119 . . S SDSSN="" F S SDSSN=$O(^TMP("SD53459",$J,0,SDNAM,SDSSN)) Q:SDSSN="" D
120 . . . S DFN="" F S DFN=$O(^TMP("SD53459",$J,0,SDNAM,SDSSN,DFN)) Q:DFN="" D
121 . . . . S SDTIEN=$G(^TMP("SD53459",$J,0,SDNAM,SDSSN,DFN))
122 . . . . S ^TMP("SD53459A",$J,LINECT+1)=SDSSN_" "_SDTIEN_" "_SDNAM
123 . . . . S LINECT=LINECT+1
124 D ^XMD K ^TMP("SD53459A",$J),^TMP("SD53459",$J),XMY,VADM
125 Q
Note: See TracBrowser for help on using the repository browser.