Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: RCDMBWLR

RCDMBWLR.m

Go to the documentation of this file.
  1. RCDMBWLR ;WISC/RFJ-diagnostic measures workload report (build it) ;1 Jan 01
  1. ;;4.5;Accounts Receivable;**167**;Mar 20, 1995
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. Q
  1. ;
  1. ;
  1. DQ ; called by nightly background job
  1. ;
  1. N RCASSIGN,RCBALANC,RCBILLDA,RCCLERK,RCDATA0,RCDATA1,RCDATA2,RCDATA7,RCDATA6
  1. N RCDEBT,RCDEBTDA,RCDPDATA,RCFDEATH,RCIFDESC,RCIFSTAT,RCNAME,RCSSN,RCRC
  1. K ^TMP("RCDMBWLR",$J)
  1. ;
  1. ; loop all workload assignments and generate logic to screen bills
  1. S RCWLFLG=0
  1. S RCCLERK=0 F S RCCLERK=$O(^IBE(351.73,RCCLERK)) Q:'RCCLERK D
  1. . S RCASSIGN=0 F S RCASSIGN=$O(^IBE(351.73,RCCLERK,1,RCASSIGN)) Q:'RCASSIGN D I RCIFSTAT'="" D BUILDIF^RCDMBWLA S RCWLFLG=1
  1. . . ;
  1. . . S RCIFSTAT=""
  1. . . S RCIFDESC=""
  1. . . ;
  1. . . ;
  1. . . ; screen on all bills by category or minimum balance
  1. . . S RCDATA0=$G(^IBE(351.73,RCCLERK,1,RCASSIGN,0))
  1. . . I $P(RCDATA0,"^",2)!($P(RCDATA0,"^",3)) D
  1. . . . ; screen on category
  1. . . . I $P(RCDATA0,"^",2) D
  1. . . . . S RCIFSTAT="I $P(RCDATA0,U,2)="_$P(RCDATA0,"^",2)_" "
  1. . . . . S RCIFDESC="[CATEGORY equals "_$P($G(^PRCA(430.2,+$P(RCDATA0,"^",2),0)),"^")_"]"
  1. . . . ; screen on minimum bill balance
  1. . . . I $P(RCDATA0,"^",3) D
  1. . . . . S RCIFSTAT=RCIFSTAT_"I RCBALANC>"_($P(RCDATA0,"^",3)-.01)_" "
  1. . . . . I RCIFDESC'="" S RCIFDESC=RCIFDESC_" AND "
  1. . . . . S RCIFDESC=RCIFDESC_"[MINIMUM BILL BALANCE greater than "_$J($P(RCDATA0,"^",3)-.01,0,2)_"]"
  1. . . . I $P(RCDATA0,"^",5) D
  1. . . . . S RCIFSTAT=RCIFSTAT_"I 'RCRC "
  1. . . . . S RCIFDESC=RCIFDESC_"[EXCLUDE REGIONAL COUNSEL RECEIVABLES]"
  1. . . ;
  1. . . ;
  1. . . ; screen on bill by first party
  1. . . S RCDATA1=$G(^IBE(351.73,RCCLERK,1,RCASSIGN,1))
  1. . . I $TR(RCDATA1,"^")'="" D Q
  1. . . . ;
  1. . . . ; screen on first party
  1. . . . S RCIFSTAT=RCIFSTAT_"I RCDEBT[""DPT("" "
  1. . . . ;
  1. . . . ; screen on days since last payment
  1. . . . I $P(RCDATA1,"^") D
  1. . . . . S RCIFSTAT=RCIFSTAT_"I $$PAYDAYS^RCDMBWLA(RCBILLDA)>"_$P(RCDATA1,"^")_" "
  1. . . . . S RCIFDESC=RCIFDESC_"[DAYS SINCE LAST PAYMENT greater than "_$P(RCDATA1,"^")_"]"
  1. . . . ;
  1. . . . ; screen on first patient name last patient name
  1. . . . I $P(RCDATA1,"^",2)'=""!($P(RCDATA1,"^",3)'="") D Q
  1. . . . . ; if first patient name is null, set to @ char (before A)
  1. . . . . I $P(RCDATA1,"^",2)="" S $P(RCDATA1,"^",2)=$C(64)
  1. . . . . ; if last patient name is null, set to / char (after Z)
  1. . . . . I $P(RCDATA1,"^",3)="" S $P(RCDATA1,"^",3)=$C(92)
  1. . . . . ;
  1. . . . . S RCIFSTAT=RCIFSTAT_"I RCNAME]"_$C(34)_$P(RCDATA1,"^",2)_$C(34)_",RCNAME']"_$C(34)_$P(RCDATA1,"^",3)_$C(34)_" "
  1. . . . . ;
  1. . . . . ; if first patient name is null, set variable for description
  1. . . . . I $P(RCDATA1,"^",2)=$C(64) S $P(RCDATA1,"^",2)="<first>"
  1. . . . . ; if last patient name is null, set variable for desctription
  1. . . . . I $P(RCDATA1,"^",3)=$C(92) S $P(RCDATA1,"^",3)="<last>"
  1. . . . . S RCIFDESC=RCIFDESC_"[PATIENT NAME is after "_$P(RCDATA1,"^",2)_" and before "_$P(RCDATA1,"^",3)_"]"
  1. . . . ;
  1. . . . ; screen on social security number
  1. . . . I $P(RCDATA1,"^",4)'=""!($P(RCDATA1,"^",5)'="") D Q
  1. . . . . ; if first ssn is null, set starting point
  1. . . . . I $P(RCDATA1,"^",4)="" S $P(RCDATA1,"^",4)="0000"
  1. . . . . ; if last ssn is null, set ending point
  1. . . . . I $P(RCDATA1,"^",5)="" S $P(RCDATA1,"^",5)="9999"
  1. . . . . ;
  1. . . . . S RCIFSTAT=RCIFSTAT_"I RCSSN]"_$C(34)_$P(RCDATA1,"^",4)_$C(34)_",RCSSN']"_$C(34)_$P(RCDATA1,"^",5)_$C(34)
  1. . . . . ;
  1. . . . . ; if first ssn is null, set variable for description
  1. . . . . I $P(RCDATA1,"^",4)="0000" S $P(RCDATA1,"^",4)="<first>"
  1. . . . . ; if last ssn is null, set variable for desctription
  1. . . . . I $P(RCDATA1,"^",5)="9999" S $P(RCDATA1,"^",5)="<last>"
  1. . . . . S RCIFDESC=RCIFDESC_"[PATIENT SSN is after "_$P(RCDATA1,"^",4)_" and before "_$P(RCDATA1,"^",5)_"]"
  1. . . ;
  1. . . ;
  1. . . ; screen on bills by third party
  1. . . S RCDATA2=$G(^IBE(351.73,RCCLERK,1,RCASSIGN,2))
  1. . . I $TR(RCDATA2,"^")'="" D Q
  1. . . . ; screen on third party
  1. . . . S RCIFSTAT=RCIFSTAT_"I RCDEBT[""DIC(36"" "
  1. . . . ; screen on days since transaction days
  1. . . . I $P(RCDATA2,"^") D
  1. . . . . S RCIFSTAT=RCIFSTAT_"I $$TRANDAYS^RCDMBWLA(RCBILLDA)>"_$P(RCDATA2,"^")_" "
  1. . . . . S RCIFDESC=RCIFDESC_"[DAYS SINCE LAST TRANSACTION greater than "_$P(RCDATA2,"^")_"]"
  1. . . . ; screen on receivable type
  1. . . . D RECTYP^RCDMBWLA
  1. . . . ; screen on first insurance name and last insurance name
  1. . . . I $P(RCDATA2,"^",2)'=""!($P(RCDATA2,"^",3)'="") D
  1. . . . . ; if first insurance name is null, set to @ char (before A)
  1. . . . . I $P(RCDATA2,"^",2)="" S $P(RCDATA2,"^",2)=$C(64)
  1. . . . . ; if last insurance name is null, set to \ char (after Z)
  1. . . . . I $P(RCDATA2,"^",3)="" S $P(RCDATA2,"^",3)=$C(92)
  1. . . . . ;
  1. . . . . S RCIFSTAT=RCIFSTAT_"I RCNAME]"_$C(34)_$P(RCDATA2,"^",2)_$C(34)_",RCNAME']"_$C(34)_$P(RCDATA2,"^",3)_$C(34)_" "
  1. . . . . ;
  1. . . . . ; if first insurance company name is null, set variable for description
  1. . . . . I $P(RCDATA2,"^",2)=$C(64) S $P(RCDATA2,"^",2)="<first>"
  1. . . . . ; if last insurance company name is null, set variable for desctription
  1. . . . . I $P(RCDATA2,"^",3)=$C(92) S $P(RCDATA2,"^",3)="<last>"
  1. . . . . S RCIFDESC=RCIFDESC_"[INSURANCE COMPANY NAME is after "_$P(RCDATA2,"^",2)_" and before "_$P(RCDATA2,"^",3)_"]"
  1. . . . ;
  1. . . . ; screen on first patient name last patient name
  1. . . . I $P(RCDATA2,"^",4)'=""!($P(RCDATA2,"^",5)'="") D Q
  1. . . . . ; if first patient name is null, set to @ char (before A)
  1. . . . . I $P(RCDATA2,"^",4)="" S $P(RCDATA2,"^",4)=$C(64)
  1. . . . . ; if last patient name is null, set to / char (after Z)
  1. . . . . I $P(RCDATA2,"^",5)="" S $P(RCDATA2,"^",5)=$C(92)
  1. . . . . ;
  1. . . . . S RCIFSTAT=RCIFSTAT_"I RCPTNAM]"_$C(34)_$P(RCDATA2,"^",4)_$C(34)_",RCPTNAM']"_$C(34)_$P(RCDATA2,"^",5)_$C(34)_" "
  1. . . . . ;
  1. . . . . ; if first patient name is null, set variable for description
  1. . . . . I $P(RCDATA2,"^",4)=$C(64) S $P(RCDATA2,"^",4)="<first>"
  1. . . . . ; if last patient name is null, set variable for description
  1. . . . . I $P(RCDATA2,"^",5)=$C(92) S $P(RCDATA2,"^",5)="<last>"
  1. . . . . S RCIFDESC=RCIFDESC_"[PATIENT NAME is after "_$P(RCDATA2,"^",4)_" and before "_$P(RCDATA2,"^",5)_"]"
  1. . . . ;
  1. . . . ; screen on social security number
  1. . . . I $P(RCDATA2,"^",6)'=""!($P(RCDATA2,"^",7)'="") D Q
  1. . . . . ; if first ssn is null, set starting point
  1. . . . . I $P(RCDATA2,"^",6)="" S $P(RCDATA2,"^",6)="0000"
  1. . . . . ; if last ssn is null, set ending point
  1. . . . . I $P(RCDATA2,"^",7)="" S $P(RCDATA2,"^",7)="9999"
  1. . . . . ;
  1. . . . . S RCIFSTAT=RCIFSTAT_"I RCSSN]"_$C(34)_$P(RCDATA2,"^",6)_$C(34)_",RCSSN']"_$C(34)_$P(RCDATA2,"^",7)_$C(34)
  1. . . . . ;
  1. . . . . ; if first ssn is null, set variable for description
  1. . . . . I $P(RCDATA2,"^",6)="0000" S $P(RCDATA2,"^",6)="<first>"
  1. . . . . ; if last ssn is null, set variable for desctription
  1. . . . . I $P(RCDATA2,"^",7)="9999" S $P(RCDATA2,"^",7)="<last>"
  1. . . . . S RCIFDESC=RCIFDESC_"[PATIENT SSN is after "_$P(RCDATA2,"^",6)_" and before "_$P(RCDATA2,"^",7)_"]"
  1. . . . ;
  1. . . ;
  1. . . ; clerk has no assignment, quit
  1. . . Q
  1. ;
  1. ;
  1. I RCWLFLG D LOOP^RCDMBWLA
  1. ;
  1. I RCWLFLG D REPORT^RCDMBWL1
  1. ;
  1. K ^TMP("RCDMBWLR",$J),RCWLFLG
  1. Q
  1. ;