source: WorldVistAEHR/trunk/r/E_CLAIMS_MGMT_ENGINE-BPS/BPSOSUC.m@ 699

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

initial load of WorldVistAEHR

File size: 2.6 KB
Line 
1BPSOSUC ;BHAM ISC/FCS/DRS/FLS - ECME utilities ;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 Q
5 ; CATEG returns the status of a Transaction or Log of Transaction
6 ; entry. It is used mainly by STATUS^BPSOSRX but is also
7 ; called by some other routines as well as computed fields of BPS Log
8 ; of Transactions and BPS Tranasctions
9CATEG(N,WANTREV) ;
10 ; N - If decimal, IEN from BPS Transaction
11 ; - If integer, IEN from BPS Log of Transactions
12 ; $G(WANTREV) = true if you care about reversals
13 ; (that's the default if N is an IEN59)
14 ; $G(WANTREV) = false if you want to ignore reversals
15 ; (that's the default if IEN57)
16 ;
17 ; Many routines rely on these exact return values; do not change them:
18 ; Return values:
19 ; For both reversals and submissions:
20 ; CORRUPT - Should never happen
21 ;
22 ; For submissions:
23 ; E PAYABLE, E CAPTURED, E DUPLICATE, E REJECTED, E OTHER, and
24 ; E STRANDED
25 ;
26 ; For Reversals:
27 ; E REVERSAL ACCEPTED, E REVERSAL REJECTED, E REVERSAL OTHER, and
28 ; E REVERSAL STRANDED
29 ;
30 I N<1 Q "" ; Should not happen
31 N FILENUM S FILENUM=$S(N[".":9002313.59,1:9002313.57)
32 I '$D(WANTREV) S WANTREV=$S(FILENUM=9002313.57:0,FILENUM=9002313.59:1)
33 N RETVAL,CLAIM,RESP,X,RESP500,CODE,STAT,DISYS
34 I '$$GET1^DIQ(FILENUM,N_",",.01) Q "CORRUPT"
35 S CLAIM=$$GET1^DIQ(FILENUM,N_",",3,"I")
36 S RESP=$$GET1^DIQ(FILENUM,N_",",4,"I")
37 S CODE=$$GET1^DIQ(FILENUM,N_",",201,"I")
38 S STAT=$$GET1^DIQ(FILENUM,N_",",202,"I")
39 I $P(STAT,";")="E REVERSAL STRANDED" Q "E REVERSAL STRANDED"
40 I $P(STAT,";")="E STRANDED" Q "E STRANDED"
41 ; During a reversal/resubmit, you may get the next line between the reversal and
42 ; and the resubmit
43 I 'CLAIM S RETVAL="E OTHER" Q RETVAL
44 I WANTREV S X=$$GET1^DIQ(FILENUM,N_",",401,"I") I X D Q RETVAL
45 . S RESP=$$GET1^DIQ(FILENUM,N_",",402,"I")
46 . S RETVAL="E REVERSAL "
47 . I 'RESP S RETVAL=RETVAL_"OTHER" Q
48 . S RESP500=$$RESP500^BPSOSQ4(RESP,"I")
49 . S X=$$RESP1000^BPSOSQ4(RESP,1,"I")
50 . I RESP500="R"!(X="R") S RETVAL=RETVAL_"REJECTED" Q
51 . ; Treat Duplicate of Accepted Reversal ("S") as Accepted
52 . I RESP500="A",X="A"!(X="S") S RETVAL=RETVAL_"ACCEPTED" Q
53 . S RETVAL=RETVAL_"OTHER"
54 ; Response not received yet
55 I 'RESP S RETVAL="E OTHER" Q RETVAL
56 S RESP500=$$RESP500^BPSOSQ4(RESP,"I")
57 N POS S POS=$$GET1^DIQ(FILENUM,N_",",14)
58 S X=$$RESP1000^BPSOSQ4(RESP,POS,"I")
59 I X="P"!(X="DP") Q "E PAYABLE"
60 I X="D" Q "E DUPLICATE" ; SHOULD NEVER HAPPEN as of 02/06/2001
61 I X="R" Q "E REJECTED"
62 I X="C"!(X="DC") Q "E CAPTURED"
63 ; 1000 indefinite, fall back to 500
64 I RESP500="R" Q "E REJECTED"
65 Q "E OTHER" ; corrupt?
Note: See TracBrowser for help on using the repository browser.