source: WorldVistAEHR/trunk/r/E_CLAIMS_MGMT_ENGINE-BPS/BPSREOP1.m@ 1073

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

initial load of WorldVistAEHR

File size: 5.1 KB
RevLine 
[613]1BPSREOP1 ;BHAM ISC/SS - REOPEN CLOSED CLAIMS ;05-APR-05
2 ;;1.0;E CLAIMS MGMT ENGINE;**3**;JUN 2004;Build 20
3 ;; Per VHA Directive 10-93-142, this routine should not be modified.
4 ;Reopen closed claims
5 Q
6 ;
7 ;
8 ;create an ^TMP for the list manager
9 ;
10COLLECT(BPDFN,BPSTRT,BPEND) ;
11 D CLEAN^VALM10
12 N LINE
13 N BPIEN02,BPIEN59
14 S LINE=1
15 S BPIEN59=0
16 F S BPIEN59=$O(^BPST("AC",BPDFN,BPIEN59)) Q:+BPIEN59=0 D
17 . I $P($G(^BPST(BPIEN59,12)),U,2)<BPSTRT Q
18 . I $P($G(^BPST(BPIEN59,12)),U,2)>BPEND Q
19 . S BPIEN02=+$P($G(^BPST(BPIEN59,0)),U,4)
20 . ;if the is no BPS CLAIMS - error
21 . Q:BPIEN02=0
22 . ;if NOT closed
23 . I +$P($G(^BPSC(BPIEN02,900)),U)=0 Q
24 . D SET^VALM10(LINE,$$LJ^BPSSCR02(LINE,6)_$$CLAIMINF(BPIEN59),BPIEN59)
25 . S LINE=LINE+1
26 S VALMCNT=LINE-1 ;"of PAGE" fix - VALMCNT should be EXACT number of lines on the screen
27 Q
28 ;claim info for list manager screen
29CLAIMINF(BP59) ;*/
30 N BPX,BPX1
31 S BPX1=$$RXREF^BPSSCRU2(BP59)
32 S BPX=$$LJ^BPSSCR02($$DRGNAME^BPSSCRU2(BP59),17)_" "_$$LJ^BPSSCR02($$NDC^BPSSCRU2(+BPX1,+$P(BPX1,U,2)),13)_" "
33 S BPX=BPX_$$LJ^BPSSCR02($$FILLDATE^BPSSCRRS(+BPX1,+$P(BPX1,U,2)),5)_" "
34 S BPX=BPX_$$LJ^BPSSCR02($$RXNUM^BPSSCRU2(+BPX1),11)_" "_+$P(BPX1,U,2)_"/"
35 S BPX=BPX_$$LJ^BPSSCR02($$ECMENUM^BPSSCRU2(BP59),7)_" "_$$MWCNAME^BPSSCRU2($$GETMWC^BPSSCRU2(BP59))_" "
36 S BPX=BPX_$$RTBB^BPSSCRU2(BP59)_" "_$$RXST^BPSSCRU2(BP59)_"/"_$$RL^BPSSCRU2(BP59)
37 Q BPX
38 ;
39 ;patient info for header
40PATINF(BPDFN) ;*/
41 N X
42 S X=$E($$PATNAME(BPDFN),1,22)_" "_$$SSN4^BPSSCRU2(BPDFN)
43 Q $$LJ^BPSSCR02(X,29) ;name
44 ;
45 ;------------ patient's name
46PATNAME(BPDFN) ;
47 Q $E($P($G(^DPT(BPDFN,0)),U),1,30)
48 ;
49SELECT ;
50 I VALMCNT<1 D Q
51 . W !,"No claims to select." D PAUSE^VALM1 S VALMBCK="R"
52 N BP59,BPQ
53 D FULL^VALM1
54 S BP59=0
55 S BPQ=0
56 F S BPLINE=$$PROMPT("Select item","","A") D Q:BPQ
57 . I BPLINE="^" S BPQ=1 Q
58 . I '(BPLINE?1N.N) W !,"Please select a SINGLE Rx Line Item." Q
59 . S BP59=+$$GET59(+BPLINE) I BP59>0 S BPQ=1 Q
60 . W !,"Please select a VALID Rx Line Item."
61 I BPLINE="^" S VALMBCK="R" Q
62 I BP59=0 S VALMBCK="R" W !,"Invalid selection." D PAUSE^VALM1 Q
63 I $$SELCLAIM(BP59)<1 S VALMBCK="R" Q
64 ;D RE^VALM4
65 D REDRAW
66 S VALMBCK="R"
67 Q
68 ;
69GET59(BPLINE) ;
70 Q +$O(^TMP("BPSREOP",$J,"VALM","IDX",BPLINE,0))
71 ;
72 ;display selected claim information
73SELCLAIM(BP59) ;
74 D FULL^VALM1
75 W @IOF
76 N BPX,BPX1,BPDFN,BPIEN02,BPCLDATA,BPCOMM,BPRETV,BPREOPDT,BPQ
77 S BPDFN=+$P($G(^BPST(BP59,0)),U,6)
78 S BPX1=$$RXREF^BPSSCRU2(BP59)
79 W !,?1,$$LJ^BPSSCR02("PATIENT NAME: "_$$PATNAME(BPDFN),30)
80 W ?33,$$LJ^BPSSCR02("RX#: "_$$RXNUM^BPSSCRU2(+BPX1)_" "_$P(BPX1,U,2),22)
81 W ?57,$$LJ^BPSSCR02("DRUG: "_$$DRGNAME^BPSSCRU2(BP59),22)
82 ;ien in BPS CLAIMS
83 S BPIEN02=+$P($G(^BPST(BP59,0)),U,4)
84 I BPIEN02=0 W !,"BPS CLAIMS file error!" D PAUSE^VALM1 Q -1
85 ;Close info
86 S BPCLDATA=$G(^BPSC(BPIEN02,900))
87 ;if the is no BPS CLAIMS - error
88 W !,?3,"CLOSED ",$$FORMDATE^BPSSCRU6(+$P($G(^BPSC(BPIEN02,900)),U,2),2)
89 W !,?4,"ECME#: "_+BPX1_", FILL DATE: "_$$FORMDATE^BPSSCRU6($$DOSDATE^BPSSCRRS(+BPX1,+$P(BPX1,U,2)),2)
90 W ", RELEASE DATE: "_$$FORMDATE^BPSSCRU6($$RELDATE^BPSSCRU6(+BPX1,+$P(BPX1,U,2)),2)
91 W !,?4,"PLAN: ",$$PLANNAME^BPSSCRU6(BP59)," INSURANCE: ",$$INSNAME^BPSSCRU6(BP59)
92 W !,?4,"CLOSE REASON: ",$$CLREASON^BPSSCRU6(+$P(BPCLDATA,U,4))
93 W !,?4,"DROP TO PAPER: ",$S(+$P(BPCLDATA,U,5)=1:"YES",1:"NO")
94 W !,?4,"CLOSE USER: ",$P($G(^VA(200,+$P(BPCLDATA,U,3),0)),U)
95 W !!,"You have selected the CLOSED electronic claim listed above.",!
96 S BPCOMM=$$PROMPT("REOPEN COMMENTS","","F",1,40)
97 Q:BPCOMM["^" 0
98 S BPQ=$$YESNO^BPSSCRRS("ARE YOU SURE YOU WANT TO RE-OPEN THIS CLAIM? (Y/N)","No")
99 Q:BPQ<1 0
100 D
101 . N %,%H,%I,X
102 . D NOW^%DTC
103 . S BPREOPDT=%
104 S BPRETV=$$REOPEN^BPSBUTL(BP59,BPIEN02,BPREOPDT,+DUZ,BPCOMM)
105 W !,$P(BPRETV,U,2),!
106 W !,"1 claim has been reopened.",!
107 D PAUSE^VALM1
108 Q 1
109 ;
110REDRAW ;
111 N BPARR
112 D CLEAN^VALM10
113 D COLLECT^BPSREOP1(BPDFN,BPSTRT,BPEND)
114 S VALMBCK="R"
115 Q
116 ;input:
117 ;BPSPROM - prompt text
118 ;BPSDFVL - default value (optional)
119 ;BPMODE - N- to enter numbers, F - free text, A - free text w/o limitations
120 ;returns:
121 ; "response"
122 ; or "^" for quit
123PROMPT(BPSPROM,BPSDFVL,BPMODE,MINLEN,MAXLEN) ;
124 N IR,X,Y,DIRUT,DIR
125 I BPMODE="N" S DIR(0)="N^::2"
126 I BPMODE="A" S DIR(0)="F^::2"
127 I BPMODE="F" S DIR(0)="F^"_MINLEN_":"_MAXLEN_":2^K:(X?1"" ""."" "") X"
128 S DIR("A")=BPSPROM
129 I $L($G(BPSDFVL))>0 S DIR("B")=$G(BPSDFVL)
130 D ^DIR I $D(DIRUT) Q "^"
131 I Y["^" Q "^"
132 Q Y
133 ;
134 ;Update reopen record in BPS CLAIM
135 ;Input:
136 ; BP02 - ien in BPS CLAIMS file
137 ; BPCLOSED - value for CLOSED field
138 ; BPREOPDT - reopen date/time
139 ; BPDUZ - user DUZ (#200 ien)
140 ; BPCOMM - reopen comment text
141 ;Output:
142 ; 0^message_error - error
143 ; 1 - success
144UPDREOP(BP02,BPCLOSED,BPREOPDT,BPDUZ,BPCOMM) ;
145 ;Now update ECME database
146 N RECIENS,BPDA,BPLCK,ERRARR
147 S RECIENS=BP02_","
148 S BPDA(9002313.02,RECIENS,901)=BPCLOSED ;CLOSED = "NO"
149 S BPDA(9002313.02,RECIENS,906)=BPREOPDT ;reopen date/time
150 S BPDA(9002313.02,RECIENS,907)=+BPDUZ ;user
151 S BPDA(9002313.02,RECIENS,908)=BPCOMM ;comment
152 L +^BPST(9002313.02,+BP02):10
153 S BPLCK=$T
154 I 'BPLCK Q "0^Locked record" ;quit
155 D FILE^DIE("","BPDA","ERRARR")
156 I BPLCK L -^BPST(9002313.02,+BP02)
157 I $D(ERRARR) Q "0^"_ERRARR("DIERR",1,"TEXT",1)
158 Q 1
159 ;
Note: See TracBrowser for help on using the repository browser.