- BMCRR7 ; IHS/PHXAO/TMJ - list patients currently in active, outpatient referral status ; 10 Nov 2009 1:45 PM
- ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
- ;
- ;Modified for Y2k Compliance IHS/DSD/HJT 5/25/99
- ;
- ;
- START ;
- W:$D(IOF) @IOF
- W !,"This report will list patients currently referred for outpatient services",!,"at outside referral facilities. The definition of 'currently referred for is",!
- W !?5,"- the referral is an Outpatient referral"
- ;Begin Y2k fix
- ;W !?5,"- the best available beginning (actual or estimated) date is today or",!?7,"earlier and ",!?5,"- the actual end date of service is blank or on or after",!?7," today's date of ",$$FMTE^XLFDT(DT,"2D")
- W !?5,"- the best available beginning (actual or estimated) date is today or",!?7,"earlier and ",!?5,"- the actual end date of service is blank or on or after",!?7," today's date of ",$$FMTE^XLFDT(DT,"5D") ;Y2000
- ;End y2k fix
- W !?5,"- the status of the referral is active",!,?5,"- Inhouse Referrals are excluded",!
- 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
- 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="^BMCRR7P",XBRC="^BMCRR71",XBRX="XIT^BMCRR7",XBNS="BMC"
- D ^XBDBQUE
- D XIT
- Q
- BROWSE ;
- S XBRP="VIEWR^XBLM(""^BMCRR7P"")"
- S XBRC="^BMCRR71",XBRX="XIT^BMCRR7",XBIOP=0 D ^XBDBQUE
- Q
- XIT ;EP - CALLED FROM BMCRR7
- D KILL^AUPNPAT
- K BMC80D,BMC80E,BMCBT,BMCBTH,BMCCOL,BMCET,BMCFAC,BMCFILE,BMCG,BMCHRN,BMCJOB,BMCNODE,BMCOPT,BMCPG,BMCQUIT,BMCRCNT,BMCREF,BMCRREC,BMCSORT,BMCSPAGE,BMCSTYPE,BMCX
- K DA,DFN,DIR,DIRUT,DIWF,DIWL,DIWR,DTOUT,X,Y
- Q
- BMCRR7 ; IHS/PHXAO/TMJ - list patients currently in active, outpatient referral status ; 10 Nov 2009 1:45 PM
- +1 ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
- +2 ;
- +3 ;Modified for Y2k Compliance IHS/DSD/HJT 5/25/99
- +4 ;
- +5 ;
- START ;
- +1 IF $DATA(IOF)
- WRITE @IOF
- +2 WRITE !,"This report will list patients currently referred for outpatient services",!,"at outside referral facilities. The definition of 'currently referred for is",!
- +3 WRITE !?5,"- the referral is an Outpatient referral"
- +4 ;Begin Y2k fix
- +5 ;W !?5,"- the best available beginning (actual or estimated) date is today or",!?7,"earlier and ",!?5,"- the actual end date of service is blank or on or after",!?7," today's date of ",$$FMTE^XLFDT(DT,"2D")
- +6 ;Y2000
- WRITE !?5,"- the best available beginning (actual or estimated) date is today or",!?7,"earlier and ",!?5,"- the actual end date of service is blank or on or after",!?7," today's date of ",$$FMTE^XLFDT(DT,"5D")
- +7 ;End y2k fix
- +8 WRITE !?5,"- the status of the referral is active",!,?5,"- Inhouse Referrals are excluded",!
- 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
- 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="^BMCRR7P"
- SET XBRC="^BMCRR71"
- SET XBRX="XIT^BMCRR7"
- SET XBNS="BMC"
- +8 DO ^XBDBQUE
- +9 DO XIT
- +10 QUIT
- BROWSE ;
- +1 SET XBRP="VIEWR^XBLM(""^BMCRR7P"")"
- +2 SET XBRC="^BMCRR71"
- SET XBRX="XIT^BMCRR7"
- SET XBIOP=0
- DO ^XBDBQUE
- +3 QUIT
- XIT ;EP - CALLED FROM BMCRR7
- +1 DO KILL^AUPNPAT
- +2 KILL BMC80D,BMC80E,BMCBT,BMCBTH,BMCCOL,BMCET,BMCFAC,BMCFILE,BMCG,BMCHRN,BMCJOB,BMCNODE,BMCOPT,BMCPG,BMCQUIT,BMCRCNT,BMCREF,BMCRREC,BMCSORT,BMCSPAGE,BMCSTYPE,BMCX
- +3 KILL DA,DFN,DIR,DIRUT,DIWF,DIWL,DIWR,DTOUT,X,Y
- +4 QUIT