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

BMCCLOS2.m

Go to the documentation of this file.
  1. BMCCLOS2 ; IHS/OIT/FCJ - Auto Close of CHS Referrals ; [ 05/15/2006 12:23 PM ]
  1. ;;4.0;REFERRED CARE INFO SYSTEM;**2**;JAN 09, 2006;Build 101
  1. ;IHS/ITSC/FCJ TEST FOR SR
  1. ;IHS/OIT/FCJ ADDED NEW SORT BY DATE OF SERVICE, ADDED NEW TYPE ALL,
  1. ;ADDED BOTH TO INP/OUT SELECTION
  1. ;
  1. ;
  1. ;
  1. W !?12,"******** AUTOMATIC CLOSE OF REFERRALS ********",!
  1. W !,?25,"******WARNING*****",!
  1. ;W !,"This routine will LOOP through all referrals that were initiated in a date ",!,"range entered by the User --" ;IHS/OIT/FCJ
  1. W !,"This routine will LOOP through all referrals either by date initiated",!,"or by date of service, date range entered by the User --" ;IHS/OIT/FCJ
  1. W !,?20,"*****AUTOMATIC CLOSURE OF REFERRAL*****",!
  1. W "This Routine allows User to Select a specific INDIVIDUAL FACILITY Only!",!
  1. W "This Routine also allows the User to EXCLUDE a particular Local Category ",!
  1. W "This Routine allows the User to Select INPATIENT or OUTPATIENT Referrals Only!",!
  1. W "This Routine allows the User to Select TYPE of Referral (CHS,IHS,OTHER) Only!",!
  1. ;
  1. ASK ;
  1. W ! S DIC="^AUTTLOC(",DIC("A")="Enter Facility Name: ",DIC(0)="AEMQ" D ^DIC K DIC
  1. I Y=-1 G XIT
  1. S BMCFAC=+Y
  1. ;
  1. KIND ;Ask for specific Type of Referral (IHS, CHS, OTHER)
  1. S DIR(0)="S^C:CHS;O:OTHER;I:IHS;A:ALL"
  1. S DIR("A")="Enter Type of Referral:",DIR("B")="ALL"
  1. S DIR("?")="You must select a Type from the List"
  1. K DA D ^DIR KILL DIR
  1. Q:$D(DIRUT)
  1. G:Y=0 ASK
  1. S BMCKIND=Y
  1. ASK1 ;Restrict a Certain Local Category
  1. S BMCLCAT=0
  1. W ! S DIR(0)="Y0",DIR("A")="Would you like to EXCLUDE a particular Local Category in this report",DIR("B")="NO"
  1. S DIR("?")="To EXCLUDE a particular Local Category from this Report - Answer Yes."
  1. D ^DIR K DIR
  1. G:$D(DIRUT) ASK
  1. I 'Y G TYPE
  1. CAT ;Category Restriction
  1. S BMCLCAT=0
  1. S DIC="^BMCLCAT(",DIC(0)="AEQM",DIC("A")="Enter the Local Category to EXCLUDE: "
  1. D ^DIC K DIC
  1. Q:$D(DIRUT)
  1. G:Y=0 TYPE
  1. S BMCLCAT=+Y
  1. ;
  1. ;
  1. TYPE ;Select Inpatient Or Outpatient
  1. ;
  1. S DIR(0)="S^I:INPATIENT;O:OUTPATIENT;B:BOTH"
  1. S DIR("A")="Select Inpatient or Outpatient",DIR("B")="O"
  1. S DIR("?")="You must choose Inpatient or Outpatient"
  1. K DA D ^DIR KILL DIR
  1. Q:$D(DIRUT)
  1. G:Y=0 CAT
  1. S BMCTYP=Y
  1. ;
  1. ;IHS/OIT/FCJ ADDED NXT SECTION TO ALLOW SORT BY DOS
  1. SORT ;SORT BY DATE INITIATED OR BY DATE OF SERVICE
  1. W !! S DIR(0)="S^I:DATE INITIATED;S:DATE OF SERVICE",DIR("B")="I"
  1. S DIR("A")="Select close by Date Initiated or by Date of Service"
  1. D ^DIR K DIR
  1. Q:$D(DIRUT)
  1. G:Y=0 TYPE
  1. S BMCDTS=Y
  1. ;IHS/OIT/FCJ END OF CHANGES
  1. BD ;get beginning date
  1. W !! S DIR(0)="D^::EP"
  1. S DIR("A")="Enter beginning Referral Date "_$S(BMCDTS="I":"Initiated",1:"of Service")
  1. D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) G ASK
  1. S BMCBD=Y
  1. ED ;get ending date
  1. W ! S DIR(0)="D^"_BMCBD_"::EP"
  1. S DIR("A")="Enter ending Referral Date "_$S(BMCDTS="I":"Initiated",1:"of Service")
  1. D ^DIR K DIR S:$D(DUOUT) DIRUT=1
  1. I $D(DIRUT) G BD
  1. S BMCED=Y
  1. S X1=BMCBD,X2=-1 D C^%DTC S BMCSD=X
  1. ;
  1. PROCESS ;Process Data
  1. ;D ^BMCCLOS3 ;IHS/OIT/FCJ
  1. D @$S(BMCDTS="S":"DOS^BMCCLOS3",1:"DRI^BMCCLOS3") ;IHS/OIT/FCJ
  1. ;
  1. XIT ;
  1. K BMCBD,BMCBT,BMCBTH,BMCCOL,BMCD,BMCDA,BMCDATE,BMCED,BMCET,BMCFILE,BMCG,BMCHRN,BMCIOM,BMCJOB,BMCNODE,BMCODAT,BMCOPT,BMCP,BMCPG,BMCPN,BMCQUIT,BMCRCNT,BMCREF,BMCRREC,BMCSD,BMCWP,BMCX,BMCC
  1. K BMCLOCC,BMCLOCI,BMCLOCP,BMCLOCPP,BMCLCAT,BMCCT,BMCFAC,BMCRIEN,BMCRSTAT,BMCTYP,BMCTYP,BMCKIND,BMCDTS,BMCCLS,BMCADOS
  1. D KILL^AUPNPAT
  1. K %,C,D0,DA,DFN,DI,DIC,DIQ,DIR,DIRUT,DIWF,DIWL,DIWR,DR,DTOUT,F,I,X,Y,Z
  1. Q