source: WorldVistAEHR/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBCEPA.m@ 771

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

revised back to 6/30/08 version

File size: 6.6 KB
Line 
1IBCEPA ;ALB/WCJ - Provider ID functions - Care Units ;21-OCT-2005
2 ;;2.0;INTEGRATED BILLING;**320,348**;21-MAR-94;Build 5
3EN ; -- main entry point for IBCE 2ND PRVID CARE UNIT MAINT
4 D EN^VALM("IBCE 2ND PRVID CARE UNIT MAINT")
5 Q
6 ;
7HDR ; -- header code
8 K VALMHDR
9 S VALMHDR(1)=" "
10 S VALMHDR(2)="Insurance Co: "_$S('$G(IBALL)&$G(IBINS):$P($G(^DIC(36,+IBINS,0)),U),1:"ALL")
11 Q
12 ;
13INIT ; -- init variables and list array
14 N DIR,Y
15 I '$G(IBINS) D I +Y<0 S VALMQUIT=1 Q
16 . S DIR(0)="PA^DIC(36,:AEMQ",DIR("A")="Select INSURANCE CO: ",DIR("?")="Select an INSURANCE CO to display its care units"
17 . D ^DIR K DIR
18 . I $D(DTOUT)!$D(DUOUT) S Y=-2 Q
19 . I Y>0 S IBINS=+Y Q
20 ;
21 D BLD
22 Q
23 ;
24BLD ;
25 D CLEAN^VALM10
26 K ^TMP("IBPRV_CU",$J)
27 N TAR,MSG,I,D0,IBLCT,Z,DIV,SCREEN
28 ;
29 S VALMBG=1
30 ;
31 ; Get all care units for this insurance company that have a division
32 ; If there is no division, then it is part of the other care units code (IBCEP4)
33 ;
34 S SCREEN="I $P(^(0),U,4)'="""",$P(^(0),U,3)=IBINS"
35 D LIST^DIC(355.95,,"@;.01;.02;.04",,,,,,SCREEN,,"TAR")
36 ;
37 I '+TAR("DILIST",0) D
38 . D SET^VALM10(1,"No CARE UNITs found for this Insurance Company")
39 ;
40 I +TAR("DILIST",0) D
41 . S IBCT=0
42 . F VALMCNT=1:1:+TAR("DILIST",0) D
43 .. S ^TMP("IBPRV_CU",$J,"SORT",TAR("DILIST","ID",VALMCNT,.04),TAR("DILIST",2,VALMCNT))=VALMCNT
44 . S DIV="" F S DIV=$O(^TMP("IBPRV_CU",$J,"SORT",DIV)) Q:DIV="" D
45 .. S Z="Division: "_DIV
46 .. S IBCT=IBCT+1
47 .. D SET^VALM10(IBCT,Z)
48 .. S D0=0 F S D0=$O(^TMP("IBPRV_CU",$J,"SORT",DIV,D0)) Q:'D0 D
49 ... S IN=^TMP("IBPRV_CU",$J,"SORT",DIV,D0)
50 ... S Z=$J("",2)
51 ... S Z=Z_$E(TAR("DILIST","ID",IN,.01),1,36)
52 ... S Z=Z_$J("",40-$L(Z))
53 ... S Z=Z_$E(TAR("DILIST","ID",IN,.02),1,38)
54 ... S IBCT=IBCT+1
55 ... D SET^VALM10(IBCT,Z)
56 Q
57 ;
58HELP ; -- help code
59 S X="?" D DISP^XQORM1 W !!
60 Q
61 ;
62EXIT ; -- exit code
63 D CLEAN^VALM10
64 Q
65 ;
66EXPND ; -- expand code
67 Q
68 ;
69NEW ; Add care unit
70 ; Assumes IBINS is defined as ins co ien (file 36)
71 ; IB = 0 or null if called from list manager, 1 if not
72 N DIC,DIR,X,Y,Z,DA,DR,DIE,DO,DD,DLAYGO,IB95,IBADD,IBOK,IBDIV,MAIN,IBDIVNM
73 ;
74 D FULL^VALM1
75 ; Add an entry - either new care unit/ins co or a combination for
76 ; existing care unit/ins co
77 ;
78 S MAIN=$$MAIN^IBCEP2B()
79 S MAIN=$$EXTERNAL^DILFD(355.92,.05,"",MAIN)
80 S DIC=40.8,DIC("A")="Enter the Division for this Care Unit: ",DIC("B")=MAIN,DIC(0)="AEMQ"
81 D ^DIC
82 I Y'>0 G NEWQ
83 S IBDIV=+Y
84 S IBDIVNM=$$EXTERNAL^DILFD(355.92,.05,"",IBDIV)
85 ;
86 N SCREEN,TAR,MESS,I
87 S SCREEN="I $P(^(0),U,3)=+$G(IBINS),$P(^(0),U,4)=+$G(IBDIV)"
88 D LIST^DIC(355.95,,.01,,,,,,SCREEN,,"TAR")
89 ;
90ACU K DIR
91 S I=0
92 I $G(TAR("DILIST",0)) D
93 . S DIR("?",1)="Current Entries are:"
94 . F I=2:1 Q:'$D(TAR("DILIST",1,I-1)) S DIR("?",I)=" "_TAR("DILIST",1,I-1)
95 . S DIR("?",I)=" "
96 ;
97 S DIR("?",I+1)="You may enter the name of a new Care Unit for this Insurance Company."
98 S DIR("?",I+2)="You can then define a Billing Provider Secondary ID - Billing Screen 3 - for"
99 S DIR("?")="this Care Unit and Insurance Company using the Insurance Company Editor."
100 S DIR("A")="Enter the Care Unit name"
101 S DIR(0)="FO^1:30"
102 D ^DIR
103 I X=""!$G(DUOUT)!$G(DTOUT)!$G(DIROUT) G NEWQ
104 S CAREUNIT=X
105 ;
106 ; At this point, we have X and it'a not a ? or ^
107 ;
108 K DIC
109 S DIC="^IBA(355.95,",DIC("S")="I $P(^(0),U,3)=+$G(IBINS),$P(^(0),U,4)=+$G(IBDIV)",DIC(0)="EX"
110 D ^DIC
111 ;
112 ; Check if we have an exisitng entry and if so, get out of Dodge (This option was for new care units)
113 I Y>0 D G ACU
114 . D DISPMESS("This action is for adding new entries, not editing existing entries.")
115 ;
116 ; New entry , validate field
117 N TAR2
118 D FIELD^DID(355.95,.01,"N","INPUT TRANSFORM","TAR2")
119 S X=CAREUNIT
120 X TAR2("INPUT TRANSFORM")
121 I '$D(X) D G ACU ; Failed input transform
122 . D DISPMESS("Invalid Format.")
123 ;
124 K DIR
125 S DIR("A")="Are you adding '"_X_"' as a new Care Unit for '"_IBDIVNM_"'"
126 S DIR("B")="N"
127 S DIR(0)="Y"
128 D ^DIR
129 I Y=0 G ACU
130 I Y["^" G NEWQ
131 ;
132 ; If it got this far, we have an exact match or a new entry.
133 S X=CAREUNIT
134 S DIC="^IBA(355.95,",DIC("S")="I $P(^(0),U,3)=+$G(IBINS),$P(^(0),U,4)=+$G(IBDIV)",DIC(0)="XL",DLAYGO=355.95
135 S DIC("DR")=".03////"_+$G(IBINS)_";.04////"_$G(IBDIV)
136 D ^DIC
137 I Y>0 D
138 . S DA=+Y,DIE="^IBA(355.95,"
139 . S DR=".02Enter the Care Unit Description"
140 . D ^DIE
141 D BLD
142 ;
143NEWQ S VALMBCK="R"
144 Q
145 ;
146CHANGE ; Edit care unit
147 ; Assumes IBINS is defined as ins co ien (file 36)
148 ;
149 D FULL^VALM1
150 ;
151 N X,Y,Z,DA,DD,DIC,DIK,DIR,IBDIV,CAREUNIT,SCREEN,TAR,DIVISION
152 ;
153 S SCREEN="I $P(^(0),U,3)=+$G(IBINS),$P(^(0),U,4)]"""""
154 D LIST^DIC(355.95,,".01;.04",,,,,,SCREEN,,"TAR")
155 ;
156 I '+$G(TAR("DILIST",0)) D G CHANGEQ
157 .D DISPMESS("No Care Units Defined for this insurance company.")
158 ;
159 ; Store all Divisons with at least one care unit in DIVISION array
160 F I=1:1 Q:'$D(TAR("DILIST","ID",I,.04)) D
161 . S DIVISION(TAR("DILIST","ID",I,.04))=""
162 ;
163 ; Only allow divisions that have care units to be selected
164 S DIC=40.8
165 S DIC("A")="Enter the Division for this Care Unit: "
166 S DIC(0)="AEMQ"
167 S DIC("S")="I $D(DIVISION($P(^(0),U)))"
168 D ^DIC
169 I Y'>0 G CHANGEQ
170 S IBDIV=+Y
171 ;
172 S DIC("A")="Enter the Care Unit name: "
173 S DIC=355.95,DIC("S")="I $P(^(0),U,3)=+$G(IBINS),$P(^(0),U,4)=+$G(IBDIV)",DIC(0)="AEMQ"
174 D ^DIC
175 I Y<1 G CHANGEQ
176 ;
177 S DA=+Y,DIE=355.95
178 S DR=".01Care Unit;.04Division;.02Description"
179 D ^DIE
180 ;
181 D BLD
182 ;
183CHANGEQ S VALMBCK="R"
184 Q
185 ;
186DEL ; Delete a Care Unit
187 ; Assumes IBINS is defined as ins co ien (file 36)
188 ;
189 D FULL^VALM1
190 N X,Y,Z,DA,DD,DIC,DIK,DIR,IBDIV,CAREUNIT,SCREEN,TAR,DIVISION
191 ;
192 S SCREEN="I $P(^(0),U,3)=+$G(IBINS),$P(^(0),U,4)]"""""
193 D LIST^DIC(355.95,,".01;.04",,,,,,SCREEN,,"TAR")
194 ;
195 I '+$G(TAR("DILIST",0)) D G DELQ
196 .D DISPMESS("No Care Units Defined for this insurance company.")
197 ;
198 ; Store all Divisons with at least one care unit in DIVISION array
199 F I=1:1 Q:'$D(TAR("DILIST","ID",I,.04)) D
200 . S DIVISION(TAR("DILIST","ID",I,.04))=""
201 ;
202 ; Only allow divisions that have care units to be selected
203 S DIC=40.8
204 S DIC("A")="Enter the Division for this Care Unit: "
205 S DIC(0)="AEMQ"
206 S DIC("S")="I $D(DIVISION($P(^(0),U)))"
207 D ^DIC
208 I Y'>0 G DELQ
209 S IBDIV=+Y
210 ;
211 K DIC
212 S DIC("A")="Enter the Care Unit name: "
213 S DIC=355.95,DIC("S")="I $P(^(0),U,3)=+$G(IBINS),$P(^(0),U,4)=+$G(IBDIV)",DIC(0)="AEMQ"
214 D ^DIC
215 I Y<1 G DELQ
216 S CAREUNIT=+Y
217 ;
218 I $D(^IBA(355.92,"AC",+Y)) D G DELQ
219 . S DIR(0)="EA"
220 . S DIR("A",1)="IDs that are assigned to the Care Unit in the Insurance Company Editor must be"
221 . S DIR("A",2)="deleted before deleting the Care Unit."
222 . S DIR("A")="Press return to continue "
223 . W ! D ^DIR K DIR
224 ;
225 S DIR("A")="OK to Delete: "
226 S DIR("B")="No"
227 S DIR(0)="YAO"
228 D ^DIR
229 I '$G(Y) G DELQ
230 K DIR
231 ;
232 S DA=CAREUNIT
233 S DIK="^IBA("_355.95_","
234 D ^DIK
235 ;
236 D BLD
237 ;
238DELQ S VALMBCK="R"
239 Q
240 ;
241DISPMESS(MESS) ;
242 N DIR,X,Y
243 S DIR(0)="EA",DIR("A",1)=MESS
244 S DIR("A")="PRESS ENTER to continue "
245 D ^DIR
246 Q
247 ;
Note: See TracBrowser for help on using the repository browser.