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

IBORAT1C.m

Go to the documentation of this file.
IBORAT1C ;ALB/RJS - OUTPUT ROUTINE FOR IB ACTION CHARGES - 2/26/92
 ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
INIT ;
 S Y=DT X ^DD("DD") S IBTODAY=Y
 ;
 ;IBSTDATE & IBENDATE USED BY 2 ROUTINES SO DON'T WANT TO SET THEM HERE
 ;IBSDATE,IBEDATE,IBTODAY,IBTITLE,IBPAGE,IBDONE,IBOUTPUT,IBSTDATE,IBENDATE
 ;USED BY IBORAT2C SO DON'T WANT TO KILL THEM HERE
 ;
 S Y=IBSTDATE D DD^%DT S IBSDATE=Y
 S Y=IBENDATE D DD^%DT S IBEDATE=Y
 S IBTITLE="***Billing Rates Listing***",IBDONE=0,IBPAGE=1
IBSPEC ;
 S IBROUT="IBORAT1A",IBSPEC="",IBOLDSPC=""
 F  S IBSPEC=$O(^TMP($J,IBROUT,IBSPEC)) Q:IBSPEC=""!(IBDONE)  D IBSPEC2
END ;
 K IBAAA,IBCANCEL,IBEFFDAT,IBOLDSPC,IBROUT,IBSPEC,IBX,Y
 Q
IBSPEC2 ;
 S IBEFFDAT=-1
 F  S IBEFFDAT=$O(^TMP($J,IBROUT,IBSPEC,IBEFFDAT)) Q:IBEFFDAT=""!(IBDONE)  D OUTPUT:$$SELECT(IBEFFDAT)
 Q
OUTPUT ;
 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 Y=IBEFFDAT D DD^%DT
 W !,?2,Y,?22,"$",$P(^TMP($J,IBROUT,IBSPEC,IBEFFDAT),U,2)
 I $P(^(IBEFFDAT),U,3) W ?32,"$",$P(^(IBEFFDAT),U,3)
 Q
SUBHEAD ;
 W !!,IBSPEC,!,?2,"Effective Date",?22,"Amount",?32,"Additional Amount"
 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 ; initial form feeds to crts subsequent form feeds to all
 W:$E(IOST,1,2)["C-"!(IBPAGE>1) @IOF W IBTODAY,?25,IBTITLE,?68,"   PAGE ",IBPAGE
 D DATES
 S IBX="",$P(IBX,"=",IOM)="" W IBX
 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(IBEFFDAT) ;
 S IBCANCEL=$P(^TMP($J,IBROUT,IBSPEC,IBEFFDAT),U,1)
 I (IBSTDATE'>IBEFFDAT)&(IBENDATE'<IBEFFDAT) Q 1
 I (IBSTDATE'<IBEFFDAT)&(IBSTDATE'>IBCANCEL) Q 1
 Q 0
 ;