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

BARRNBRF.m

Go to the documentation of this file.
BARRNBRF ; IHS/SD/POT - Non Ben Payment Report PART5
 ;;1.8;IHS ACCOUNTS RECEIVABLE;**24**;OCT 26, 2005;Build 69
 ; IHS/SD/POT 07/15/13 HEAT114352 NEW REPORT BAR*1.8*24
 ;
 ;; OVERFLOW FROM BARRNBRA
 Q
 ; **
100 N BAR1,BAR2,BAR3,BAR4,BAR5,BARTMP
 S BARNIL="^^^^"
 S ^TMP($J,"BAR-NBRT")=BARNIL
 S BAR1="" F  S BAR1=$O(^TMP($J,"BAR-NBRT",BAR1)) Q:BAR1=""  D
 . S ^TMP($J,"BAR-NBRT",BAR1)=BARNIL
 . S BAR3="" F  S BAR3=$O(^TMP($J,"BAR-NBRT",BAR1,BAR3)) Q:BAR3=""  D
 . . S ^TMP($J,"BAR-NBRT",BAR1,BAR3)=BARNIL
 . . S BAR4="" F  S BAR4=$O(^TMP($J,"BAR-NBRT",BAR1,BAR3,BAR4)) Q:BAR4=""  D
 . . . S ^TMP($J,"BAR-NBRT",BAR1,BAR3,BAR4)=BARNIL
 . . . S BARY="" F  S BARY=$O(^TMP($J,"BAR-NBRT",BAR1,BAR3,BAR4,BARY)) Q:BARY=""  D
 . . . . S BARTMP=$G(^TMP($J,"BAR-NBRT",BAR1,BAR3,BAR4,BARY))
 . . . . S BARTOT=^TMP($J,"BAR-NBR9",BARY)
 . . . . S ^TMP($J,"BAR-NBRT",BAR1,BAR3,BAR4,BARY)=BARTOT_"^"_$P(BARTMP,"^",5)
 . . . . S BARTMP=^TMP($J,"BAR-NBRT",BAR1,BAR3,BAR4)
 . . . . F I=1:1:4 S $P(BARTMP,U,I)=$P(BARTOT,U,I)+$P(BARTMP,U,I)
 . . . . S ^TMP($J,"BAR-NBRT",BAR1,BAR3,BAR4)=BARTMP
 . . . . S BARTMP=^TMP($J,"BAR-NBRT",BAR1,BAR3)
 . . . . F I=1:1:4 S $P(BARTMP,U,I)=$P(BARTOT,U,I)+$P(BARTMP,U,I)
 . . . . S ^TMP($J,"BAR-NBRT",BAR1,BAR3)=BARTMP
 . . . . S BARTMP=^TMP($J,"BAR-NBRT",BAR1)
 . . . . F I=1:1:4 S $P(BARTMP,U,I)=$P(BARTOT,U,I)+$P(BARTMP,U,I)
 . . . . S ^TMP($J,"BAR-NBRT",BAR1)=BARTMP
 . . . . S BARTMP=$G(^TMP($J,"BAR-NBRT"))
 . . . . F I=1:1:4 S $P(BARTMP,U,I)=$P(BARTOT,U,I)+$P(BARTMP,U,I)
 . . . . S ^TMP($J,"BAR-NBRT")=BARTMP
 Q
110 N BAR1,BAR2,BARY,BARTMP
 S BARNIL="^^^^"
 S ^TMP($J,"BAR-NBR")=BARNIL
 S BAR1="" F  S BAR1=$O(^TMP($J,"BAR-NBR",BAR1)) Q:BAR1=""  D
 . S ^TMP($J,"BAR-NBR",BAR1)=BARNIL
 . S BAR2="" F  S BAR2=$O(^TMP($J,"BAR-NBR",BAR1,BAR2)) Q:BAR2=""  D
 . . S ^TMP($J,"BAR-NBR",BAR1,BAR2)=BARNIL
 . . S BARY="" F  S BARY=$O(^TMP($J,"BAR-NBR",BAR1,BAR2,BARY)) Q:BARY=""  D
 . . . S BARTOT=^TMP($J,"BAR-NBR9",BARY)
 . . . S BARTMP=^TMP($J,"BAR-NBR",BAR1,BAR2)
 . . . F I=1:1:4 S $P(BARTMP,U,I)=$P(BARTOT,U,I)+$P(BARTMP,U,I)
 . . . S ^TMP($J,"BAR-NBR",BAR1,BAR2)=BARTMP
 . . . S BARTMP=^TMP($J,"BAR-NBR",BAR1)
 . . . F I=1:1:4 S $P(BARTMP,U,I)=$P(BARTOT,U,I)+$P(BARTMP,U,I)
 . . . S ^TMP($J,"BAR-NBR",BAR1)=BARTMP
 . . . S BARTMP=$G(^TMP($J,"BAR-NBR"))
 . . . F I=1:1:4 S $P(BARTMP,U,I)=$P(BARTOT,U,I)+$P(BARTMP,U,I)
 . . . S ^TMP($J,"BAR-NBR")=BARTMP
 Q
ADDUPTR(BARY,BARBL) ;
 ;TXD LEVEL: BARTR("DT")^BARTR("T")^BARCR^BARDB^BARPAY^BARADJ^BARPAYAD^BARFLG 
 ;BILL LEVEL: BILL_NUMBER-FULL^BILLED^BALANCE^INS^PAT^PATIENT_IEN
 ;SUM UP BILL (XXXXX-A) WITH PAYMENTS (INS or PAT)
 N BARTR,BARTOT,BARP,BARDATA,I,J,BARFLG,BARAMT,BARTOT,BARPTR
 S BARTOT=^TMP($J,"BAR-NBR9",BARY,BARBL)
 S BARTR="" F  S BARTR=$O(^TMP($J,"BAR-NBR9",BARY,BARBL,BARTR)) Q:+BARTR=0  D
 . S BARDATA=^TMP($J,"BAR-NBR9",BARY,BARBL,BARTR)
 . S BARFLG=$P(BARDATA,"^",8)
 . S BARAMT=$P(BARDATA,"^",7)
 . S BARPTR=4 ;INS
 . I BARFLG S BARPTR=5 ;PAT
 . S $P(BARTOT,"^",BARPTR)=$P(BARTOT,"^",BARPTR)+BARAMT
 S ^TMP($J,"BAR-NBR9",BARY,BARBL)=BARTOT
 Q
ADDUPBL(BARY) ;
 ;FROM BILL_NUMBER-FULL^BILLED^BALANCE^INS^PAT^PATIENT_IEN
 ;TO: ^BILLED^INS^PAT^^BALANCE
 N BARTOT,BARP,BARDATA,I,J,BARBL,BARDATA
 S BARTOT=""
 S BARBL="" F  S BARBL=$O(^TMP($J,"BAR-NBR9",BARY,BARBL)) Q:+BARBL=0  D
 . S BARDATA=^TMP($J,"BAR-NBR9",BARY,BARBL)
 . S $P(BARTOT,"^",1)=$P(BARTOT,"^",1)+$P(BARDATA,"^",2) ;BILLED
 . S $P(BARTOT,"^",4)=$P(BARTOT,"^",4)+$P(BARDATA,"^",3) ;BAL
 . S $P(BARTOT,"^",2)=$P(BARTOT,"^",2)+$P(BARDATA,"^",4) ;INS
 . S $P(BARTOT,"^",3)=$P(BARTOT,"^",3)+$P(BARDATA,"^",5) ;PAT
 S ^TMP($J,"BAR-NBR9",BARY)=BARTOT
 Q
 ;---EOR----------