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

ACDWSTA.m

Go to the documentation of this file.
  1. ACDWSTA ;IHS/ADC/EDE/KML - GET STATE TO RUN REPORTS FOR 10:14;
  1. ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
  1. ;;
  1. ;********************************************************
  1. ;//^ACDWRQ
  1. ;User is running CDMIS reports by state. A futher breakdown is now
  1. ;determined. Run ALL or SELECTED or CATEGORY
  1. ;This routine will return a ACDSTA(array) that holds the
  1. ;six digit code for area service state or "*ALL*"
  1. ;*********************************************************
  1. ;
  1. EN ;
  1. K ACDSTA,DIR,DIC
  1. S DIR(0)="S^1:Print 'ALL' states;2:Print 'SELECTED' states;3:Print 'CATEGORY' of states",DIR("A")="State Print Criteria" D ^DIR G:Y="^" K D @Y,K Q
  1. 1 ;All states
  1. S ACDSTA("*ALL*")=""
  1. S ACDLOC=ACDLOC_" / "_"*ALL STATES*"
  1. Q
  1. 2 ;On the fly selected states
  1. S ACDLOC=ACDLOC_" / "_"SELECTED STATES"
  1. F S DIC="^DIC(5,",DIC(0)="AEQZM" D ^DIC G:Y<0 K S ACDSTA($P(Y(0),U,3))=""
  1. Q
  1. 3 ;Category
  1. S DIC="^ACDSTA(",DIC(0)="AEQM" D ^DIC G:Y<0 K S ACDSTA("C")=$P(Y,U,3)
  1. S ACDLOC=ACDLOC_" / "_"STATE CATEGORY: "_ACDSTA("C")
  1. I $D(^ACDSTA(+Y,1,0)) F ACDDA=0:0 S ACDDA=$O(^ACDSTA(+Y,1,ACDDA)) Q:'ACDDA I $D(^(ACDDA,0)) S ACDSTAP=^(0),ACDSTAP=$P(^DIC(5,ACDSTAP,0),U,3),ACDSTA(ACDSTAP)=""
  1. Q
  1. K ;
  1. I '$D(ACDSTA) S ACDQUIT=1
  1. K DIC,DIR,ACDSTAP,Y