source: WorldVistAEHR/trunk/r/E_CLAIMS_MGMT_ENGINE-BPS/BPSSCRRV.m@ 1005

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

initial load of WorldVistAEHR

File size: 5.3 KB
Line 
1BPSSCRRV ;BHAM ISC/SS - ECME SCREEN REVERSE CLAIM ;05-APR-05
2 ;;1.0;E CLAIMS MGMT ENGINE;**1,5**;JUN 2004;Build 4;WorldVistA 30-Jan-08
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;Modified from FOIA VISTA,
5 ;Copyright 2008 WorldVistA. Licensed under the terms of the GNU
6 ;General Public License See attached copy of the License.
7 ;
8 ;This program is free software; you can redistribute it and/or modify
9 ;it under the terms of the GNU General Public License as published by
10 ;the Free Software Foundation; either version 2 of the License, or
11 ;(at your option) any later version.
12 ;
13 ;This program is distributed in the hope that it will be useful,
14 ;but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;GNU General Public License for more details.
17 ;
18 ;You should have received a copy of the GNU General Public License along
19 ;with this program; if not, write to the Free Software Foundation, Inc.,
20 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 Q
22 ;IA 4702
23 ;
24REV ;entry point for "Reverse" menu item
25 N BPRET,BPSARR59
26 I '$D(@(VALMAR)) Q
27 D FULL^VALM1
28 W !,"Enter the line numbers for the Payable claim(s) to be Reversed."
29 S BPRET=$$ASKLINES^BPSSCRU4("Select item(s)","C",.BPSARR59,VALMAR)
30 I BPRET="^" S VALMBCK="R" Q
31 ;reverse selected lines
32 ;update the content of the screen and display it
33 ;only if at least one reversal was submitted successfully
34 I $$RVLINES(.BPSARR59)>0 D REDRAW^BPSSCRUD("Updating screen for reversed claims...")
35 E S VALMBCK="R"
36 Q
37 ;/**
38 ;Reverse selected lines
39 ;input:
40 ; BP59ARR(BP59)="line# in LM array "
41 ;output:
42 ; REVTOTAL - total number of claims for whose the reversal was submitted sucessfully
43RVLINES(BP59ARR) ;*/
44 N BP59,REVTOTAL,BPRVREAS,BPDFN,BPQ
45 N BPIFANY S BPIFANY=0
46 N BPSTATS
47 S REVTOTAL=0,BPQ=""
48 S BP59="" F S BP59=$O(BP59ARR(BP59)) Q:BP59="" D Q:BPQ="^"
49 . I BPIFANY=0 W @IOF
50 . S BPIFANY=1,BPQ=""
51 . S BPDFN=+$P($G(^BPST(BP59,0)),U,6)
52 . S BPSTATS=$P($$CLAIMST^BPSSCRU3(BP59),U)
53 . I BPSTATS'["E DUPLICATE",BPSTATS'["E REVERSAL REJECTED",BPSTATS'["E REVERSAL STRANDED",BPSTATS'["E PAYABLE" D S BPQ=$$PAUSE() Q
54 . . W !,"The claim: ",!,$G(@VALMAR@(+$G(BP59ARR(BP59)),0)),!,"is NOT Payable and cannot be Reversed."
55 . ;
56 . W !,"You've chosen to REVERSE the following prescription for "_$E($$PATNAME^BPSSCRU2(BPDFN),1,13)
57 . W !,$G(@VALMAR@(+$G(BP59ARR(BP59)),0))
58 . ;F S BPRVREAS=$$COMMENT^BPSSCRCL("Enter REQUIRED REVERSAL REASON",60) Q:BPRVREAS="^" Q:($L(BPRVREAS)>0)&&(BPRVREAS'="^")&&('(BPRVREAS?1" "." ")) D
59 . F S BPRVREAS=$$COMMENT^BPSSCRCL("Enter REQUIRED REVERSAL REASON",60) Q:BPRVREAS="^" Q:($L(BPRVREAS)>0)&(BPRVREAS'="^")&('(BPRVREAS?1" "." ")) D
60 . . W !,"Please provide the reason or enter ^ to abandon the reversal."
61 . I BPRVREAS["^" W !,"The claim: ",!,$G(@VALMAR@(+$G(BP59ARR(BP59)),0)),!,"was NOT reversed!" S BPQ=$$PAUSE() Q
62 . S BPQ=$$YESNO^BPSSCRRS("Are you sure?(Y/N)")
63 . I BPQ=-1 S BPQ="^" Q
64 . I BPQ'=1 Q
65 . I $$REVERSIT(BP59,BPRVREAS)=0 S REVTOTAL=REVTOTAL+1
66 W:BPIFANY=0 !,"No eligible items selected."
67 W !,REVTOTAL," claim reversal",$S(REVTOTAL'=1:"s",1:"")," in progress.",!
68 D PAUSE^VALM1
69 Q REVTOTAL
70 ;
71 ;
72 ;the similar to REVERSE
73 ;with some information displayed for the user
74 ;Input:
75 ; BP59 ptr in file #9002313.59
76 ; BPRVREAS - reversal reason (free text)
77 ;Output:
78 ;-1 Claim is not Payable
79 ;-2 no reversal, it's unreversable
80 ;-3 paper claim
81 ;>0 - IEN of reversal claim if electronic claim submitted for
82 ; reversal.
83REVERSIT(BP59,BPRVREAS) ;
84 N BPRET
85 N BPRX
86 N BPRXRF
87 S BPRXRF=$$RXREF^BPSSCRU2(BP59)
88 S BPRET=+$$REVERSE(BP59,BPRVREAS,+BPRXRF,+$P(BPRXRF,U,2))
89 S BPRX=$$RXNUM^BPSSCRU2(+BPRXRF)
90 Q BPRET
91 ;
92 ;
93 ;/**
94 ;Reverse the claim
95 ;Input:
96 ; BP59 ptr in file #9002313.59
97 ; BPRVREAS - reversal reason (free text)
98 ; BPRX - RX ien (#52)
99 ; BPFIL - refill number
100 ;Output:
101 ; code^message
102 ; where
103 ; code :
104 ; from $$EN^BPSNCPDP
105 ; 0 Prescription/Fill successfully submitted to ECME for claims processing
106 ; 1 ECME did not submit prescription/fill
107 ; 2 IB says prescription/fill is not ECME billable or the data returned from IB is not valid
108 ; 3 ECME closed the claim but did not submit it to the payer
109 ; 4 Unable to queue the ECME claim
110 ; 5 Invalid input
111 ; and additional
112 ; 12 Claim has been deleted in Pharmacy.
113 ; message - whatever $$EN^BPSNCPDP returns
114 ; for 12 - "Claim has been deleted in Pharmacy."
115 ;
116REVERSE(BP59,BPRVREAS,BPRX,BPFIL) ;*/
117 N BPDOS S BPDOS=$$DOSDATE^BPSSCRRS(BPRX,BPFIL)
118 N BPNDC S BPNDC=$$NDC^BPSSCRU2(BPRX,BPFIL)
119 N BPRET
120 I $$RXDEL^BPSOS(BPRX,BPFIL) D Q 12_U_"Claim has been deleted in Pharmacy."
121 . W !,"The claim cannot be reversed since it has been deleted in Pharmacy."
122 S BPRET=$$EN^BPSNCPDP(BPRX,BPFIL,BPDOS,"EREV",BPNDC,BPRVREAS)
123 ;print return value message
124 W !!
125 W:+BPRET>0 "Not Processed:",!," "
126 W $P(BPRET,U,2)
127 ;0 Prescription/Fill successfully submitted to ECME for claims processing
128 ;1 ECME did not submit prescription/fill
129 ;2 IB says prescription/fill is not ECME billable or the data returned from IB is not valid
130 ;3 ECME closed the claim but did not submit it to the payer
131 ;4 Unable to queue the ECME claim
132 ;5 Invalid input
133 I +BPRET=0 D ECMEACT^PSOBPSU1(+BPRX,+BPFIL,"Claim reversal sent to 3rd party payer: ECME USER's SCREEN")
134 Q BPRET
135 ;
136PAUSE() ;
137 N X
138 W ! S DIR(0)="E" D ^DIR K DIR W !
139 Q X
140 ;
Note: See TracBrowser for help on using the repository browser.