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

BMCRR20P.m

Go to the documentation of this file.
BMCRR20P ; IHS/PHXAO/TMJ - CASE REVIEW COMMENTS ;      [ 09/27/2006  2:06 PM ]
 ;;4.0;REFERRED CARE INFO SYSTEM;**1**;JAN 09, 2006;Build 101
 ;IHS/ITSC/FCJ ADDED PRINTING OF SECONDARY REF
 ;ITSC/IHS/FCJ REMOVED KILL AND RESET BMCOLOC
 ;4.0*1 3.8.06 IHS/OIT/FCJ ADDED TOTAL NUMBER OF REFERRALS
 ;
 S BMCPG=0 D @("HEAD"_(2-($E(IOST,1,2)="C-"))) I '$D(^XTMP("BMCRR20",BMCJOB,BMCBT)) W !,"No referrals to report",! G XIT
 S BMCPN=0,BMCQUIT=0
 S BMCDATE="" F  S BMCDATE=$O(^XTMP("BMCRR20",BMCJOB,BMCBT,"DATA HITS",BMCDATE)) Q:BMCDATE=""!(BMCQUIT)  D P
 W !!,"Total Number of Referrals = ",BMCRCNT  ;4.0*1 3.8.06 IHS/OIT/FCJ
XIT ;
 K ^XTMP("BMCRR20",BMCJOB,BMCBT)
 D DONE^BMCRLP2
 D KILL^AUPNPAT
 ;ITSC/IHS/FCJ RESET BMCOLOC THIS IS A PARAMETER
 K BMCDATE,BMCOMDT,BMCRDT,BMCREVN,BMCREVP
 S BMCOLOC=$P(^BMCPARM(DUZ(2),0),U,11)
 Q
P ;
 S BMCPN="" F  S BMCPN=$O(^XTMP("BMCRR20",BMCJOB,BMCBT,"DATA HITS",BMCDATE,BMCPN)) Q:BMCPN=""!(BMCQUIT)  D PRINT
 Q
PRINT ;print one referral
 I $Y>(IOSL-10) D HEAD Q:BMCQUIT
 S BMCRDT=0 F  S BMCRDT=$O(^XTMP("BMCRR20",BMCJOB,BMCBT,"DATA HITS",BMCDATE,BMCPN,BMCRDT)) Q:BMCRDT'=+BMCRDT!(BMCQUIT)  S BMCRREC=^BMCCOM(BMCRDT,0),DFN=$P(BMCRREC,U,2),BMCREF=$P(BMCRREC,U,3) D PRINT1
 Q
PRINT1 ;
 I $Y>(IOSL-3) D HEAD Q:BMCQUIT
 S BMCHRN="????" I $D(^AUPNPAT(DFN,41,DUZ(2))) S BMCHRN=$P(^AUTTLOC(DUZ(2),0),U,7)_$P(^AUPNPAT(DFN,41,DUZ(2),0),U,2)
 W !,$E($P(^DPT(DFN,0),U),1,30),?32,BMCHRN,?43,"DOB: ",$$DOB^AUPNPAT(DFN,"E"),"  ",$$AGE^AUPNPAT(DFN,DT,"R")," ",$$SSN^AUPNPAT(DFN)
 ;W !,"Tribe: ",$E($$TRIBE^AUPNPAT(DFN,"E"),1,20),?32,"Req Provider: ",$$VAL^XBDIQ1(90001,BMCRDT,.06)
 S BMCRNUMB=$P($G(^BMCREF(BMCREF,0)),U,2)
 ;BMC*4.1 4/19/06 IHS.OIT.FCJ ADDED SEC REF NUM
 W !,"Referral #: ",BMCRNUMB
 W:$D(^BMCREF(BMCREF,1)) $P(^BMCREF(BMCREF,1),U)
 W ?32,"Date Referral Initiated: ",$$REFDTI^BMCRLU(BMCREF,"S")
SECREF ;Secondary Referral
 D SECREF2^BMCRUTL
 ;
 S Y=$P(BMCRREC,U,1) D DD^%DT S BMCCOMDT=Y
 W !!,"CASE REVIEW DATE: "_BMCCOMDT
 S BMCREVP=$P(BMCRREC,U,4) S BMCREVN=$P(^VA(200,BMCREVP,0),U,1)
 W ?43,"CASE REVIEWER: "_BMCREVN,!
CASE ;Print Case Review Comments IHS/PHX/TMJ 11/25/98
 ;
 ;
 I '$D(^BMCCOM(BMCRDT,1)) G NEXT
 W "CASE REVIEW COMMENTS:"
 S BMCNODE=1,BMCIOM=70,BMCFILE=90001.03,BMCDA=BMCRDT D WP^BMCFDR K BMCIOM
 S Y=0 F  S Y=$O(BMCWP(Y)) Q:Y'=+Y!(BMCQUIT)  D
 .I $Y>(IOSL-3) D HEAD Q:BMCQUIT
 .W !?5,BMCWP(Y)
 Q:BMCQUIT
NEXT ;
 W !,"--------------------",!
 Q
 NEW X,Y,Z,C
 I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S BMCQUIT=1 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 Y=DT D DD^%DT W ?(75-$L(Y)/2),"Run Date: ",Y,!
 W ?23,"**CASE REVIEW COMMENTS BY DATE**"
 W !,$TR($J(" ",80)," ","-")
 Q