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

ACDWSU.m

Go to the documentation of this file.
  1. ACDWSU ;IHS/ADC/EDE/KML - GET SERVICE UNIT TO RUN REPORT;
  1. ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
  1. ;;
  1. ;**********************************************************
  1. ;//^ACDWRQ
  1. ;User is running reports by service units. A futher breakdown is now
  1. ;determined. Run ALL or SELECTED or CATEGORY
  1. ;This routine will return a ACDSU(array) that holds the
  1. ;four digit code associated with the area survice unit or "*ALL*"
  1. ;************************************************************
  1. EN ;
  1. K ACDSU,DIR
  1. S DIR(0)="S^1:Print 'ALL' service units;2:Print 'SELECTED' service units;3:Print 'CATEGORY' of service units",DIR("A")="Service Unit Print Criteria" D ^DIR S:X["^" ACDQUIT=1 G:$D(ACDQUIT) K D @Y,K Q
  1. 1 ;All service units
  1. S ACDLOC="*ALL SERVICE UNITS*"
  1. S ACDSU("*ALL*")=""
  1. Q
  1. 2 ;On the fly selected service units
  1. S ACDLOC="SELECTED SERVICE UNITS:"
  1. F S DIC="^AUTTSU(",DIC(0)="AEQ" D ^DIC G:Y<0 K I $D(^AUTTSU(+Y,0)),$P(^(0),U,4)'="" S ACDSU($P(^(0),U,4))=""
  1. Q
  1. 3 ;Category of service units
  1. S DIC="^ACDSU(",DIC(0)="AEQ" D ^DIC G:Y<0 K S ACDSU("C")=$P(Y,U,2)
  1. S ACDLOC="SERVICE UNIT CATEGORY: "_ACDSU("C")
  1. I $D(^ACDSU(+Y,1,0)) F ACDDA=0:0 S ACDDA=$O(^ACDSU(+Y,1,ACDDA)) Q:'ACDDA I $D(^(ACDDA,0)) S ACDSUP=^(0) I $D(^AUTTSU(ACDSUP,0)),$P(^(0),U,4)'="" S ACDSU($P(^(0),U,4))=""
  1. Q
  1. K ;
  1. I '$D(ACDSU) S ACDQUIT=1
  1. K ACDSUP,DIC,DIR,Y