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
HEAD ;ENTRY POINT
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
BMCRR20P ; IHS/PHXAO/TMJ - CASE REVIEW COMMENTS ; [ 09/27/2006 2:06 PM ]
+1 ;;4.0;REFERRED CARE INFO SYSTEM;**1**;JAN 09, 2006;Build 101
+2 ;IHS/ITSC/FCJ ADDED PRINTING OF SECONDARY REF
+3 ;ITSC/IHS/FCJ REMOVED KILL AND RESET BMCOLOC
+4 ;4.0*1 3.8.06 IHS/OIT/FCJ ADDED TOTAL NUMBER OF REFERRALS
+5 ;
+6 SET BMCPG=0
DO @("HEAD"_(2-($EXTRACT(IOST,1,2)="C-")))
IF '$DATA(^XTMP("BMCRR20",BMCJOB,BMCBT))
WRITE !,"No referrals to report",!
GOTO XIT
+7 SET BMCPN=0
SET BMCQUIT=0
+8 SET BMCDATE=""
FOR
SET BMCDATE=$ORDER(^XTMP("BMCRR20",BMCJOB,BMCBT,"DATA HITS",BMCDATE))
IF BMCDATE=""!(BMCQUIT)
QUIT
DO P
+9 ;4.0*1 3.8.06 IHS/OIT/FCJ
WRITE !!,"Total Number of Referrals = ",BMCRCNT
XIT ;
+1 KILL ^XTMP("BMCRR20",BMCJOB,BMCBT)
+2 DO DONE^BMCRLP2
+3 DO KILL^AUPNPAT
+4 ;ITSC/IHS/FCJ RESET BMCOLOC THIS IS A PARAMETER
+5 KILL BMCDATE,BMCOMDT,BMCRDT,BMCREVN,BMCREVP
+6 SET BMCOLOC=$PIECE(^BMCPARM(DUZ(2),0),U,11)
+7 QUIT
P ;
+1 SET BMCPN=""
FOR
SET BMCPN=$ORDER(^XTMP("BMCRR20",BMCJOB,BMCBT,"DATA HITS",BMCDATE,BMCPN))
IF BMCPN=""!(BMCQUIT)
QUIT
DO PRINT
+2 QUIT
PRINT ;print one referral
+1 IF $Y>(IOSL-10)
DO HEAD
IF BMCQUIT
QUIT
+2 SET BMCRDT=0
FOR
SET BMCRDT=$ORDER(^XTMP("BMCRR20",BMCJOB,BMCBT,"DATA HITS",BMCDATE,BMCPN,BMCRDT))
IF BMCRDT'=+BMCRDT!(BMCQUIT)
QUIT
SET BMCRREC=^BMCCOM(BMCRDT,0)
SET DFN=$PIECE(BMCRREC,U,2)
SET BMCREF=$PIECE(BMCRREC,U,3)
DO PRINT1
+3 QUIT
PRINT1 ;
+1 IF $Y>(IOSL-3)
DO HEAD
IF BMCQUIT
QUIT
+2 SET BMCHRN="????"
IF $DATA(^AUPNPAT(DFN,41,DUZ(2)))
SET BMCHRN=$PIECE(^AUTTLOC(DUZ(2),0),U,7)_$PIECE(^AUPNPAT(DFN,41,DUZ(2),0),U,2)
+3 WRITE !,$EXTRACT($PIECE(^DPT(DFN,0),U),1,30),?32,BMCHRN,?43,"DOB: ",$$DOB^AUPNPAT(DFN,"E")," ",$$AGE^AUPNPAT(DFN,DT,"R")," ",$$SSN^AUPNPAT(DFN)
+4 ;W !,"Tribe: ",$E($$TRIBE^AUPNPAT(DFN,"E"),1,20),?32,"Req Provider: ",$$VAL^XBDIQ1(90001,BMCRDT,.06)
+5 SET BMCRNUMB=$PIECE($GET(^BMCREF(BMCREF,0)),U,2)
+6 ;BMC*4.1 4/19/06 IHS.OIT.FCJ ADDED SEC REF NUM
+7 WRITE !,"Referral #: ",BMCRNUMB
+8 IF $DATA(^BMCREF(BMCREF,1))
WRITE $PIECE(^BMCREF(BMCREF,1),U)
+9 WRITE ?32,"Date Referral Initiated: ",$$REFDTI^BMCRLU(BMCREF,"S")
SECREF ;Secondary Referral
+1 DO SECREF2^BMCRUTL
+2 ;
+3 SET Y=$PIECE(BMCRREC,U,1)
DO DD^%DT
SET BMCCOMDT=Y
+4 WRITE !!,"CASE REVIEW DATE: "_BMCCOMDT
+5 SET BMCREVP=$PIECE(BMCRREC,U,4)
SET BMCREVN=$PIECE(^VA(200,BMCREVP,0),U,1)
+6 WRITE ?43,"CASE REVIEWER: "_BMCREVN,!
CASE ;Print Case Review Comments IHS/PHX/TMJ 11/25/98
+1 ;
+2 ;
+3 IF '$DATA(^BMCCOM(BMCRDT,1))
GOTO NEXT
+4 WRITE "CASE REVIEW COMMENTS:"
+5 SET BMCNODE=1
SET BMCIOM=70
SET BMCFILE=90001.03
SET BMCDA=BMCRDT
DO WP^BMCFDR
KILL BMCIOM
+6 SET Y=0
FOR
SET Y=$ORDER(BMCWP(Y))
IF Y'=+Y!(BMCQUIT)
QUIT
Begin DoDot:1
+7 IF $Y>(IOSL-3)
DO HEAD
IF BMCQUIT
QUIT
+8 WRITE !?5,BMCWP(Y)
End DoDot:1
+9 IF BMCQUIT
QUIT
NEXT ;
+1 WRITE !,"--------------------",!
+2 QUIT
HEAD ;ENTRY POINT
+1 NEW X,Y,Z,C
+2 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
WRITE !
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET BMCQUIT=1
QUIT
HEAD1 ;
+1 IF $DATA(IOF)
WRITE @IOF
HEAD2 ;
+1 SET BMCPG=BMCPG+1
+2 WRITE !?13,"********** CONFIDENTIAL PATIENT INFORMATION **********"
+3 WRITE !?(80-$LENGTH($PIECE(^DIC(4,DUZ(2),0),U))/2),$PIECE(^DIC(4,DUZ(2),0),U),?72,"Page ",BMCPG,!
+4 SET Y=BMCBD
DO DD^%DT
WRITE ?31,"REFERRAL INITIATED",!,?17,"BEG DATE: "_Y
+5 SET Y=BMCED
DO DD^%DT
WRITE ?40,"END DATE: "_Y,!
+6 SET Y=DT
DO DD^%DT
WRITE ?(75-$LENGTH(Y)/2),"Run Date: ",Y,!
+7 WRITE ?23,"**CASE REVIEW COMMENTS BY DATE**"
+8 WRITE !,$TRANSLATE($JUSTIFY(" ",80)," ","-")
+9 QUIT