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

IBOTR4.m

Go to the documentation of this file.
IBOTR4	;ALB/CPM - INSURANCE PAYMENT TREND REPORT - OUTPUT (CON'T.) ; 31-DEC-91
	;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
	;
	;MAP TO DGCROTR4
	;
ADDFLD	; Build descriptive title for BILL/CLAIMS field.
	S IBAFT=IBAFN_":  "
	I IBAFD S IBAFT=IBAFT_$S(IBAFF=0&(IBAFL=9999999):"ALL DATES",IBAFF=0:"ALL DATES THROUGH "_$$DATE^IBOTR3(IBAFL),IBAFL=9999999:"ALL DATES ON AND AFTER "_$$DATE^IBOTR3(IBAFL),1:$$DATE^IBOTR3(IBAFF)_" THROUGH "_$$DATE^IBOTR3(IBAFL)) Q
	I $D(IBAFZ) S IBAFT=IBAFT_$S(IBAFZ="ALL":"ALL VALUES",1:"NULL VALUES ONLY") Q
	I IBAFF="@" S IBAFT=IBAFT_$S(IBAFL]"":"ALL VALUES THROUGH "_IBAFL_", INCLUDING NULLS",1:"ALL VALUES, INCLUDING NULLS") Q
	S IBAFT=IBAFT_$S(IBAFF']"":"ALL VALUES THROUGH "_IBAFL,IBAFL']"":"ALL VALUES FOLLOWING "_IBAFF,1:"ALL VALUES BETWEEN "_IBAFF_" AND "_IBAFL)
	Q
	;
SUBTOT	; Calculate and write sub-totals for each Insurance Company.
	I $Y>(IOSL-5) S IBCALC=5 D PAUSE^IBOTR3 Q:IBQUIT  D HDR^IBOTR3,INSADD^IBOTR3
	W !?80,"---------",?90,"---------",?101,"---------",?111,"---------",?122,"---------"
	W !,"TOTAL NUMBER OF BILLS:  ",$P(IBTI,"^"),?80,$J($P(IBTI,"^",2),9,2)
	W ?90,$J($P(IBTI,"^",3),9,2),?101,$J($P(IBTI,"^",2)-$P(IBTI,"^",3),9,2),?111,$J($P(IBTI,"^",4),9,2)
	W ?123,$J($S('$P(IBTI,"^",2):0,1:$P(IBTI,"^",3)/$P(IBTI,"^",2)*100),6,2)
	Q
	;
GTOT	; Calculate and write grand totals for report.
	I $Y>(IOSL-11) S IBCALC=11 D PAUSE^IBOTR3 Q:IBQUIT  D HDR^IBOTR3
	W !!!,?6,"GRAND TOTAL NUMBER OF BILLS:",?44,$J($P(IBTT,"^"),4)
	W !?6,"GRAND TOTAL AMOUNT BILLED:",?38,$J($P(IBTT,"^",2),10,2)
	W !?6,"GRAND TOTAL AMOUNT COLLECTED:",?38,$J($P(IBTT,"^",3),10,2)
	W !?6,"GRAND TOTAL AMOUNT UNPAID:",?38,$J($P(IBTT,"^",2)-$P(IBTT,"^",3),10,2)
	W !?6,"GRAND TOTAL AMOUNT PENDING:",?38,$J($P(IBTT,"^",4),10,2)
	W !?6,"PERCENTAGE COLLECTED:"
	W ?42,$J($S('$P(IBTT,"^",2):0,1:$P(IBTT,"^",3)/$P(IBTT,"^",2)*100),6,2)
	S IBCALC=3 D PAUSE^IBOTR3
	Q