source: WorldVistAEHR/trunk/r/ENROLLMENT_APPLICATION_SYSTEM-EAS/EAS122PT.m@ 1006

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

initial load of WorldVistAEHR

File size: 4.2 KB
Line 
1EAS122PT ; ALB/SCK - POST INSTALL CLEANUP PATCH EAS*1*22 ; 12/13/2002
2 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**22**;MAR 15,2001
3 ;
4QUE ; Queued entry point for post install processing
5 N ZTRTN,ZTDESC,ZTSAVE,ZTSK,ZTIO
6 ;
7 S ZTRTN="EN^EAS122PT"
8 S ZTDESC="PATCH EAS*1*22 POST INSTALL"
9 S XMDUZ="EAS MT LETTERS"
10 S ZTSAVE("DUZ")=""
11 S ZTIO=""
12 ;
13 D ^%ZTLOAD
14 I $D(ZTSK)'>0 D BMES^XPDUTL("Post-Install was not tasked off")
15 E D BMES^XPDUTL("Post-Install tasked: ["_$G(ZTSK)_"]")
16 D HOME^%ZIS
17 Q
18 ;
19EN ; Main entry point for post install processing
20 K ^TMP("EAS22",$J),^TMP("EAS22A",$J)
21 D POST
22 D MAIL1
23 D MAIL2
24 K ^TMP("EAS22",$J),^TMP("EAS22A",$J)
25 Q
26 ;
27POST ; Process files and generate cleanup list
28 N DGIEN,DIK,DA,CNT,DFN,VA,EASMTDT
29 ;
30 ; Process EAS MT LETTER STATUS File, (#713.2)
31 S DGIEN=0
32 F S DGIEN=$O(^EAS(713.2,"C",-1,DGIEN)) Q:'DGIEN D
33 . S ^TMP("EAS22",$J,DGIEN)=$P($G(^EAS(713.2,DGIEN,0)),U,1)
34 . I $D(^EAS(713.2,DGIEN)) D ; if data entry exists, delete it
35 . . S DIK="^EAS(713.2,",DA=DGIEN
36 . . D ^DIK
37 . E D ; if no data entry, only xref, kill off the xref
38 . . K ^EAS(713.2,"C",-1,DGIEN)
39 ;
40 I $$S^%ZTLOAD D Q ; Check for stop request
41 . S ^TMP("EAS22",$J,0)="STOP"
42 ;
43POST2 ;Process EAS MT PATIENT STATUS File (#713.1)
44 S DGIEN=0,CNT=1
45 F S DGIEN=$O(^EAS(713.1,DGIEN)) Q:'DGIEN D Q:$D(^TMP("EAS22",$J,0))
46 . S CNT=CNT+1 I (CNT#100)=0,$$S^ZTLOAD D Q ; Check for stop request
47 . . S ^TMP("EAS22",$J,0)="STOP"
48 . Q:$D(^EAS(713.1,"AP",1,DGIEN))
49 . I '$D(^EAS(713.2,"C",DGIEN)) D
50 . . S DFN=$P($G(^EAS(713.1,DGIEN,0)),U,1)
51 . . D PID^VADPT
52 . . S EASMTDT=$$LST^DGMTU(DFN)
53 . . I +EASMTDT>0 S EASMTDT=$$FMTE^XLFDT($P(EASMTDT,U,2))
54 . . I DFN>0 S ^TMP("EAS22A",$J,DGIEN)=$$GET1^DIQ(2,DFN,.01)_" ("_VA("BID")_")"_" "_EASMTDT
55 Q
56 ;
57MAIL1 ; Generate mail message with number of removed entries
58 N XMY,XMSUB,XMTEXT,XMDUZ,MSG,DGIEN,DGDT,DGPRCDT,X
59 ;
60 S XMSUB="Post Install - EAS*1*22"
61 S XMY("G.EAS MTLETTERS")=""
62 S XMY("DUZ")=""
63 S XMDUZ="PATCH EAS-1-22"
64 ;
65 S DGIEN=0
66 F S DGIEN=$O(^TMP("EAS22",$J,DGIEN)) Q:'DGIEN D
67 . Q:^TMP("EAS22",$J,DGIEN)'>0 ; Check for valid date value for DGRPCDT
68 . S DGPRCDT(^TMP("EAS22",$J,DGIEN))=$G(DGPRCDT(^TMP("EAS22",$J,DGIEN)))+1
69 ;
70 S MSG(.1)="Entries were removed from the EAS MT LETTER STATUS File (#713.2)"
71 S MSG(.2)="which did not have a valid pointer to the EAS MT PATIENT STATUS"
72 S MSG(.3)="File (#713.1). The entries removed were for the processing dates"
73 S MSG(.4)="listed below. This is provided as information only."
74 S MSG(.5)=""
75 S X=$$SETSTR^VALM1("Date Processed","",5,18)
76 S X=$$SETSTR^VALM1("Records Removed",X,25,18)
77 S MSG(.6)=X
78 S DGDT=0
79 F S DGDT=$O(DGPRCDT(DGDT)) Q:'DGDT D
80 . S X=$$SETSTR^VALM1($$FMTE^XLFDT(DGDT,"2D"),"",5,18)
81 . S X=$$SETSTR^VALM1(+$G(DGPRCDT(DGDT)),X,25,18)
82 . S MSG(DGDT)=X
83 S XMTEXT="MSG("
84 D ^XMD
85 Q
86 ;
87MAIL2 ; Generate file cross-check message on patient names
88 N XMY,XMSUB,XMTEXT,XMDUZ,MSG,DGIEN,DGDT
89 ;
90 S XMSUB="Post Install - EAS*1*22"
91 S XMY("G.EAS MTLETTERS")=""
92 S XMY("DUZ")=""
93 S XMDUZ="PATCH EAS-1-22"
94 ;
95 S ^TMP("EAS22A",$J,.1)="The following patients in the EAS MT PATIENT STATUS File (#713.1)"
96 S ^TMP("EAS22A",$J,.2)="do not have a corresponding entry in the EAS MT LETTER STATUS File (#713.2)."
97 S ^TMP("EAS22A",$J,.3)="You can try re-generating the Means Test Letter dates for these"
98 S ^TMP("EAS22A",$J,.4)="patients by running the REGEN procedure from the post-install"
99 S ^TMP("EAS22A",$J,.5)="routine by entering 'D REGEN^EAS122PT' at the programmer prompt."
100 S ^TMP("EAS22A",$J,.6)="See the Patch Instructions for more details."
101 S ^TMP("EAS22A",$J,.7)=""
102 S XMTEXT="^TMP(""EAS22A"",$J,"
103 D ^XMD
104 Q
105 ;
106REGEN ;
107 N DGIEN,MTLST,MTDT,DFN,CNT,EASDT,EADT,DIR,Y
108 ;
109 S DIR(0)="YAO",DIR("B")="NO"
110 S DIR("A",1)="Re-generate Means Test Letter Dates for patients"
111 S DIR("A")="identified in patch EAS*1*22 cleanup? "
112 D ^DIR K DIR
113 Q:'Y
114 ;
115 K ^TMP("EAS22A",$J)
116 D POST2
117 ;
118 S EADT=$$DT^XLFDT
119 S DGIEN=0
120 F S DGIEN=$O(^TMP("EAS22A",$J,DGIEN)) Q:'DGIEN D
121 . S DFN=$P($G(^EAS(713.1,DGIEN,0)),U,1)
122 . S MTLST=$$LST^DGMTU(DFN)
123 . S MTDT=$P(MTLST,U,2)
124 . Q:'$G(MTDT)
125 . S EASDT("ANV")=$$FMADD^XLFDT(MTDT)
126 . S EASDT("60")=$$FMADD^XLFDT(EASDT("ANV"),305)
127 . S EASDT("30")=$$FMADD^XLFDT(EASDT("ANV"),335)
128 . S EASDT("0")=$$FMADD^XLFDT(EASDT("ANV"),365)
129 . I $$NEWLTR^EASMTL2(DGIEN,.EASDT)
130 K ^TMP("EAS22A",$J)
131 Q
Note: See TracBrowser for help on using the repository browser.