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

BMCRR9P.m

Go to the documentation of this file.
BMCRR9P ; IHS/PHXAO/TMJ - PRNT BILL VSTS ;   
 ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
 ;4.0;IHS/ITSC/FCJ ADDED SEC REF TO REPORT
START ;
 S BMC80E="==============================================================================="
 S BMC80D="-------------------------------------------------------------------------------"
 S BMCPG=0 D @("HEAD"_(2-($E(IOST,1,2)="C-"))) I '$D(^XTMP("BMCRR9",BMCJOB,BMCBT)) W !,"No referrals to report",! G DONE
 S BMCSORT="" K BMCQUIT
 F  S BMCSORT=$O(^XTMP("BMCRR9",BMCJOB,BMCBT,"DATA HITS",BMCSORT)) Q:BMCSORT=""!($D(BMCQUIT))  D PRINT
 G:$D(BMCQUIT) DONE
 I $Y>(IOSL-6) D HEAD G:$D(BMCQUIT) DONE
DONE ;
 K ^XTMP("BMCRR9",BMCJOB,BMCBT)
 D DONE^BMCRLP2
 Q
PRINT ;print one referral
 S BMCREF=0 F  S BMCREF=$O(^XTMP("BMCRR9",BMCJOB,BMCBT,"DATA HITS",BMCSORT,BMCREF)) Q:BMCREF'=+BMCREF!($D(BMCQUIT))  S BMCRREC=^BMCREF(BMCREF,0),DFN=$P(BMCRREC,U,3) D PRINT1
 Q
PRINT1 ;
 I $Y>(IOSL-5) D HEAD Q:$D(BMCQUIT)
 W !,$S(BMCSTYPE="B":$$AVDOS^BMCRLU(BMCREF,"C"),1:$$FMTE^XLFDT($P(BMCRREC,U),"5D"))
 W ?11,$P(BMCRREC,U,2)
 ;4.0;IHS/ITSC/FCJ ADDED SEC REF SUF TO REPORT
 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)
 S BMCFAC=$$FACREF^BMCRLU(BMCREF)
 I BMCFAC="" S BMCFAC="????"
 W ?59,$E(BMCFAC,1,20)
 I $$VAL^XBDIQ1(90001,BMCREF,.09)]"" W !?59,$E($$VAL^XBDIQ1(90001,BMCREF,.09),1,20)
 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 Y=BMCBD D DD^%DT W ?31,"REFERRAL INITIATED",!,?17,"BEG DATE: "_Y
 S Y=BMCED D DD^%DT W ?40,"END DATE: "_Y,!
 S X="ACTIVE REFERRALS SORTED BY "_$S(BMCSTYPE="B":"BEGIN DATE OF SERVICE",1:"DATE INITIATED")
 W ?(80-$L(X))/2,X,!
 W !,?49,"REF"
 W !,$S(BMCSTYPE="B":"BEGIN DOS",1:"INITIATED"),?11,"REFERRAL #",?28,"PATIENT NAME",?49,"PROV",?54,"TYPE",?59,"FACILITY REFERRED TO"
 W !,BMC80D
 Q