source: WorldVistAEHR/trunk/r/EVENT_CAPTURE-EC--ECT--ECX/ECUNIT.m@ 1261

Last change on this file since 1261 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.3 KB
RevLine 
[613]1ECUNIT ;BIR/MAM,JPW-Allocate DSS Units ;1 May 96
2 ;;2.0; EVENT CAPTURE ;;8 May 96
3 ;
4 W @IOF,"Allocating DSS Units for Event Capture",!!
5BEG K ECMORE S LIST="DSS Units",(CNT,ECOUT)=0 W !!,"Enter the names of the DSS Units to be assigned: ",!!
6UNIT ; select DSS Unit
7 K DIC,DA,DUOUT S DIC=724,DIC(0)="QEAMZ",DIC("A")="Select DSS Unit: " D ^DIC K DIC G:$D(DUOUT) END I CNT=0,Y<0 G END
8 I CNT,Y<0,$D(ECMORE) Q
9 I CNT,Y<0 G CONT
10 S ECNOPE=0 D CHECK I ECNOPE G UNIT
11 S CNT=CNT+1,UNIT(CNT)=+Y_"^"_$P(Y,"^",2) G UNIT
12CONT ;
13 S CNT=0 W @IOF,!,"Enter the names of the people who will have access to enter procedures",!,"for the DSS Units selected:",!!
14USER ; select users
15 K DIC,DA,DUOUT S DIC=200,DIC(0)="QEAMZ",DIC("A")="Select Name: " D ^DIC K DIC G:$D(DUOUT) END I CNT=0,Y<0 G END
16 I CNT,Y<0,$D(ECMORE) Q
17 I CNT,Y<0 G ENTER
18 S CNT=CNT+1,USER(CNT)=+Y_"^"_$P(Y,"^",2) G USER
19 Q
20ENTER ; display DSS Units & Users
21 W @IOF,!,"Allocating DSS Units for Event Capture",!,?3,LIST_": ",!
22 I LIST["DSS" S CNT=0 F I=0:0 S CNT=$O(UNIT(CNT)) Q:'CNT W:CNT#2 !,?3,CNT W:CNT#2=0 ?45,CNT W ". "_$P(UNIT(CNT),"^",2)
23 I LIST["Event" S CNT=0 F I=0:0 S CNT=$O(USER(CNT)) Q:'CNT W:CNT#2 !,?3,CNT W:CNT#2=0 ?45,CNT W ". "_$P(USER(CNT),"^",2)
24 Q:$D(ECREDO) W !!,"Do you want to modify this list ? NO// " R ECYN:DTIME I '$T!(ECYN="^") G END
25 S ECYN=$E(ECYN) S:ECYN="" ECYN="N" I "YyNn"'[ECYN D HELP^ECUN1 G ENTER
26 I LIST["DSS","Nn"[ECYN S LIST="Event Capture Users" G ENTER
27 I LIST["Event","Nn"[ECYN D ^ECUN1 G BEG
28ASK W !!,"Add or Delete from the List ? ADD// " R X:DTIME I '$T!(X="^") G ENTER
29 S X=$E(X) S:X="" X="A" I "AaDd"'[X W !!,"Enter <RET> to add more "_LIST_", or ""D"" to delete a "_$S(LIST["DSS":"unit",1:"user"),!,"from the list." G ASK
30 I LIST["DSS","Aa"[X D COUNT S CNT=CNT1,ECMORE=1 W @IOF D UNIT S LIST="DSS Units" D VAL G:ECOUT END G ENTER
31 I LIST["Event","Aa"[X D CNT S CNT=CNT1,ECMORE=1 W @IOF D USER S LIST="Event Capture Users" D VAL G:ECOUT END G ENTER
32DELUN ; delete units
33 W !!,"Select Number: " R X:DTIME I '$T!("^"[X) G ENTER
34 I LIST["DSS",'$D(UNIT(X)) W !!,"Enter the number corresponding to the DSS Unit that you want to remove." D DISP G DELUN
35 I LIST["Event",'$D(USER(X)) W !!,"Enter the number corresponding to the Event Capture User that you",!,"want to remove." D DISP G DELUN
36 I LIST["DSS" K UNIT(X) S (CNT,CNT1)=0 F I=0:0 S CNT=$O(UNIT(CNT)) Q:'CNT S CNT1=CNT1+1 I CNT'=CNT1 S UNIT(CNT1)=UNIT(CNT) K UNIT(CNT)
37 I LIST["Event" K USER(X) S (CNT,CNT1)=0 F I=0:0 S CNT=$O(USER(CNT)) Q:'CNT S CNT1=CNT1+1 I CNT'=CNT1 S USER(CNT1)=USER(CNT) K USER(CNT)
38 G ENTER
39 ;
40DISP ; display list
41 S ECREDO=1 W !!,"Do you need to see the list again ? NO// " R ECYN:DTIME I '$T!(X="^") S ECOUT=1 Q
42 S ECYN=$E(ECYN) S:ECYN="" ECYN="N" I "YyNn"'[ECYN W !!,"Enter YES if you would like see the list of "_LIST_"." G DISP
43 I "Nn"[ECYN K ECREDO Q
44 D ENTER K ECREDO
45 Q
46END D ^ECKILL W @IOF
47 Q
48COUNT ; re-number units
49 S (CNT,CNT1)=0 F I=0:0 S CNT=$O(UNIT(CNT)) Q:'CNT S CNT1=CNT1+1
50 Q
51CNT ; re-number users
52 S (CNT,CNT1)=0 F I=0:0 S CNT=$O(USER(CNT)) Q:'CNT S CNT1=CNT1+1
53 Q
54CHECK ; check for valid DSS Unit
55 I $P(^ECD(+Y,0),"^",6) S ECNOPE=1 W !!,"This DSS Unit is inactive.",!!,"Press <RET> to continue " R X:DTIME W @IOF
56 Q
57VAL ;check valid lists
58 I LIST["DSS",'$O(UNIT(0)) S ECOUT=1 D MSG Q
59 I LIST["Event",'$O(USER(0)) S ECOUT=1 D MSG Q
60 Q
61MSG W !!,"No action taken.",!!,"Press <RET> to continue " R X:DTIME
62 Q
Note: See TracBrowser for help on using the repository browser.