[613] | 1 | RCRCREC3 ;ALB/CMS - PARSE RC/AR DATA FOR RECONCILIATION
|
---|
| 2 | V ;;4.5;Accounts Receivable;**63,122**;Mar 20, 1995
|
---|
| 3 | ;;Per VHA Directive 10-93-142, this routine should not be modified.
|
---|
| 4 | ;
|
---|
| 5 | Q
|
---|
| 6 | L433 ;LOOP THRU 433 TO SEE IF BILL WAS DECREASE BEFORE REFERRED
|
---|
| 7 | ;INPUT: BN,MTYP=4,ARLN RCBDT - RCEDT REFERRAL DATE RANGE
|
---|
| 8 | ;QUIT IF BILL REFERRAL DATE NOT IN USER INPUT RANGE
|
---|
| 9 | N TN,TNLN,TNTYP K ERR
|
---|
| 10 | S REFDT=$P(ARLN,U,3)
|
---|
| 11 | I $G(RCBDT)>0,$G(RCEDT)>0 I (REFDT<RCBDT)!(REFDT>RCEDT) G L433Q
|
---|
| 12 | S TN=0 F S TN=$O(^PRCA(433,"C",BN,TN)) Q:('TN)!($O(ERR("MR4",0))) D
|
---|
| 13 | .S TNLN=$G(^PRCA(433,TN,1))
|
---|
| 14 | .I TNLN="" Q
|
---|
| 15 | .S TNTYP=$P(TNLN,U,2) I TNTYP'=35 Q
|
---|
| 16 | .I $P(TNLN,U,1)'>REFDT D
|
---|
| 17 | ..I +$P($G(^PRCA(433,TN,8)),U,8) S ERR("MR4",4)="" Q
|
---|
| 18 | ..S ERR("MR4",11)=""
|
---|
| 19 | L433Q Q
|
---|
| 20 | ;
|
---|
| 21 | SET ;SET TMP WITH THE MESSAGE TYPE PER BILL
|
---|
| 22 | N ERRLN,ERRN,LN,LT,REFDT,X,Y
|
---|
| 23 | N SPBN,SPPT,SPIN S LN=0
|
---|
| 24 | I $G(ARLN)="" G SETB
|
---|
| 25 | S (SPBN,SPPT,SPIN)="",LN=LN+1
|
---|
| 26 | I $P(ARLN,U,1)="" S $P(ARLN,U,1)="UNK"
|
---|
| 27 | I $P(RCLN,U,1)="" S $P(RCLN,U,1)="UNK"
|
---|
| 28 | S Y=$P(ARLN,U,3) D D^DIQ S REFDT=Y
|
---|
| 29 | I $L(REFDT)<10 S $E(REFDT,11)=" "
|
---|
| 30 | I $L(REFDT)=10 S REFDT=REFDT_" "
|
---|
| 31 | S $E(SPBN,(11-$L($E($P(ARLN,U,1),1,11))))=" "
|
---|
| 32 | S $E(SPPT,(15-$L($E($P(ARLN,U,5),1,15))))=" "
|
---|
| 33 | S $E(SPIN,(15-$L($E($P(ARLN,U,2),1,15))))=" "
|
---|
| 34 | ;S LN=+^TMP("PRCA",$J,MTYP,0)
|
---|
| 35 | ;S LN=LN+1,^TMP("PRCA",$J,MTYP,LN)=" "
|
---|
| 36 | ;S LN=LN+1
|
---|
| 37 | S ^TMP("PRCA",$J,"B",MTYP,$S($P($G(ARLN),U,8)]"":$P($G(ARLN),U,8),1:"CAT/UNK"),$S($P(ARLN,U,2)]"":$P(ARLN,U,2),1:"UNK"),$S($P(ARLN,U,5)]"":$P(ARLN,U,5),1:"UNK"),$P(ARLN,U,1))=""
|
---|
| 38 | S ^TMP("PRCA",$J,"C",$P(ARLN,U,1),LN)="AR:"_$P(ARLN,U,1)_$G(SPBN)_" "_$E($P(ARLN,U,5),1,15)_$G(SPPT)_" "_$E($P(ARLN,U,2),1,15)_$G(SPIN)_" "_$S($P(ARLN,U,4)="DC":"RC ",1:$P(ARLN,U,4))_" "_REFDT_" $"_$J($P(ARLN,U,6),10,2)
|
---|
| 39 | ;
|
---|
| 40 | SETB I $G(RCLN)="" G SETC
|
---|
| 41 | S (SPBN,SPPT,SPIN)="",LN=LN+1
|
---|
| 42 | S Y=$P(RCLN,U,3) D D^DIQ S REFDT=Y
|
---|
| 43 | I $L(REFDT)<10 S $E(REFDT,11)=" "
|
---|
| 44 | I $L(REFDT)=10 S REFDT=REFDT_" "
|
---|
| 45 | S $E(SPBN,(11-$L($E($P(RCLN,U,1),1,11))))=" "
|
---|
| 46 | S $E(SPPT,(15-$L($E($P(RCLN,U,5),1,15))))=" "
|
---|
| 47 | S $E(SPIN,(15-$L($E($P(RCLN,U,2),1,15))))=" "
|
---|
| 48 | ;S LN=+^TMP("PRCA",$J,MTYP,0)
|
---|
| 49 | ;S LN=LN+1,^TMP("PRCA",$J,MTYP,LN)=" "
|
---|
| 50 | ;S LN=LN+1
|
---|
| 51 | I $G(ARLN)="" D
|
---|
| 52 | .S ^TMP("PRCA",$J,"B",MTYP,$S($P(RCLN,U,8)]"":$P(RCLN,U,8),1:"CAT/UNK"),$S($P(RCLN,U,2)]"":$P(RCLN,U,2),1:"UNK"),$S($P(RCLN,U,5)]"":$P(RCLN,U,5),1:"UNK"),$S($P(RCLN,U,1)]"":$P(RCLN,U),1:"UNK"))=""
|
---|
| 53 | S ^TMP("PRCA",$J,"C",$S($P(RCLN,U,1)]"":$P(RCLN,U),1:"UNK"),LN)="RC:"_$P(RCLN,U,1)_$G(SPBN)_" "_$E($P(RCLN,U,5),1,15)_$G(SPPT)_" "_$E($P(RCLN,U,2),1,15)_$G(SPIN)_" RC "_REFDT_" $"_$J($P(RCLN,U,6),10,2)
|
---|
| 54 | ;
|
---|
| 55 | SETC S ERRN=0 F S ERRN=$O(ERR(MTYP,ERRN)) Q:'ERRN D
|
---|
| 56 | .S LT="ARR",ERRLN=$T(@LT+ERRN),LN=LN+1
|
---|
| 57 | .S ^TMP("PRCA",$J,"C",$S($P($G(ARLN),U,1)]"":$P(ARLN,U,1),$P($G(RCLN),U,1)]"":$P(RCLN,U,1),1:"UNK"),LN)=" - "_$P(ERRLN,";",4)_" "_$G(ERR(MTYP,ERRN))
|
---|
| 58 | ;S ^TMP("PRCA",$J,MTYP,0)=LN
|
---|
| 59 | SETQ Q
|
---|
| 60 | ;
|
---|
| 61 | SORT ;Set Global for Mail Message
|
---|
| 62 | N A,B,C,D,E,LN,RCA,RCB,RCBSP,RCC,RCD,RCE,X,Y
|
---|
| 63 | F X=1:1:19 S RCBSP=$G(RCBSP)_" "
|
---|
| 64 | S RCA="" F A=1:1 S RCA=$O(^TMP("PRCA",$J,"B",RCA)) Q:RCA="" D
|
---|
| 65 | .S LN=^TMP("PRCA",$J,RCA,0)
|
---|
| 66 | .S RCB="" F B=1:1 S RCB=$O(^TMP("PRCA",$J,"B",RCA,RCB)) Q:RCB="" D
|
---|
| 67 | ..S LN=LN+1,^TMP("PRCA",$J,RCA,LN)="REIMBURS.HEALTH INS."_RCBSP_"Referred To Date Amount"
|
---|
| 68 | ..S LN=LN+1,^TMP("PRCA",$J,RCA,LN)=" "
|
---|
| 69 | ..S RCC="" F C=1:1 S RCC=$O(^TMP("PRCA",$J,"B",RCA,RCB,RCC)) Q:RCC="" D
|
---|
| 70 | ...S RCD="" F D=1:1 S RCD=$O(^TMP("PRCA",$J,"B",RCA,RCB,RCC,RCD)) Q:RCD="" D
|
---|
| 71 | ....S RCE="" F E=1:1 S RCE=$O(^TMP("PRCA",$J,"B",RCA,RCB,RCC,RCD,RCE)) Q:RCE="" D
|
---|
| 72 | .....S LN=LN+1,^TMP("PRCA",$J,RCA,LN)=" "
|
---|
| 73 | .....S X=0 F S X=$O(^TMP("PRCA",$J,"C",RCE,X)) Q:'X D
|
---|
| 74 | ......S LN=LN+1,^TMP("PRCA",$J,RCA,LN)=^TMP("PRCA",$J,"C",RCE,X)
|
---|
| 75 | ......S ^TMP("PRCA",$J,RCA,0)=LN
|
---|
| 76 | SORTQ Q
|
---|
| 77 | ;
|
---|
| 78 | ARR ;GET DATA FOR ERROR TYPES
|
---|
| 79 | ;;1;BILL NAME DOES NOT EXIST IN ACCOUNTS RECEIVABLE
|
---|
| 80 | ;;2;NON-ACTIVE BILL AT SITE, CURRENT AR BILL STATUS IS
|
---|
| 81 | ;;3;DOLLAR AMOUNTS NOT THE SAME
|
---|
| 82 | ;;4;CONTRACTUAL/DECREASE ADJUSTMENT WAS MADE IN AR BEFORE REFERRAL DATE
|
---|
| 83 | ;;5;NO REFERRAL DATE IN THE AR ACCOUNTS RECEIVABLE FILE
|
---|
| 84 | ;;6;AR BILL CATEGORY IS
|
---|
| 85 | ;;7;SITE PROBLEM, AR REF.AMT DOES NOT MATCH AR CURRENT BALANCE OF $
|
---|
| 86 | ;;8;NOT IN USE
|
---|
| 87 | ;;9;BILL SSN FOR PT. IN AR DOES NOT MATCH SSN FOR PT. IN RC
|
---|
| 88 | ;;10;NOT IN USE
|
---|
| 89 | ;;11;DECREASE ADJUSTMENT WAS MADE IN AR BEFORE THE REFERRAL DATE
|
---|
| 90 | ;;END
|
---|
| 91 | Q
|
---|
| 92 | ;RCRCREC3
|
---|