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

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

initial load of WorldVistAEHR

File size: 6.0 KB
RevLine 
[613]1IBCEMCA1 ;ALB/ESG - Multiple CSA Message Management - Actions ;20-SEP-2005
2 ;;2.0;INTEGRATED BILLING;**320**;21-MAR-1994
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 Q
6REVSTAT ; change review status
7 NEW DIR,X,Y,DA,DIRUT,DIROUT,DTOUT,DUOUT,NS,IBRVUST,IBFNRVAC,IBRVCMT
8 NEW DIC,DWLW,DWPK,DIWESUB,DIWETXT,LN,IBDA,IBOLD,DIE,DA,DR
9 D FULL^VALM1
10 S NS=+$G(^TMP($J,"IBCEMCL",4))
11 I 'NS D G REVSTATX
12 . W !!?5,"There are no selected messages." D PAUSE^VALM1
13 . Q
14 ;
15 W !!?5,"Number of messages selected: ",NS,!
16 ;
17 ; reader call for the new review status field
18 S DIR(0)="361,.09"
19 S DIR("A")="Enter the REVIEW STATUS for the selected message"_$S(NS>1:"s",1:"")
20 D ^DIR K DIR
21 I $D(DIRUT) G REVSTATX
22 M IBRVUST=Y
23 I IBRVUST'=2 G RVCQ ; skip down to the confirmation
24 ;
25RSQ2 ; Reader call for the final review action field
26 W !
27 S DIR(0)="361,.1"
28 S DIR("A")="Enter the FINAL REVIEW ACTION for the selected message"_$S(NS>1:"s",1:"")
29 D ^DIR K DIR
30 I X="",Y="" W !!?5,"This field is required when the review has been completed." G RSQ2
31 I $D(DIRUT) G REVSTATX
32 M IBFNRVAC=Y
33 ;
34RSQ3 ; review comment text
35 W !
36 K ^TMP($J,"IBCEMCA1-COMMENTS"),IBRVCMT
37 S DIC="^TMP($J,""IBCEMCA1-COMMENTS"","
38 S DWLW=75,DWPK=1,DIWESUB="REVIEW COMMENTS"
39 S DIWETXT="These comments are optional"
40 I IBFNRVAC="O" S DIWETXT="These comments are required because OTHER ACTION was selected."
41 D EN^DIWE
42 M IBRVCMT=^TMP($J,"IBCEMCA1-COMMENTS")
43 K ^TMP($J,"IBCEMCA1-COMMENTS")
44 I IBFNRVAC="O",'$D(IBRVCMT(0)) D G RSQ3
45 . W !!?5,"Comments are required when the Final Review Action is OTHER ACTION."
46 . D PAUSE^VALM1
47 . Q
48 I $P($G(IBRVCMT(0)),U,4) S IBRVCMT=$P($G(IBRVCMT(0)),U,4)
49 ;
50RVCQ ; display a summary of the user responses and get confirmation
51 W !!," Number of selected",!," Status Messages: ",NS
52 W !?7,"Review Status: ",$G(IBRVUST(0))
53 I IBRVUST=2 D
54 . W !," Final Review Action: ",$G(IBFNRVAC(0))
55 . W !?5,"Review Comments: "
56 . I '$D(IBRVCMT(0)) W "<none>"
57 . E S LN=0 F S LN=$O(IBRVCMT(LN)) Q:'LN W !?5,IBRVCMT(LN,0)
58 . Q
59 W !
60 S DIR(0)="YO"
61 S DIR("A")="OK to proceed",DIR("B")="No"
62 D ^DIR K DIR
63 I Y'=1 G REVSTATX
64 ;
65 ; Loop thru selected status messages and update them
66 S IBDA=0
67 F S IBDA=$O(^TMP($J,"IBCEMCL",4,1,IBDA)) Q:'IBDA D
68 . S IBOLD=$P($G(^IBM(361,IBDA,0)),U,9) ; old review status
69 . S DIE=361,DA=IBDA
70 . S DR=".09////"_IBRVUST
71 . I $G(IBFNRVAC)'="" S DR=DR_";.1////"_$G(IBFNRVAC)
72 . D ^DIE
73 . I $D(IBRVCMT(0)) D NOTECHG^IBCECSA2(IBDA,0,.IBRVCMT,1)
74 . I IBOLD'=IBRVUST D NOTECHG^IBCECSA2(IBDA,0)
75 . L -^IBM(361,IBDA) ; unlock
76 . Q
77 W " ... Done!"
78 ;
79 ; rebuild the list
80 KILL ^TMP($J,"IBCEMCA"),VALMHDR
81 S VALMBG=1
82 D INIT^IBCEMCL
83 I $G(IBCSAMCS)=1 S IBCSAMCS=2 ; flag to rebuild CSA
84 ;
85REVSTATX ;
86 S VALMBCK="R"
87 Q
88 ;
89COMMENT ; enter review comments
90 NEW NS,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT,IBRVCMT,DIC,DWLW,DWPK,DIWESUB,IBDA,LN
91 D FULL^VALM1
92 S NS=+$G(^TMP($J,"IBCEMCL",4))
93 I 'NS D G COMMX
94 . W !!?5,"There are no selected messages." D PAUSE^VALM1
95 . Q
96 ;
97 W !!?5,"Number of messages selected: ",NS,!
98 ;
99 S DIR(0)="YO",DIR("B")="Yes"
100 S DIR("A")="Do you want to add a new Review Comment for all of these messages"
101 I NS=1 S DIR("A")="Do you want to add a new Review Comment for this message"
102 D ^DIR K DIR
103 I Y'=1 G COMMX
104 ;
105 ; review comment text
106 W !
107 K ^TMP($J,"IBCEMCA1-COMMENTS"),IBRVCMT
108 S DIC="^TMP($J,""IBCEMCA1-COMMENTS"","
109 S DWLW=75,DWPK=1,DIWESUB="REVIEW COMMENTS"
110 D EN^DIWE
111 M IBRVCMT=^TMP($J,"IBCEMCA1-COMMENTS")
112 K ^TMP($J,"IBCEMCA1-COMMENTS")
113 I $P($G(IBRVCMT(0)),U,4) S IBRVCMT=$P($G(IBRVCMT(0)),U,4)
114 I '$D(IBRVCMT(0)) G COMMX ; no comments entered
115 ;
116 ; final confirmation
117 W !
118 S LN=0 F S LN=$O(IBRVCMT(LN)) Q:'LN W !?5,IBRVCMT(LN,0)
119 W !
120 S DIR(0)="YO"
121 S DIR("A")="OK to add this comment for all selected status messages",DIR("B")="No"
122 I NS=1 S DIR("A")="OK to add this comment for the selected status message"
123 D ^DIR K DIR
124 I Y'=1 G COMMX
125 ;
126 ; Loop thru selected status messages and update them
127 S IBDA=0
128 F S IBDA=$O(^TMP($J,"IBCEMCL",4,1,IBDA)) Q:'IBDA D
129 . D NOTECHG^IBCECSA2(IBDA,0,.IBRVCMT,1)
130 . L -^IBM(361,IBDA) ; unlock
131 . Q
132 W " ... Done!"
133 ;
134 ; rebuild the list
135 KILL ^TMP($J,"IBCEMCA"),VALMHDR
136 S VALMBG=1
137 D INIT^IBCEMCL
138 ;
139COMMX ;
140 S VALMBCK="R"
141 Q
142 ;
143RETRAN ; retransmit claims
144 NEW NS,IBIFN,NSC,DIR,X,Y,DUOUT,DTOUT,DIRUT,DIROUT,IBDA,IB364
145 D FULL^VALM1
146 S NS=+$G(^TMP($J,"IBCEMCL",4))
147 I 'NS D G RETRANX
148 . W !!?5,"There are no selected messages." D PAUSE^VALM1
149 . Q
150 ;
151 ; count number of claims too
152 S IBIFN=0 F NSC=0:1 S IBIFN=$O(^TMP($J,"IBCEMCL",4,2,IBIFN)) Q:'IBIFN
153 ;
154 W !!?5,"Number of messages selected: ",NS
155 W !?7,"Number of claims selected: ",NSC,!
156 ;
157 S DIR("A",1)="In order to retransmit these claims, the transmission status for all of these"
158 S DIR("A",2)="claims will be reset to be ""READY FOR EXTRACT"". These claims will then be"
159 S DIR("A",3)="sent with the next regularly scheduled claims transmission process."
160 S DIR("A",4)=""
161 S DIR("A")="Do you want to retransmit these claims"
162 I NSC=1 D
163 . S DIR("A",1)="In order to retransmit this claim, the transmission status for this claim will"
164 . S DIR("A",2)="be reset to be ""READY FOR EXTRACT"". This claim will then be sent with the"
165 . S DIR("A",3)="next regularly scheduled claims transmission process."
166 . S DIR("A")="Do you want to retransmit this claim"
167 . Q
168 S DIR(0)="YO",DIR("B")="No" D ^DIR K DIR
169 I Y'=1 G RETRANX
170 ;
171 ; Loop thru selected claims and add new transmission records in a
172 ; "Ready to Extract" status
173 S IBIFN=0
174 F S IBIFN=$O(^TMP($J,"IBCEMCL",4,2,IBIFN)) Q:'IBIFN D
175 . S IBDA=+$O(^TMP($J,"IBCEMCL",4,2,IBIFN,""),-1) ; most recent 361 ien
176 . S IB364=+$P($G(^IBM(361,IBDA,0)),U,11) ; transmit bill 364 ien
177 . I 'IBDA!'IB364 Q
178 . D UPDEDI^IBCEM(IB364,"R") ; update EDI files for transmission
179 . S Y=$$ADDTBILL^IBCB1(IBIFN,1) ; add new transmission record
180 . Q
181 W " ... Done!"
182 ;
183 ; rebuild the list
184 KILL ^TMP($J,"IBCEMCA"),VALMHDR
185 S VALMBG=1
186 D UNLOCK^IBCEMCL
187 D INIT^IBCEMCL
188 I $G(IBCSAMCS)=1 S IBCSAMCS=2 ; flag to rebuild CSA
189 ;
190RETRANX ;
191 S VALMBCK="R"
192 Q
193 ;
Note: See TracBrowser for help on using the repository browser.