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

BMCRR22.m

Go to the documentation of this file.
  1. BMCRR22 ; IHS/PHXAO/TMJ - list patients currently in active, outpatient referral status ;
  1. ;;4.0;REFERRED CARE INFO SYSTEM;;JAN 09, 2006
  1. ;3.9.04 IHS/ITSC/FCJ CALL made to the wrong routine
  1. ;
  1. ;
  1. ;
  1. START ;
  1. W:$D(IOF) @IOF
  1. W !,"This report will list patients currently referred for outpatient services",!,"at outside referral facilities. The definition of 'currently referred for is",!
  1. W !?5,"- the referral is an Outpatient referral"
  1. 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")
  1. W !?5,"- the status of the referral is active",!,?5,"- Inhouse Referrals are excluded",!
  1. SORT ;sort by?
  1. S BMCSTYPE=""
  1. S DIR(0)="S^F:Facility Referred to;C:Case Manager;P:Patient Name;R:Referring Physician",DIR("A")="Sort output by which of the above",DIR("B")="F" K DA D ^DIR K DIR
  1. I $D(DIRUT) G XIT
  1. S BMCSTYPE=Y
  1. PAGE ;separate page for each
  1. S BMCSPAGE=""
  1. S DIR(0)="Y",DIR("A")="Do you want each "_$S(BMCSTYPE="C":"Case Manager",BMCSTYPE="P":"Patient",BMCSTYPE="F":"Facility",BMCSTYPE="R":"IHS Referring Physician")_" on a separate page",DIR("B")="N" K DA D ^DIR K DIR
  1. I $D(DIRUT) G SORT
  1. S BMCSPAGE=Y
  1. ;
  1. OUTPUT ;Print Output Summary or Detail
  1. S BMCOUTP=""
  1. 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
  1. I $D(DIRUT) G XIT
  1. S BMCOUTP=Y
  1. SECREF ;PRINT SEC REF AS A SEPARATE ENTRY
  1. S BMCTYPR=""
  1. 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
  1. I $D(DIRUT) G XIT
  1. S BMCTYPR=Y
  1. ZIS ;call to XBDBQUE
  1. K BMCOPT
  1. 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
  1. I $D(DIRUT) S BMCQUIT="" Q
  1. S BMCOPT=Y
  1. G:$G(BMCQUIT) SORT
  1. I $G(BMCOPT)="B" D BROWSE,XIT Q
  1. I BMCOUTP="D" G DETAIL
  1. ;
  1. SUMMARY ;Print Summary Report
  1. S XBRP="^BMCRR7P",XBRC="^BMCRR71",XBRX="XIT^BMCRR22",XBNS="BMC"
  1. D ^XBDBQUE
  1. D XIT
  1. Q
  1. DETAIL ;Print Detail
  1. S XBRP="^BMCRR22P",XBRC="^BMCRR221",XBRX="XIT^BMCRR22",XBNS="BMC"
  1. D ^XBDBQUE
  1. D XIT
  1. Q
  1. BROWSE ;
  1. I BMCOUTP="S" D BROWSE1,XIT Q
  1. S XBRP="VIEWR^XBLM(""^BMCRR22P"")"
  1. S XBRC="^BMCRR221",XBRX="XIT^BMCRR22",XBIOP=0 D ^XBDBQUE
  1. Q
  1. XIT ;EP - CALLED FROM BMCRR22
  1. D KILL^AUPNPAT
  1. K BMC80D,BMC80E,BMCBT,BMCBTH,BMCCOL,BMCET,BMCFAC,BMCFILE,BMCG,BMCHRN,BMCJOB,BMCNODE,BMCOPT,BMCPG,BMCQUIT,BMCRCNT,BMCREF,BMCRREC,BMCSORT,BMCSPAGE,BMCSTYPE,BMCX
  1. K DA,DFN,DIR,DIRUT,DIWF,DIWL,DIWR,DTOUT,X,Y,BMCTYPR
  1. Q
  1. ;
  1. BROWSE1 ;Summary Browse
  1. S XBRP="VIEWR^XBLM(""^BMCRR7P"")"
  1. S XBRC="^BMCRR71",XBRX="XIT^BMCRR22",XBIOP=0 D ^XBDBQUE