source: FOIAVistA/trunk/r/EVENT_CAPTURE-EC--ECT--ECX/ECDSSCRN.m@ 1757

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1ECDSSCRN ;BIR/RHK - Enter Event Code Screens ;30 Mar 95
2 ;;2.0; EVENT CAPTURE ;;8 May 96
3 ;Routine for entering event code screens
4START ; Check for location
5 W @IOF
6 I $O(^DIC(4,"LOC",""))="" W !,"You have no locations flagged for event cature.",!! Q
7UNIT ; Select unit
8 K DIC S ECNOPE="",DIC=724,DIC(0)="QEAMZ",DIC("A")="Select DSS Unit: ",DIC("S")="I $P(^(0),U,8)" D ^DIC K DIC G:Y<0 END
9 S ECU=+Y,ECUN=$P(Y,U,2) D CHECK
10 I $D(DUOUT)!($D(DTOUT)) G END
11 I ECNOPE G UNIT
12CAT ; Check if unit uses categories
13 I $P(^ECD(ECU,0),U,11) D S ECUDIR=$S($D(DUOUT):"END",$D(ECUERR):"UNIT",1:"PROC") W @IOF G @ECUDIR
14 .S DIC=726
15 .S DIC(0)="AEQMZ"
16 .S DIC("S")="I '$P(^(0),U,3)!($P(^(0),U,3)>DT)"
17 .S DIC("A")="Select Category: "
18 .D ^DIC K DIC Q:$D(DUOUT)
19 .I Y<0 S ECUERR=1 Q
20 .S ECUCAT=+Y
21PROC ; Set procedures
22 ; Find highest entry number
23 F ECUP=0:0 S ECUP=$O(^ECD(ECU,"PRO",ECUP)) Q:+$O(^(ECUP))'>0
24 S ECUP=ECUP+1
25 I '$D(ECUCAT) S ECUCAT=""
26 S DIR(0)="724.011,.01",DIR("A")="Select Procedure" D ^DIR K DIR
27 I +Y'>0 G END
28 S ECUPRO=Y
29 I $D(^ECD(ECU,"PRO","CB",ECUCAT,ECUPRO)) D G PROC
30 .W !,"That procedure already exists.",!!
31 .S ECUPROP=$O(^ECD(ECU,"PRO","CB",ECUCAT,ECUPRO,""))
32 .I $P(^ECD(ECU,"PRO",ECUPROP,0),U,3),($P(^(0),U,3)<DT) D
33 ..S Y=$P(^ECD(ECU,"PRO",ECUPROP,0),U,3) X ^DD("DD")
34 ..W "This procedure was inactivated on ",Y,". You may use the 'Inactivate",!,"Event Code Screen option to change this date.",!!
35 .K ECUP
36 S ^ECD(ECU,"PRO",ECUP,0)=Y_"^"_ECUCAT
37 I '$D(^ECD(ECU,"PRO",0)) S ^ECD(ECU,"PRO",0)="^724.011AV^^"
38 ; Set the cross references for this entry
39 S ^ECD(ECU,"PRO","B",Y,ECUP)=""
40 S ^ECD(ECU,"PRO","C",ECUCAT,ECUP)=""
41 K DA,ECUP,Y,X G PROC
42STOP ; Stop loop and check for another category
43 G CAT
44END ;
45 K DA,DIE,DIK,DR,ECNOPE,ECU,ECUCAT,ECUDIR,ECUERR,ECUN,ECUP,ECUPRO,ECUPROP,X,Y
46 Q
47CHECK ; Check to see if active unit
48 I $P(^ECD(ECU,0),U,6) S ECNOPE=1
49 I ECNOPE W !!,"This DSS Unit has not been activated for use in Event",!,"Capture software.",!! S DIR(0)="E" D ^DIR K DIR
50 Q
Note: See TracBrowser for help on using the repository browser.