source: WorldVistAEHR/trunk/r/ENROLLMENT_APPLICATION_SYSTEM-EAS/EAS150P1.m@ 691

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

initial load of WorldVistAEHR

File size: 3.8 KB
Line 
1EAS150P1 ;ALB/SCK - PATCH EAS-50 POST UTILITIES ; 28-APR-2004
2 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**50,55**;Mar 15, 2004
3 ;
4 Q
5QUE ;
6 N EACY,%I,Y,DIR,DIRUT
7 ;
8 D NOW^%DTC S Y=%I(3) D DD^%DT S EACY=Y
9 W !!
10 S DIR(0)="F",DIR("B")=EACY,DIR("A")="Print UE Status Report for Calendar Year"
11 S DIR("?",1)=""
12 S DIR("?",2)="This report will display the User Enrollee Status information for all"
13 S DIR("?",3)="patients with a Means Test Letter pending in the selected Calendar Year."
14 S DIR("?")="Enter ""ALL"" for all entries."
15 D ^DIR K DIR
16 Q:$D(DIRUT)
17 I +Y>0!(Y="ALL") S EACY=Y
18 E Q
19 ;
20 S ZTSAVE("DUZ")="",ZTSAVE("EACY")=""
21 D EN^XUTMDEVQ("EN^EAS150P1","EAS UE STATUS REPORT",.ZTSAVE)
22 ;
23 Q
24 ;
25EN ; Entry point for UE Status report
26 N EALIEN,EACNT,EAX,EADFN,EADFN1,EANAME,EAPTR,EAS60
27 ;
28 K ^TMP("EASUES",$J)
29 K ^TMP("SCK",$J)
30 F EAX=0,1,2 S EACNT(EAX)=0
31 S EALIEN=0
32 F S EALIEN=$O(^EAS(713.2,EALIEN)) Q:'EALIEN D
33 . Q:$D(^EAS(713.2,"AC",1,EALIEN)) ; Quit if MT has been returned
34 . S EAPTR=$$GET1^DIQ(713.2,EALIEN,2,"I") ; Get pointer to file #713.1
35 . Q:$D(^EAS(713.1,"AP",1,EAPTR)) ; Quit if Prohibit Flag is set for patch
36 . ; If EACY is not "ALL" then check Calendar year for 60 day letter.
37 . ; Quit if letter date is not in the selected CY
38 . S EAS60=$$GET1^DIQ(713.2,EALIEN,8,"I")
39 . S Y=$E(EAS60,1,3) D DD^%DT S EAS60=Y
40 . I +EACY>0 Q:EAS60'=EACY
41 . Q:$$DECEASED^EASMTUTL(EALIEN) ; Quit if patient is deceased
42 . S EADFN1=$$GET1^DIQ(713.2,EALIEN,2,"I")
43 . S EADFN=$$GET1^DIQ(713.1,EADFN1,.01,"I")
44 . S EANAME=$$GET1^DIQ(2,EADFN,.01)
45 . S ^TMP("EASUES",$J,$S(EANAME]"":EANAME,1:"UNKNOWN"),EADFN)=EALIEN_U_EAS60
46 D REPORT
47 Q
48 ;
49REPORT ;
50 N EANAME,EADFN,PAGE,EASABRT
51 ;
52 S (EASABRT,PAGE)=0
53 D HDR
54 ;
55 S EANAME=""
56 F S EANAME=$O(^TMP("EASUES",$J,EANAME)) Q:EANAME']"" D Q:$G(EASABRT)
57 . S EADFN=0
58 . F S EADFN=$O(^TMP("EASUES",$J,EANAME,EADFN)) Q:'EADFN D
59 . . D LINE(EANAME,EADFN,$P($G(^TMP("EASUES",$J,EANAME,EADFN)),U,2))
60 . . I ($Y+6)>IOSL D HDR Q:$G(EASABRT)
61 ;
62 I '$G(EASABRT) D
63 . N XX F XX=$Y:1:IOSL-6 W !
64 . D FTR
65 Q:$G(EASABRT)
66 I $E(IOST,1,2)="C-" D Q:$D(DIRUT)!('Y)
67 . S DIR(0)="E" D ^DIR K DIR
68 D SUMMARY
69 ;
70 Q
71 ;
72LINE(EANAME,DFN,EAS60) ;
73 N EAUES,VA
74 ;
75 S EAUES=$$UESTAT^EASUER(DFN)
76 S EACNT(EAUES)=EACNT(EAUES)+1
77 D PID^VADPT6
78 W !,$E(EANAME,1,25),?28,VA("BID")
79 W ?35,$$GET1^DIQ(2,EADFN,.3617)
80 W ?42,$S(EAUES=1:"UE",EAUES=0:"Not UE",EAUES=2:"Diff. Site",1:"")
81 W ?54,$E($$GET1^DIQ(2,EADFN,.3618),1,18),?74,EAS60
82 Q
83 ;
84SUMMARY ;
85 N DDASH
86 ;
87 W @IOF
88 W !,"User Enrollee Status Summary for Pending Means Test Letters"
89 W !,"Print Date: ",$$FMTE^XLFDT(DT)
90 S $P(DDASH,"=",IOM)="" W !,DDASH,!
91 W !?4,"Patients with User Enrollee Status at this site: ",$FN(EACNT(1),",")
92 W !!?4,"Patients which DO NOT have User Enrollee Status at this site: ",$FN(EACNT(2),",")
93 W !!?4,"Patients which do not have User Enrollee Status: ",$FN(EACNT(0),",")
94 W !!?4,"Total Patients Reviewed: ",$FN(EACNT(0)+EACNT(1)+EACNT(2),",")
95 Q
96 ;
97HDR ;
98 N DDASH,EASITE,EAPRNT
99 ;
100 I PAGE>0,$E(IOST,1,2)="C-" D Q:$G(EASABRT)
101 . S DIR(0)="E"
102 . D ^DIR K DIR
103 . I 'Y S EASABRT=1
104 ;
105 S EASITE=$$SITE^VASITE,EAPRNT=$$PSITE^EASUER($P(EASITE,U,3))
106 W @IOF
107 S PAGE=PAGE+1
108 W !,"User Enrollee Status for Pending Means Test Letters"
109 W !,"Calendar Year for MT Letters to Print: ",EACY
110 W !,"Print Date: ",$$FMTE^XLFDT(DT)
111 W !,"Page: ",PAGE
112 W !!,"Current Site: ",$P(EASITE,U,2)," Current Station#: ",$P(EASITE,U,3)
113 W !,"Administrative Parent for ",$P(EASITE,U,2)," is ",$$GET1^DIQ(4,EAPRNT,.01)
114 W !!,"Name",?28,"LAST4",?35,"UE-FY",?42,"UE Status",?54,"UE Site",?74,"LT-CY"
115 ;
116 S $P(DDASH,"=",IOM)="" W !,DDASH
117 W !
118 Q
119 ;
120FTR ;
121 I $E(IOST,1,2)'="C-" D
122 . W !?5,"UE -User Enrollee Status at Site "
123 . W !?5,"Not UE -User is not a User Enrollee"
124 . W !?5,"Diff. Site -User Enrollee Status, but at Another Site."
125 Q
Note: See TracBrowser for help on using the repository browser.