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

BMCRR4P.m

Go to the documentation of this file.
BMCRR4P ; IHS/PHXAO/TMJ - PRNT BILL VSTS ;     [ 09/27/2006  2:16 PM ]
 ;;4.0;REFERRED CARE INFO SYSTEM;**1**;JAN 09, 2006;Build 101
 ;4.0*1 3.7.06 IHS/OIT/FCJ MODIFIED TO PRT PROV IN ALPHA ORDER
START ;
 S BMC80E="==============================================================================="
 S BMC80D="-------------------------------------------------------------------------------"
 S BMCPG=0 D @("HEAD"_(2-($E(IOST,1,2)="C-")))
 I '$D(^XTMP("BMCRR4",BMCJOB,BMCBT)) W !,"No data to report",! G DONE
 S BMCPN=0 K BMCQUIT
 ;4.0*1 3.7.06 IHS/OIT/FCJ REWROTE NXT SECTION TO PRT PROV IN ALPHA ORDR
 I BMCTYPE="P" S BMCSORT=0 D
 .F  S BMCSORT=$O(^XTMP("BMCRR4",BMCJOB,BMCBT,"REFERRALS",BMCSORT)) Q:BMCSORT=""!($D(BMCQUIT))  S BMCPN=0 D
 ..F  S BMCPN=$O(^XTMP("BMCRR4",BMCJOB,BMCBT,"REFERRALS",BMCSORT,BMCPN)) Q:BMCPN=""!($D(BMCQUIT))  S BMCX=^XTMP("BMCRR4",BMCJOB,BMCBT,"REFERRALS",BMCPN) D PROC
 E  F  S BMCPN=$O(^XTMP("BMCRR4",BMCJOB,BMCBT,"REFERRALS",BMCPN)) Q:BMCPN=""!($D(BMCQUIT))  S BMCX=^XTMP("BMCRR4",BMCJOB,BMCBT,"REFERRALS",BMCPN) D PROC
 ;4.0*1 3.7.06 IHS/OIT/FCJ END OF REWRITE
DONE ;
 K ^XTMP("BMCRR4",BMCJOB,BMCBT)
 D DONE^BMCRLP2
 Q
PROC ;
 I $Y>(IOSL-5) D HEAD Q:$D(BMCQUIT)
 S X=$S(BMCTYPE="P":$P(^VA(200,BMCPN,0),U),1:$P(^DIC(4,BMCPN,0),U))
 W !,$E(X,1,20),?25,$J($P(BMCX,U),5)
 W ?32,$J($P(BMCX,U,2),5)
 W ?37,$J($P(BMCX,U,3),5)
 W ?43,$J($P(BMCX,U,4),5)
 S X=$S($D(^XTMP("BMCRR4",BMCJOB,BMCBT,"PCC VISITS",BMCPN)):^(BMCPN),1:0)
 W ?50,$J(X,6)
 I X W ?64,$J(($P(BMCX,U)/X)*100,5,0)
 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,!!
 W ?19,"REFERRAL PATTERNS BY REQUESTING ",$S(BMCTYPE="P":"PROVIDER",1:"FACILITY"),!
 S Y=DT D DD^%DT W ?(80-$L(Y)/2),Y
 S Y=BMCBD D DD^%DT W !,?28,"BEG DATE: "_Y
 S Y=BMCED D DD^%DT W !,?28,"END DATE: "_Y,!
 W !,$S(BMCTYPE="P":"PROVIDER",1:"FACILITY"),?23,"# REFS",?33,"IHS",?38,"OTHER",?44,"CHS",?50,"# PCC",?59,"TOTAL REF RATE"
 W !,?23,"INITIATED",?33,"REFS",?38,"REFS",?44,"REFS",?50,"VISITS",?59,"PER 100 PCC VISITS"
 W !,BMC80D
 Q