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

BMCRR13P.m

Go to the documentation of this file.
BMCRR13P ; IHS/PHXAO/TMJ - PRNT REFERRALS ;  
 ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
START ;
 S BMC80E="==============================================================================="
 S BMC80D="-------------------------------------------------------------------------------"
 I '$D(^XTMP("BMCRR13",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 BMCPRV="" K BMCQUIT
 F  S BMCPRV=$O(^XTMP("BMCRR13",BMCJOB,BMCBT,"DATA HITS",BMCPRV)) Q:BMCPRV=""!($D(BMCQUIT))  D PRINT
 G:$D(BMCQUIT) DONE
 I $Y>(IOSL-6) D HEAD G:$D(BMCQUIT) DONE
DONE ;
 K ^XTMP("BMCRR13",BMCJOB,BMCBT)
 D DONE^BMCRLP2
 Q
PRINT ;print one referral
 I BMCSPAGE=1 D HEAD Q:$D(BMCQUIT)
 I BMCSPAGE'=1 W !
 W !,"REQUESTING PROVIDER:  ",BMCPRV
 S BMCREF=0 F  S BMCREF=$O(^XTMP("BMCRR13",BMCJOB,BMCBT,"DATA HITS",BMCPRV,BMCREF)) Q:BMCREF'=+BMCREF!($D(BMCQUIT))  S BMCRREC=^BMCREF(BMCREF,0),DFN=$P(BMCRREC,U,3) D PRINT1
 Q
PRINT1 ;
 S BMCFAC=$$FACREF^BMCRLU(BMCREF) S:BMCFAC="" BMCFAC="--"
 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 ?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 X="ACTIVE REFERRALS BY REQUESTING PROVIDER"
 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,"FACILITY REFERRED TO"
 W !,BMC80D
 Q