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

IBORAT2C.m

Go to the documentation of this file.
IBORAT2C	;ALB/RJS - OUTPUT ROUTINE FOR BILLING RATES REPORT - 1/22/92
	;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
START	;
	S IBROUT="IBORAT2B",IBOUTPUT=0
	S IBSPEC="",IBOLDSPC=""
	F  S IBSPEC=$O(^TMP($J,IBROUT,IBSPEC)) Q:IBSPEC=""!(IBDONE)  D IBEFFDAT
END	;
	K IBCANCEL,IBEFFDAT,IBDATA,IBOLDSPC,IBREVCD,IBREVCDE,IBREVFLG,IBROUT,IBSPEC,X,Y,IBAAA,C
	Q
IBEFFDAT	;
	S IBEFFDAT=-1
	F  S IBEFFDAT=$O(^TMP($J,IBROUT,IBSPEC,IBEFFDAT)) Q:IBEFFDAT=""!(IBDONE)  D IBREVCDE
	Q
IBREVCDE	;
	S IBREVCDE="",IBREVFLG=0
	F  S IBREVCDE=$O(^TMP($J,IBROUT,IBSPEC,IBEFFDAT,IBREVCDE)) Q:IBREVCDE=""!(IBDONE)  D IBPAYORS
	Q
IBPAYORS	;
	S IBPAYORS=""
	F  S IBPAYORS=$O(^TMP($J,IBROUT,IBSPEC,IBEFFDAT,IBREVCDE,IBPAYORS)) Q:IBPAYORS=""!(IBDONE)  D OUTPUT:$$SELECT(IBPAYORS)
	Q
OUTPUT	;
	I IBREVFLG=0 W ! S IBREVFLG=1
	I IBOUTPUT=0 D IBTITLE S (IBOUTPUT,IBZ)=1
	I IBOLDSPC'=IBSPEC&($Y+8>IOSL) S IBOLDSPC=IBSPEC D HEADING G LINE
	I IBOLDSPC'=IBSPEC S IBOLDSPC=IBSPEC D SUBHEAD
LINE	;
	I IBDONE Q
	D:$Y+4>IOSL HEADING
	I IBDONE Q
	S IBDATA=^TMP($J,"IBORAT2B",IBSPEC,IBEFFDAT,IBREVCDE,IBPAYORS)
	S Y=IBEFFDAT D DD^%DT
	S IBREVCD=$G(^DGCR(399.2,IBREVCDE,0)),IBREVCD=$P(IBREVCD,U,1)
	;AMOUNT=PIECE 2, ACTIVE=PIECE 4, PAYORS CODE=PIECE 3,NON STANDARD=$P 5
	W !,?2,Y,?19,"$",$P(IBDATA,U,2),?27,IBREVCD
	S Y=$P(IBDATA,U,4),C=$P(^DD(399.5,.05,0),U,2) D Y^DIQ W ?37,$S(Y="YES, ACTIVE":"YES",1:"NO")
	S Y=IBPAYORS,C=$P(^DD(399.5,.06,0),U,2) D Y^DIQ W ?45,$E(Y,1,20)
	S Y=$P(IBDATA,U,5),C=$P(^DD(399.5,.07,0),U,2) D Y^DIQ W ?70,$S(Y="YES":"YES",1:"NO")
	Q
SUBHEAD	;
	W !!,IBSPEC,!,?2,"Effective Date",?19,"Amount",?27,"Rev Code",?37,"Active",?45,"Payors to use",?66,"Non-Standard"
	Q
HEADING	;
	F IBAAA=$Y:1:(IOSL-3) W !
	I ($E(IOST,1,2)="C-")
	I  S DIR(0)="E" D ^DIR K DIR I Y=0!(Y="")!($D(DIRUT)) S IBDONE=1 Q
	D IBTITLE,SUBHEAD
	Q
IBTITLE	;
	W @IOF,!,IBTODAY,?25,IBTITLE,?68,"   PAGE ",IBPAGE
	D DATES
	S X="",$P(X,"=",IOM)="" W X
	S IBPAGE=IBPAGE+1
	Q
DATES	;
	I IBSDATE=IBEDATE W !,?25,"   Rates in effect on: ",IBSDATE,! Q
	W !,?25,"   Rates in effect from: ",IBSDATE
	W !,?25,"                     to: ",IBEDATE,!
	Q
SELECT(IBPAYORS)	;
	S IBCANCEL=$P(^TMP($J,IBROUT,IBSPEC,IBEFFDAT,IBREVCDE,IBPAYORS),U,1)
	I (IBSTDATE'>IBEFFDAT)&(IBENDATE'<IBEFFDAT) Q 1
	I (IBSTDATE'<IBEFFDAT)&(IBSTDATE'>IBCANCEL) Q 1
	Q 0