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

BMCRR10P.m

Go to the documentation of this file.
BMCRR10P ; IHS/PHXAO/TMJ - PRNT BILL VSTS ;   
 ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
 ;IHS/ITSC/FCJ ADDED PRINTING OF SEC REF AND CHG FAC REFERRED TO COLUMN
 ;      TO PRIMARY PAYOR AND ADDED TOTALS
START ;
 S BMC80E="==============================================================================="
 S BMC80D="-------------------------------------------------------------------------------"
 I '$D(^XTMP("BMCRR10",BMCJOB,BMCBT)) S BMCPG=0 D @("HEAD"_(2-($E(IOST,1,2)="C-"))) W !,"No referrals to report",! G DONE
 S BMCPG=0 I 'BMCSPAGE D @("HEAD"_(2-($E(IOST,1,2)="C-")))
 S BMCFAC="" K BMCQUIT
 F  S BMCFAC=$O(^XTMP("BMCRR10",BMCJOB,BMCBT,"DATA HITS",BMCFAC)) Q:BMCFAC=""!($D(BMCQUIT))  D PRINT
 G:$D(BMCQUIT) DONE
 I $Y>(IOSL-6) D HEAD G:$D(BMCQUIT) DONE
DONE ;
 K ^XTMP("BMCRR10",BMCJOB,BMCBT)
 D DONE^BMCRLP2
 Q
PRINT ;print one referral
 I BMCSPAGE=1 D HEAD Q:$D(BMCQUIT)
 I BMCSPAGE'=1 W !
 W !,"FACILITY REFERRED TO:  ",BMCFAC
 S BMCREF=0,BMCCT=0
 F  S BMCREF=$O(^XTMP("BMCRR10",BMCJOB,BMCBT,"DATA HITS",BMCFAC,BMCREF)) Q:BMCREF'=+BMCREF!($D(BMCQUIT))  S BMCRREC=^BMCREF(BMCREF,0),DFN=$P(BMCRREC,U,3) D PRINT1
 W !,"TOTAL = ",BMCCT
 Q
PRINT1 ;
 I $Y>(IOSL-5) D HEAD Q:$D(BMCQUIT)
 W !,$$AVDOS^BMCRLU(BMCREF,"C")
 W ?11,$P(BMCRREC,U,2)
 W $P($G(^BMCREF(BMCREF,1)),U)
 W ?28,$E($P(^DPT(DFN,0),U),1,20)
 W ?49,$S($P(BMCRREC,U,6):$$VAL^XBDIQ1(200,$P(BMCRREC,U,6),1),1:"--")
 W ?54,$E($$VAL^XBDIQ1(90001,BMCREF,.04),1,3)
 W ?61,$$VAL^XBDIQ1(90001,BMCREF,.11)
 S BMCCT=BMCCT+1
 Q
 I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S BMCQUIT="" Q
HEAD1 ;
 W:$D(IOF) @IOF
HEAD2 ;
 S BMCPG=BMCPG+1
 W !?13,"********** CONFIDENTIAL PATIENT INFORMATION **********"
 W !?(80-$L($P(^DIC(4,DUZ(2),0),U))/2),$P(^DIC(4,DUZ(2),0),U),?72,"Page ",BMCPG,!
 S X="ACTIVE REFERRALS BY FACILITY REFERRED TO"
 W ?(80-$L(X))/2,X,!
 S Y=BMCBD D DD^%DT W ?17,"BEG DATE: "_Y
 S Y=BMCED D DD^%DT W ?40,"END DATE: "_Y,!
 W !,?49,"REF"
 W !,"BEGIN DOS",?11,"REFERRAL #",?28,"PATIENT NAME",?49,"PROV",?54,"TYPE",?59,"PRIM PAYOR"
 W !,BMC80D
 Q