BMCRR2 ; IHS/PHXAO/TMJ - list patients for which medical and/or cost data has not been received ;
;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
;
;
START ;
W !,"This report will list patients who are currently under treatment at outside ",!,"referral facilities. The definition of those under treatment at outside"
W !,"facilities is the following:"
W !?5,"- the referral is an Inpatient referral"
W !?5,"- the beginning date of service is today or earlier and the actual",!?7,"end date of service is blank, or on or after today's date of " W $$FMTE^XLFDT(DT,"5D")
W !?5,"- the status of the referral is active",!,"Inhouse Referrals are NOT included.",!
SORT ;sort by?
S BMCSTYPE=""
S DIR(0)="S^F:Facility Referred to;C:Case Manager;P:Patient Name",DIR("A")="Sort output by which of the above",DIR("B")="F" K DA D ^DIR K DIR
I $D(DIRUT) G XIT
S BMCSTYPE=Y
;
OUTPUT ;Print Output Summary or Detail
S BMCOUTP=""
S DIR(0)="S^D:Detailed Report Listing;S:Summary Report Listing",DIR("A")="Select Report Printing",DIR("B")="D" K DA D ^DIR K DIR
I $D(DIRUT) G XIT
S BMCOUTP=Y
SECREF ;PRINT SEC REF AS A SEPARATE ENTRY
S BMCTYPR=""
S DIR(0)="Y",DIR("A")="Would you like to print the Secondary Referrals as Separate entries",DIR("B")="N" K DA D ^DIR K DIR
I $D(DIRUT) G XIT
S BMCTYPR=Y
;
PAGE ;separate page for each
S BMCSPAGE=""
S DIR(0)="Y",DIR("A")="Do you want each "_$S(BMCSTYPE="C":"Case Manager",BMCSTYPE="P":"Patient",BMCSTYPE="F":"Facility")_" on a separate page",DIR("B")="N" K DA D ^DIR K DIR
I $D(DIRUT) G SORT
S BMCSPAGE=Y
ZIS ;call to XBDBQUE
K BMCOPT
W ! S DIR(0)="S^P:PRINT Output;B:BROWSE Output on Screen",DIR("A")="Do you wish to",DIR("B")="P" K DA D ^DIR K DIR
I $D(DIRUT) S BMCQUIT="" Q
S BMCOPT=Y
G:$G(BMCQUIT) SORT
I $G(BMCOPT)="B" D BROWSE,XIT Q
S XBRP="^BMCRR2P",XBRC="^BMCRR21",XBRX="XIT^BMCRR2",XBNS="BMC"
D ^XBDBQUE
D XIT
Q
BROWSE ;
S XBRP="VIEWR^XBLM(""^BMCRR2P"")"
S XBRC="^BMCRR21",XBRX="XIT^BMCRR2",XBIOP=0 D ^XBDBQUE
Q
XIT ;EP - CALLED FROM BMCRR2
D KILL^AUPNPAT
K BMC80D,BMC80E,BMCBT,BMCBTH,BMCCOL,BMCD,BMCET,BMCFILE,BMCG,BMCHRN,BMCJOB,BMCNODE,BMCOPT,BMCP,BMCPG,BMCQUIT,BMCRCNT,BMCREF,BMCRREC,BMCSORT,BMCSPAGE,BMCSTYPE,BMCX,BMCOUTP,BMC132D,BMC132E,BMCRNUMB
K C,DA,DFN,DIR,DIRUT,DIWF,DIWL,DIWR,DTOUT,X,Y,Z,BMCTYPR
Q
BMCRR2 ; IHS/PHXAO/TMJ - list patients for which medical and/or cost data has not been received ;
+1 ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
+2 ;
+3 ;
START ;
+1 WRITE !,"This report will list patients who are currently under treatment at outside ",!,"referral facilities. The definition of those under treatment at outside"
+2 WRITE !,"facilities is the following:"
+3 WRITE !?5,"- the referral is an Inpatient referral"
+4 WRITE !?5,"- the beginning date of service is today or earlier and the actual",!?7,"end date of service is blank, or on or after today's date of "
WRITE $$FMTE^XLFDT(DT,"5D")
+5 WRITE !?5,"- the status of the referral is active",!,"Inhouse Referrals are NOT included.",!
SORT ;sort by?
+1 SET BMCSTYPE=""
+2 SET DIR(0)="S^F:Facility Referred to;C:Case Manager;P:Patient Name"
SET DIR("A")="Sort output by which of the above"
SET DIR("B")="F"
KILL DA
DO ^DIR
KILL DIR
+3 IF $DATA(DIRUT)
GOTO XIT
+4 SET BMCSTYPE=Y
+5 ;
OUTPUT ;Print Output Summary or Detail
+1 SET BMCOUTP=""
+2 SET DIR(0)="S^D:Detailed Report Listing;S:Summary Report Listing"
SET DIR("A")="Select Report Printing"
SET DIR("B")="D"
KILL DA
DO ^DIR
KILL DIR
+3 IF $DATA(DIRUT)
GOTO XIT
+4 SET BMCOUTP=Y
SECREF ;PRINT SEC REF AS A SEPARATE ENTRY
+1 SET BMCTYPR=""
+2 SET DIR(0)="Y"
SET DIR("A")="Would you like to print the Secondary Referrals as Separate entries"
SET DIR("B")="N"
KILL DA
DO ^DIR
KILL DIR
+3 IF $DATA(DIRUT)
GOTO XIT
+4 SET BMCTYPR=Y
+5 ;
PAGE ;separate page for each
+1 SET BMCSPAGE=""
+2 SET DIR(0)="Y"
SET DIR("A")="Do you want each "_$SELECT(BMCSTYPE="C":"Case Manager",BMCSTYPE="P":"Patient",BMCSTYPE="F":"Facility")_" on a separate page"
SET DIR("B")="N"
KILL DA
DO ^DIR
KILL DIR
+3 IF $DATA(DIRUT)
GOTO SORT
+4 SET BMCSPAGE=Y
ZIS ;call to XBDBQUE
+1 KILL BMCOPT
+2 WRITE !
SET DIR(0)="S^P:PRINT Output;B:BROWSE Output on Screen"
SET DIR("A")="Do you wish to"
SET DIR("B")="P"
KILL DA
DO ^DIR
KILL DIR
+3 IF $DATA(DIRUT)
SET BMCQUIT=""
QUIT
+4 SET BMCOPT=Y
+5 IF $GET(BMCQUIT)
GOTO SORT
+6 IF $GET(BMCOPT)="B"
DO BROWSE
DO XIT
QUIT
+7 SET XBRP="^BMCRR2P"
SET XBRC="^BMCRR21"
SET XBRX="XIT^BMCRR2"
SET XBNS="BMC"
+8 DO ^XBDBQUE
+9 DO XIT
+10 QUIT
BROWSE ;
+1 SET XBRP="VIEWR^XBLM(""^BMCRR2P"")"
+2 SET XBRC="^BMCRR21"
SET XBRX="XIT^BMCRR2"
SET XBIOP=0
DO ^XBDBQUE
+3 QUIT
XIT ;EP - CALLED FROM BMCRR2
+1 DO KILL^AUPNPAT
+2 KILL BMC80D,BMC80E,BMCBT,BMCBTH,BMCCOL,BMCD,BMCET,BMCFILE,BMCG,BMCHRN,BMCJOB,BMCNODE,BMCOPT,BMCP,BMCPG,BMCQUIT,BMCRCNT,BMCREF,BMCRREC,BMCSORT,BMCSPAGE,BMCSTYPE,BMCX,BMCOUTP,BMC132D,BMC132E,BMCRNUMB
+3 KILL C,DA,DFN,DIR,DIRUT,DIWF,DIWL,DIWR,DTOUT,X,Y,Z,BMCTYPR
+4 QUIT