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

BRNAGE2.m

Go to the documentation of this file.
  1. BRNAGE2 ; IHS/OIT/LJF - ROI AGING REPORT (BY STAFF ASSIGNMENT) ;
  1. ;;2.0;RELEASE OF INFO SYSTEM;*1*;APR 10, 2003
  1. ;IHS/OIT/LJF 10/11/2007 PATCH 1 Added this routine - new report & driver
  1. ;
  1. DRIVER ;EP; entry point from new option
  1. ; driver calls all 3 aging reports
  1. NEW DIR,Y,RPT
  1. W !,"ROI AGING REPORTS"
  1. S DIR(0)="S^1:By Request STATUS;2:By AGING Range;3:By STAFF Assignment;4:By PURPOSE",DIR("A")="Select a Report"
  1. K DA D ^DIR K DIR
  1. Q:$D(DIRUT) Q:Y<1
  1. S RPT=$S(Y=1:"ASK1^BRNAGE",Y=2:"ASK^BRNAGE1",Y=3:"ASK^BRNAGE2",1:"ASK2^BRNAGE2") D @RPT
  1. Q
  1. ;
  1. ASK ;EP - Restrict a Certain Staff Assignment
  1. S BRNSTBD="",BRNSTED=""
  1. W ! S DIR(0)="Y0",DIR("A")="Would you like to run this report for ONLY a particular staff member",DIR("B")="NO"
  1. S DIR("?")="To RESTRICT to a particular STAFF ASSIGNMENT - Answer Yes."
  1. D ^DIR K DIR
  1. G:$D(DIRUT) END
  1. I 'Y G PRINT
  1. ;
  1. STAFF ;ROI Staff Assignment
  1. S DIR(0)="90264,.11",DIR("A")="Select STAFF ASSIGNED"
  1. K DA D ^DIR K DIR
  1. G:$D(DIRUT) ASK
  1. S BRNSTBD=+Y,BRNSTED=+Y
  1. ;
  1. ;
  1. PRINT ;PRINT Report by staff assignment
  1. ;
  1. ;select facility
  1. NEW BRNFAC D ASKFAC^BRNU(.BRNFAC) I BRNFAC="" D END Q
  1. ;
  1. ;set up print
  1. S FLDS="[BRN GS AGING RPT]",BY(0)="^BRNREC(""AH"",",DIC="^BRNREC(",L=0,L(0)=2
  1. S FR(0,1)=BRNSTBD,TO(0,1)=BRNSTED
  1. I BRNFAC>0 S DIS(0)="I $P(^BRNREC(D0,0),U,22)=BRNFAC"
  1. K DHIT,DIOEND,DIOBEG
  1. D EN1^DIP
  1. END ;
  1. K BRNSTBD,BRNSTED,DD0,B,X,BRNPURB,BRNPURE
  1. Q
  1. ;
  1. ASK2 ;EP - Restrict to a certain PURPOSE
  1. S BRNPURB="",BRNPURE=""
  1. W ! S DIR(0)="Y0",DIR("A")="Would you like to run this report for ONLY one PURPOSE",DIR("B")="NO"
  1. S DIR("?")="To RESTRICT to a particular PURPOSE - Answer Yes."
  1. D ^DIR K DIR
  1. G:$D(DIRUT) END
  1. I 'Y G PRINT2
  1. ;
  1. PURPOSE ;ROI Staff Assignment
  1. S DIR(0)="90264,.07",DIR("A")="Select PURPOSE"
  1. K DA D ^DIR K DIR
  1. G:$D(DIRUT) ASK2
  1. S BRNPURB=$P(Y,U),BRNPURE=$P(Y,U)
  1. ;
  1. ;
  1. PRINT2 ;PRINT report by purpose
  1. ;
  1. ;select facility
  1. NEW BRNFAC,BRNFACN D ASKFAC^BRNU(.BRNFAC) I BRNFAC="" D END Q
  1. I BRNFAC>0 S BRNFACN=$$GET1^DIQ(90264.2,BRNFAC,.01)
  1. ;
  1. ;set up print
  1. S FLDS="[BRN GS AGING RPT]",BY="FACILITY;S1,.07",DIC="^BRNREC(",L=0
  1. I BRNFAC=0 S FR="@,"_BRNPURB,TO="ZZZ,"_BRNPURE
  1. E S FR=BRNFACN_","_BRNPURB,TO=BRNFACN_","_BRNPURE
  1. K DHIT,DIOEND,DIOBEG
  1. D EN1^DIP
  1. G END