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

BMCRLP2.m

Go to the documentation of this file.
  1. BMCRLP2 ; IHS/PHXAO/TMJ - PRINT REFERRAL REPORT ;
  1. ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
  1. ;
  1. DONE ;EP
  1. D DONE^BMCRLP1
  1. K ^XTMP("BMCRL",BMCJOB,BMCBT)
  1. D DEL^BMCRL
  1. K BMCBD,BMCSD,BMCED,BMCEDD,BMCBDD,BMCRPT,BMCHEAD,BMCLINE,BMCL,BMCRCNT,BMCI,BMCCRIT,BMCREF,BMCRREC,BMCJOB,BMCBT,BMCBTH,BMCQUIT,BMCHDR,BMCDASH,BMCLENG,BMCPCNT,BMCTCW,BMCODAT,BMCPG,AUPNDAYS,AUPNPAT,AUPNDOD,AUPNDOB,AUPNSEX
  1. K BMCSORT,BMCSRT,BMCSORX,BMCFILE,BMCFIEL,BMCPRNT,BMCX,BMCTYPE,BMCFOUN,D0,J,K,L,BMCPRNM,BMCTEST,BMCSEAT,BMCLHDR,BMCFRST,BMCTST
  1. Q
  1. I 'BMCPG G HEAD1
  1. 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
  1. HEAD1 ;EP
  1. W:$D(IOF) @IOF S BMCPG=BMCPG+1
  1. I $G(BMCTITL)="" S BMCTEXT="PCC "_$S(BMCPTVS="R":"REFERRAL",1:"PATIENT")_" LISTING",BMCLENG=$L(BMCTEXT) W !?((BMCTCW-BMCLENG)/2),BMCTEXT,?(BMCTCW-8),"Page ",BMCPG
  1. I $G(BMCTITL)]"" S BMCLENG=$L(BMCTITL) W !?((BMCTCW-BMCLENG)/2),BMCTITL,?(BMCTCW-8),"Page ",BMCPG
  1. ;I BMCTYPE="D" S BMCLENG=46 S:BMCTCW<BMCLENG BMCLENG=BMCTCW W !?((BMCTCW-BMCLENG)/2),"Referral Dates: ",BMCBDD," and ",BMCEDD,!
  1. ;I BMCTYPE="S" S BMCLENG=16+$L($P(^DIBT(BMCSEAT,0),U)) S:BMCTCW<BMCLENG BMCLENG=BMCTCW W !?((BMCTCW-BMCLENG)/2),"Search Template: ",$P(^DIBT(BMCSEAT,0),U),!
  1. I $G(BMCCTYP)="N" S BMCLENG=$L(BMCSORV)+27+$L(^BMCTSORT(BMCNSRT,0),U) W !?((80-BMCLENG)/2),"BASIC STATISTICS FOR: ",$P(^BMCTSORT(BMCNSRT,0),U) W:BMCSORT=6 ! I BMCSORT'=6 W " BY ",BMCSORV,!
  1. I $G(BMCCTYP)="S" S BMCLENG=$L(BMCSORV)+23 W !?((BMCTCW-BMCLENG)/2),$S(BMCPTVS="R":"REFERRAL",1:"PATIENT")," SUB-TOTALS BY: ",BMCSORV,!
  1. I $G(BMCSPAG) S BMCLENG=$L(BMCSORV)+$L(BMCSRTR)+2 S:BMCTCW<BMCLENG BMCLENG=BMCTCW W !?((BMCTCW-BMCLENG)/2),BMCSORV,": ",BMCSRTR,!
  1. I BMCHEAD]"" W !,BMCHEAD,!
  1. I $G(BMCCTYP)="R" W !
  1. W BMCDASH,!
  1. I $G(BMCCTYP)="S" W !,BMCSORV,":"
  1. Q
  1. N ;EP
  1. D HEAD
  1. I '$D(^XTMP("BMCRL",BMCJOB,BMCBTH,"STATS")) W !!,"No records selected." Q
  1. S BMCREF="" F S BMCREF=$O(^XTMP("BMCRL",BMCJOB,BMCBTH,"STATS",BMCREF)) Q:BMCREF=""!($D(BMCQUIT)) S BMCR=^XTMP("BMCRL",BMCJOB,BMCBTH,"STATS",BMCREF) D
  1. .I $Y>(IOSL-10) D HEAD Q:$D(BMCQUIT)
  1. .W !!?5,BMCREF
  1. .W !!?10,"Total referrals selected",?45,$J($P(BMCR,U),12)
  1. .W !?10,"Total referrals w/",$P(^BMCTSORT(BMCNSRT,0),U),?45,$J($P(BMCR,U,6),12)
  1. .S X=$P(BMCR,U,2) I $P(^BMCTSORT(BMCNSRT,0),U,13) S X2="2$",X3=14 D COMMA^%DTC
  1. .W !?10,"Sum",?45,$J(X,14)
  1. .S X=$P(BMCR,U,3) I $P(^BMCTSORT(BMCNSRT,0),U,13) S X2="2$",X3=14 D COMMA^%DTC
  1. .W !?10,"Mean",?45,$J(X,14,2)
  1. .S X=$P(BMCR,U,5) I $P(^BMCTSORT(BMCNSRT,0),U,13) S X2="2$",X3=14 D COMMA^%DTC
  1. .W !?10,"Maximum Value",?45,$J(X,14)
  1. .S X=$P(BMCR,U,4) I $P(^BMCTSORT(BMCNSRT,0),U,13) S X2="2$",X3=14 D COMMA^%DTC
  1. .W !?10,"Minimum Value",?45,$J(X,14)
  1. .Q
  1. I $Y>(IOSL-10) D HEAD
  1. S BMCR=^XTMP("BMCRL",BMCJOB,BMCBTH,"STATS")
  1. W !!?5,"TOTALS"
  1. W !!?10,"Total referrals selected",?45,$J($P(BMCR,U),12)
  1. W !?10,"Total referrals w/",$P(^BMCTSORT(BMCNSRT,0),U),?45,$J($P(BMCR,U,6),12)
  1. S X=$P(BMCR,U,2) I $P(^BMCTSORT(BMCNSRT,0),U,13) S X2="2$",X3=14 D COMMA^%DTC
  1. W !?10,"Sum",?45,$J(X,14)
  1. S X=$P(BMCR,U,3) I $P(^BMCTSORT(BMCNSRT,0),U,13) S X2="2$",X3=14 D COMMA^%DTC
  1. W !?10,"Mean",?45,$J(X,14,2)
  1. S X=$P(BMCR,U,5) I $P(^BMCTSORT(BMCNSRT,0),U,13) S X2="2$",X3=14 D COMMA^%DTC
  1. W !?10,"Maximum Value",?45,$J(X,14)
  1. S X=$P(BMCR,U,4) I $P(^BMCTSORT(BMCNSRT,0),U,13) S X2="2$",X3=14 D COMMA^%DTC
  1. W !?10,"Minimum Value",?45,$J(X,14)
  1. K BMCR,BMCREF
  1. Q
  1. R ;EP record display
  1. D HEAD
  1. D EP^BMCRD(BMCREF)
  1. S BMCX=0 F S BMCX=$O(^TMP("BMCRDSP",$J,BMCX)) Q:BMCX'=+BMCX!($D(BMCQUIT)) D
  1. .I $Y>(IOSL-5) D HEAD Q:$D(BMCQUIT)
  1. .W !,^TMP("BMCRDSP",$J,BMCX,0)
  1. .Q
  1. Q