source: FOIAVistA/trunk/r/E_CLAIMS_MGMT_ENGINE-BPS/BPSOS6M.m@ 1724

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

initial load of FOIAVistA 6/30/08 version

File size: 2.4 KB
Line 
1BPSOS6M ;BHAM ISC/FCS/DRS - Print log of claim ;06/01/2004
2 ;;1.0;E CLAIMS MGMT ENGINE;**1,5**;JUN 2004;Build 45
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5 ; Display the BPS Log for a given BPS Transaction
6 Q
7CLAIMLOG(IEN59) ;EP - from BPSSCRDV
8 ;
9 I '$G(IEN59) Q
10 ;
11 ; Get Device
12 N POP
13 D ^%ZIS
14 I $G(POP) Q
15 U IO
16 ;
17 ; Determine if this is a terminal
18 N BPSCR S BPSCR=$S($E($G(IOST),1,2)="C-":1,1:0)
19 ;
20 ; Read BPS Transaction into the local variable
21 N REC,X,X1,X2 M REC=^BPST(IEN59)
22 N I F I=0:1:2 I '$D(REC(I)) S REC(I)=""
23 ;
24 ; Display Header
25 I BPSCR W @IOF
26 W "Pharmacy ECME Log of activity for one prescription",!
27 ;
28 ; Prescription and Transaction Info
29 W "Internal Prescription #",$P(REC(1),U,11)
30 W " Fill #",+$P(REC(1),U)
31 W !,"VA Prescription #",$$RXAPI1^BPSUTIL1(+$P(REC(1),U,11),.01)
32 W !,"Transaction #",IEN59
33 ;
34 ; Patient
35 W !,"Patient: "
36 S X=$P(REC(0),U,6) I X]"" S X=$P($G(^DPT(X,0)),U) W X
37 ;
38 ; Status and Response
39 W !!,"Status: "
40 S X=$P(REC(0),U,2) W X," (",$$STATI^BPSOSU(X),")"
41 I X=99 D DISPRESP
42 ;
43 ; Transaction Times
44 W !!,"Last started on " S X1=$P(REC(0),U,11) I X1]"" W $$DATETIME^BPSOSUD(X1)
45 W !,"Last activity on " S X2=$P(REC(0),U,8) I X2]"" W $$DATETIME^BPSOSUD(X2)
46 I X1]"",X2]"" W " Elapsed time: " W $$TIMEDIF^BPSOSUD(X1,X2)
47 ;
48 ; Claim and Response
49 W !!
50 S X=$P(REC(0),U,4)
51 I X="" W "No entry"
52 E W "See also entry `",X
53 W " in file BPS CLAIMS (#9002313.02)",!
54 I X]"" D
55 . S X=$P(REC(0),U,5)
56 . I X="" W " but there is no entry"
57 . E W " and entry `",X
58 . W " in file BPS RESPONSES (#9002313.03)",!
59 ;
60 ; Log
61 N STOP S STOP=0
62 N EXISTS S EXISTS=$$EXISTS^BPSOSL1(IEN59)
63 I EXISTS D Q:$G(STOP)
64 . W !,"Log of this claim's activity: ",!
65 . I BPSCR S X="" D PAUSE^VALM1 I X="^" S STOP=1 Q
66 . D PRINTLOG^BPSOSL1(IEN59,.STOP)
67 . I $G(STOP) Q
68 . I BPSCR D PRESSANY^BPSOSU5()
69 I 'EXISTS D
70 . W !,"There is no log for this claim's activity.",!
71 . I BPSCR D PRESSANY^BPSOSU5()
72 ;
73 ; Close Device
74 D ^%ZISC
75 Q
76 ;
77 ; Display response info
78DISPRESP ;
79 N RES
80 S RES=$P(REC(2),U)
81 I RES=0 D ; good, go to the claim response and see what it says
82 . N RSP D RESPINFO^BPSOSQ4(IEN59,.RSP)
83 . W !,"Response Status-Header: ",$G(RSP("HDR"))
84 . W !,"Response Status-Prescription: ",$G(RSP("RSP")) ; Payable, Rejected, Captured, Duplicate
85 . I $G(RSP("MSG"))]"" W !?10,RSP("MSG")
86 . N I F I=1:1:$G(RSP("REJ",0)) W !?10,$G(RSP("REJ",I))
87 E D
88 . W !,"Result: ",RES
89 . I $P(REC(2),U,2)]"" W " (",$P($P(REC(2),";",1),U,2,$L(REC(2),U)),")"
90 Q
Note: See TracBrowser for help on using the repository browser.