1 | BPSOSQF ;BHAM ISC/FCS/DRS/FLS - Insurer asleep - status 31 ;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 | ;
|
---|
6 | ; Check for insurer asleep claims
|
---|
7 | ;
|
---|
8 | STATUS31 ;EP - BPSOSQ2
|
---|
9 | ; Situation: you have 1 or 2 or maybe 200 claims in status 31,
|
---|
10 | ; because we've determined that the insurer is asleep.
|
---|
11 | ; change at most one claim per insurer to status 30, to let it
|
---|
12 | ; go through and try again. But if the insurer is awake for sure,
|
---|
13 | ; let all of the claims for that insurer go on through.
|
---|
14 | ;
|
---|
15 | ; Initialization
|
---|
16 | N RETRY,PROBER,IEN59,PAYERSH,X
|
---|
17 | S IEN59=""
|
---|
18 | K ^TMP("BPSOSQF",$J) ; build ^TMP("BPSOSQF",$J,PAYERSH,IEN59)=""
|
---|
19 | ;
|
---|
20 | ; Make sure we can get the lock
|
---|
21 | I '$$LOCK59^BPSOSQ2(31) Q
|
---|
22 | ;
|
---|
23 | ; Loop through transaction that are 31 per cent
|
---|
24 | F S IEN59=$$NEXT59^BPSOSQ2(IEN59,31) Q:'IEN59 D
|
---|
25 | . ; if $$NEXT59() returned us an IEN59, then the waiting time
|
---|
26 | . ; has expired - or better yet, the insurer has awakened
|
---|
27 | . ;
|
---|
28 | . ; Get the payer sheet for the transaction
|
---|
29 | . S PAYERSH=$$PAYERSH(IEN59)
|
---|
30 | . I PAYERSH="" D LOG^BPSOSL(IEN59,$T(+0)_"-No payersheet was found") Q
|
---|
31 | . ;
|
---|
32 | . ; Get Retry Time and Prober
|
---|
33 | . S X=$G(^BPSF(9002313.92,PAYERSH,1))
|
---|
34 | . S RETRY=$P(X,U,12),PROBER=$P(X,U,11)
|
---|
35 | . ;
|
---|
36 | . ; If still in wait, but wait expired, just allow one claim thru.
|
---|
37 | . ; But if wait has been canceled - that is, we had a successful
|
---|
38 | . ; transmit, meaning the insurer has awakened - then let them all
|
---|
39 | . ; go through to status 30.
|
---|
40 | . ; if somehow the prober became complete, without clearing 101;6
|
---|
41 | . ; (maybe this happens if cancellation takes place?)
|
---|
42 | . I PROBER D
|
---|
43 | .. S X=$P($G(^BPST(PROBER,0)),U,2)
|
---|
44 | .. I X=99!(X="") S PROBER=""
|
---|
45 | . I RETRY,PROBER,PROBER'=IEN59 Q ; only prober can go thru during wait
|
---|
46 | . ;
|
---|
47 | . ; Don't we need to compare RETRY time to the current time?
|
---|
48 | . I RETRY S $P(^BPSF(9002313.92,PAYERSH,1),U,11)=IEN59,PROBER=IEN59
|
---|
49 | . S ^TMP("BPSOSQF",$J,PAYERSH,IEN59)=""
|
---|
50 | D UNLOCK59^BPSOSQ2(31)
|
---|
51 | ;
|
---|
52 | ; Loop through payer sheet and transactions and change status to 30%
|
---|
53 | S PAYERSH="" F S PAYERSH=$O(^TMP("BPSOSQF",$J,PAYERSH)) Q:'PAYERSH D
|
---|
54 | . S IEN59="" F S IEN59=$O(^TMP("BPSOSQF",$J,PAYERSH,IEN59)) Q:'IEN59 D
|
---|
55 | . . D SETSTAT^BPSOSU(IEN59,30) ; reset to status 30
|
---|
56 | . . D LOG^BPSOSL(IEN59,$T(+0)_"-Retrying Asleep Claim. Prober? "_$S(PROBER=IEN59:"YES",1:"NO"))
|
---|
57 | Q
|
---|
58 | ;
|
---|
59 | ; Function to get the payer sheet for a given transaction
|
---|
60 | PAYERSH(IEN59) ;
|
---|
61 | N POS
|
---|
62 | S POS=$P($G(^BPST(IEN59,9)),U,1)
|
---|
63 | I POS="" Q ""
|
---|
64 | Q $$GET1^DIQ(9002313.59902,POS_","_IEN59_",",902.02,"I")
|
---|