source: WorldVistAEHR/trunk/r/ENROLLMENT_APPLICATION_SYSTEM-EAS/EASEZU4.m@ 1211

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

initial load of WorldVistAEHR

File size: 4.8 KB
RevLine 
[613]1EASEZU4 ;ALB/jap - Utilities for 1010EZ Processing ;10/25/00 08:08
2 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**51**;Mar 15, 2001
3 ;
4PRT1010 ;print 10-10EZ form with data
5 ;
6 N TASK,REVDATE,PRTDATE,ACTION,DIR
7 S ACTION="'Print 10-10EZ'"
8 ;no action if closed
9 I EASPSTAT="CLS" D NOACT^EASEZLM("Inactivated",ACTION) Q
10 ;don't print if not at least reviewed
11 S REVDATE=$P($G(^EAS(712,EASAPP,2)),U,1)
12 I 'REVDATE D NOACT^EASEZLM("Unreviewed",ACTION) Q
13 ;just in case
14 I EASPSTAT="NEW" D NOACT^EASEZLM("New",ACTION) Q
15 ;call to Steve's routine to print 10-10EZ
16 D FULL^VALM1
17 S TASK=$$QUE^EASEZPF(EASAPP,EASDFN)
18 ;should return Task # if actually queued to print
19 ;if printed, update processing status if necessary; can be printed multiple times
20 S PRTDATE=$P(^EAS(712,EASAPP,2),U,3)
21 I 'PRTDATE,$G(TASK) D
22 .D SETDATE^EASEZU2(EASAPP,"PRT") S EASPSTAT="PRT"
23 .;rebuild selection list since this application is removed from list
24 .D BLD^EASEZLM,HDR2^EASEZL1
25 S VALMBCK="R"
26 D PAUSE^VALM1
27 Q
28 ;
29VERSIG ;verify Applicant signature on 10-10EZ
30 ;
31 N REVDATE,ACTION,DIR
32 S ACTION="'Verify Signature'"
33 ;no action if closed
34 I EASPSTAT="CLS" D NOACT^EASEZLM("Inactivated",ACTION) Q
35 ;can't verify sig if not at least reviewed
36 S REVDATE=$P($G(^EAS(712,EASAPP,2)),U,1)
37 I 'REVDATE D NOACT^EASEZLM("Unreviewed",ACTION) Q
38 ;can't sign if already done
39 I EASPSTAT="SIG" D NOACT^EASEZLM("Previously Signed",ACTION) Q
40 ;just in case
41 I EASPSTAT="NEW" D NOACT^EASEZLM("New",ACTION) Q
42 I EASPSTAT="FIL" D NOACT^EASEZLM("Filed",ACTION) Q
43 ;update processing status
44 D SETDATE^EASEZU2(EASAPP,"SIG")
45 S EASPSTAT="SIG"
46 W !,"Applicant signature is verified...",!
47 ;rebuild selection list since this application is removed from list
48 D BLD^EASEZLM,HDR2^EASEZL1
49 S VALMBCK="Q"
50 D PAUSE^VALM1
51 Q
52 ;
53FILE ;file 10-10EZ 'accepted' data to VistA Patient database
54 ;
55 N SIGDATE,ACTION,SAVE,ZTSK,STAT,DIR
56 S ACTION="'File 10-10EZ'"
57 ;no action if closed
58 I EASPSTAT="CLS" D NOACT^EASEZLM("Inactivated",ACTION) Q
59 ;must be signed before filing
60 S SIGDATE=$P($G(^EAS(712,EASAPP,1)),U,1)
61 I 'SIGDATE D NOACT^EASEZLM("Unsigned",ACTION) Q
62 ;can't repeat filing
63 I EASPSTAT="FIL" D NOACT^EASEZLM("Previously Filed",ACTION) Q
64 S STAT=$$CURRSTAT^EASEZU2(EASAPP) I STAT="FIL" D NOACT^EASEZLM("Previously Filed",ACTION) Q
65 ;just in case
66 I EASPSTAT="NEW" D NOACT^EASEZLM("New",ACTION) Q
67 I EASPSTAT="REV" D NOACT^EASEZLM("Unsigned",ACTION) Q
68 I EASPSTAT="PRT" D NOACT^EASEZLM("Unsigned",ACTION) Q
69 ;
70 D FILE2
71 ;rebuild selection list since this application is removed from list
72 S VALMBCK="R"
73 I $D(ZTSK) D
74 .D SETDATE^EASEZU2(EASAPP,"FIL")
75 .S EASPSTAT="FIL"
76 .S $P(^EAS(712,EASAPP,2),U,11)=ZTSK
77 .D BLD^EASEZLM S VALMBCK="Q"
78 Q
79 ;
80CLOSE ;close/inactivate the Application
81 ;
82 N SIGDATE,FILDATE,ACTION
83 S ACTION="'Inactivate'"
84 ;not allowed if signed or filed
85 S FILDATE=$P($G(^EAS(712,EASAPP,2)),U,5)
86 I FILDATE D NOACT^EASEZLM("Filed",ACTION) Q
87 S SIGDATE=$P($G(^EAS(712,EASAPP,1)),U,1)
88 I SIGDATE D NOACT^EASEZLM("Signed",ACTION) Q
89 ;no action if already closed
90 I EASPSTAT="CLS" D NOACT^EASEZLM("Previously Inactivated",ACTION) Q
91 ;clear accept flags and updates
92 D OKRESET^EASEZU3
93 ;update processing status
94 D SETDATE^EASEZU2(EASAPP,"CLS")
95 S EASPSTAT="CLS"
96 W !,"Application has been closed/inactivated...",!
97 D PAUSE^VALM1
98 ;rebuild selection list since this application is removed from list
99 D BLD^EASEZLM
100 S VALMBCK="Q"
101 Q
102 ;
103FILE2 ;
104 N VALMDDF,ZTSAVE,ZTDESC,ZTRTN,ZTIO
105 K ZTSAVE
106 S ZTDESC="Filing 10-10EZ Data (Appl. #"_EASAPP_") to VistA",ZTRTN="QUE^EASEZFM",ZTIO=""
107 S ZTSAVE("EASAPP")=""
108 D ^%ZTLOAD
109 I $D(ZTSK) D
110 .;update processing status
111 .W !,"10-10EZ data is being filed as a background job."
112 .W !,"Task #: ",ZTSK,!
113 .K DIR D PAUSE^VALM1
114 Q
115 ;
116SUPPRESS(EASAPP,DATAKEY,TYPE,VERSION) ;alb/cmf/51
117 ;return 1 if node should not be displayed, filed, or accepted
118 ;easapp = file 712 ien
119 ;datakey = file 711/.1
120 ;type = 0:display[default], 1:file, 2:accept
121 N FLAG
122 Q:$G(EASAPP)="" 0
123 Q:$G(DATAKEY)="" 0
124 S:$G(VERSION)="" VERSION=$$VERSION(EASAPP)
125 Q:+VERSION<6 0
126 S FLAG=0
127 S TYPE=$S($G(TYPE)=1:1,$G(TYPE)=2:2,1:0)
128 I TYPE=0 D Q FLAG
129 .I "^I;18A.^I;18B.^I;18C.^I;18D.^"[DATAKEY S FLAG=1 Q ;obs
130 .I "^IIC;1.1^IIC;1.2^IIC;1.3^"[DATAKEY S FLAG=1 Q ;obs
131 .I "^I;1A.5^IIC;3.^I;14D1.^I;17.^"[DATAKEY S FLAG=1 Q ;obs
132 .I "^I;14C.^I;14D.^I;14D2.^I;14H.^"[DATAKEY S FLAG=1 Q ;obs
133 .I "^IIE;1.^IIE;2.^IIE;3.^"[DATAKEY S FLAG=1 Q ;print only
134 .Q
135 I TYPE=1 D Q FLAG
136 .I "^I;14D.^I;14D1.^I;14D2.^"[DATAKEY S FLAG=1 Q ;obs
137 .I "^IIC;1.1^IIC;1.2^IIC;1.3^"[DATAKEY S FLAG=1 Q ;obs
138 .I "^IIE;1.^IIE;2.^IIE;3.^"[DATAKEY S FLAG=1 Q ;print only
139 .I "^IIC;1.6^IIC;2.3^IIC;3.3^"[DATAKEY S FLAG=1 Q ;disp only
140 .Q
141 ;
142 Q FLAG
143 ;
144VERSION(EASAPP) ;alb/cmf/51
145 ;return the version # of an application
146 Q:$G(EASAPP)="" -1
147 Q:'$D(^EAS(712,EASAPP)) -1
148 Q +$P(^EAS(712,EASAPP,0),U,12)
149 ;
Note: See TracBrowser for help on using the repository browser.