source: WorldVistAEHR/trunk/r/EVENT_CAPTURE-EC--ECT--ECX/ECDSINAC.m@ 1608

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

initial load of WorldVistAEHR

File size: 5.3 KB
Line 
1ECDSINAC ;BIR/RHK,TTH,JPW-Inactivate Event Code Screen ;6 May 96
2 ;;2.0; EVENT CAPTURE ;;8 May 96
3 ;This routine allows the users to inactive or active procedures.
4 ;in the Event Code Screen file.
5 I $O(^DIC(4,"LOC",""))="" W !,"You have no locations flagged for event capture.",!,"See your program coordinator.",!! W "Press <RET> to continue " R X:DTIME K X Q
6UNIT ;Allow user to enter DSS Unit.
7 K DIRUT W @IOF,!,"Inactivate Event Code Screen",! F XX=0:1:79 W "-"
8 S NOTIOF=1 D ^ECL K NOTIOF G END:ECOUT!('$D(ECL))
9 K DIC S DIC=724,DIC(0)="QEAMZ",DIC("A")="Select DSS Unit: ",DIC("S")="I $D(^ECJ(""AP"",ECL,+Y))" D ^DIC K DIC G:Y<0 END S (ECC,ECD)=+Y,ECDN=$P(Y,U,2) I $P(^(0),U,11) S ECCT=1
10 I $D(ECCT) D G END:$G(ECOUT)=1
11 .I '$O(^ECJ("AP",ECL,ECD,"")) S ECC=0 W !,"Category: None" Q
12 .D CAT
13 I '$D(ECCT) S ECC=0 W !,"Category: None"
14 G PROC
15CAT ;Display or allow user to select category.
16 S (CNT,ECC)=0
17 F ECCAT=0:0 S ECCAT=$O(^ECJ("AP",ECL,ECD,ECCAT)) Q:'ECCAT S ECC=ECCAT,CNT=CNT+1
18 I CNT'>1 S ECCN=$P(^EC(726,ECC,0),U) W !,"Category: ",ECCN Q
19 K Y S DIC=726,DIC(0)="AEQMZ",DIC("A")="Select Category: ",DIC("S")="I $D(^ECJ(""AP"",ECL,ECD,+Y))"
20 D ^DIC K DIC I Y<0 S ECOUT=1 Q
21 S ECC=+Y,ECCN=$P(Y,U,2)
22 Q
23PROC ;Set Procedures in ^TMP array.
24 S ECC1=ECC ;**NOTE**If 'ECC in PROS^ECHECK1, ECC is set to null.
25PROC1 K ^TMP("ECPRO",$J) S ECOUT=0,ECACTIV=1 D PROS^ECHECK1
26PROC2 W !!,"Enter Procedure: " R XX:DTIME
27 I XX="^" K ^TMP("ECPRO",$J) S ECOUT=1
28 I XX="" S:$G(ECDONE) ECOUT=1
29 I XX="?" D HELP G PROC2
30 I XX="??" D LISTALL I $D(DUOUT)!($D(DTOUT)) S ECOUT=1
31 I ECOUT!('$D(XX)&('$G(ECDONE))) G END
32 ;Match user selection to specific cross-references in ^TMP("ECPRO".
33 D MATCH G:$G(ECPROC) STUFF G:ECOUT END
34 I '$G(ECPROC) D LISTALL
35 I $G(ECOUT)!('$G(ECDONE)) G END
36 ;
37STUFF ;Inactive or active Event Code Screen.
38 S DA=$P(^TMP("ECPRO",$J,ECPROC),U,2),(ECDEL,ECYES)=0
39 I $P($G(^ECJ(DA,0)),"^",2),$P($G(^ECJ(DA,0)),"^",2)'>DT S ECYES=1
40 I $G(ECYES)=0 D G:Y=0 REPET I $D(DIRUT)!(Y<0) S ECOUT=1 G END
41 .K Y W ! S DIR(0)="Y",DIR("B")="YES",DIR("A")="Are you sure that you want to inactivate this procedure"
42 .D ^DIR
43 I $P($G(^ECJ(DA,0)),"^",2),$P($G(^ECJ(DA,0)),"^",2)'>DT D RETURN2 G:$D(DIRUT) END I ECDEL=0 D END0 G PROC2
44 S DIE=720.3 D D ^DIE K DIE,DR,DA
45 .I $G(ECDEL)=1 S DR="1////@" Q
46 .S DR="1///^S X=DT"
47 S PROC=$P(^TMP("ECPRO",$J,ECPROC),U,8)
48 S PROCNAM=$P(^TMP("ECPRO",$J,ECPROC),U,4)
49 S ECTEST(1)=ECL_"-"_ECD_"-"_ECC1_"-"_PROC
50 W !!,"Event Code Screen: ",ECTEST(1)
51 W !,"Procedure: ",PROCNAM," is now"_$S($G(ECDEL)=1:" ",1:" in")_"activated."
52REPET D END1 G PROC2
53 Q
54END ;Kill variables.
55 I $G(ECOUT)=1 K ^TMP("ECPRO",$J)
56 K ECC,ECL,ECD,ECC1,ECHOICE,ECR,ANS,ECOUT,ECPROS,OK
57END0 K DIRUT,DTOUT,DUOUT,ECACTIV,ECCT,ECDEL,ECDONE,ECINAC,ECLN,ECP,ECPC,ECPCC,ECPN,ECPNN,ECPRIEN,ECPRO,ECHOICE,ECR
58 K ECPROF,ECPRONAM,ECPT,ECUCAT,ECUCATN,FROOT,RK,XX,Y
59END1 K CNT,DA,DIC,DIE,DIR,DISYS,DR,ECCAT,ECCN,ECCT,ECDEL,ECDN,ECPROC,ECTEST,ECYES,LOC,PROC,PROCNAM,ECHOICE,ECR,ECDONE
60 Q
61LISTALL ;Display the available procedures.
62 K ECR S ANS="" W @IOF,!!,"Available Procedures: ",!! D LABEL
63 S CNT=0 F XX=0:0 S XX=$O(^TMP("ECPRO",$J,XX)) Q:'XX!($D(ECHOICE)) D:($Y+5>IOSL) SPLIT Q:$D(ECHOICE)!($G(ECOUT)=1) G:$D(ECR) LISTALL I ANS="" D
64 .S CNT=CNT+1 W !,$E(XX,1,4),?7,$E($P(^TMP("ECPRO",$J,XX),U,3),1,32),?41,$E($P(^TMP("ECPRO",$J,XX),U,4),1,30),?73,$P(^TMP("ECPRO",$J,XX),U,5)
65 Q:$D(ECHOICE)!($D(ECDONE))!($G(ECOUT)=1)
66 W !!,"Select Number (1-"_CNT_"): " R ANS:DTIME
67 I ANS="^"!('$T)!(ANS="") K ^TMP("ECPRO",$J) S ECOUT=1 Q
68 I $D(^TMP("ECPRO",$J,+ANS)) S ECOUT=0
69 I ANS["?" W !!,"This is a listing of all available, active procedures.",!,"Please enter the correct number corresponding to the desired procedure.",! D RETURN Q:ECOUT G LISTALL
70 I ANS'?1.4N!'ANS W !!,"Select a single number corresponding to the procedure.",! D RETURN Q:ECOUT G LISTALL
71 I '$D(^TMP("ECPRO",$J,+ANS)) W " **Invalid Number**",! D RETURN Q:ECOUT G LISTALL
72 I $D(^TMP("ECPRO",$J,+ANS)) S ECPROC=+ANS,ECDONE=1 ;Answer selected.
73 Q
74RETURN ;Ask user to exit or continue.
75 W ! S DIR(0)="E" D ^DIR K DIR I $D(DUOUT)!($D(DTOUT)) S ECOUT=1
76 Q
77RETURN2 ;Ask user to activate procedures.
78 W !!,"The Event Code Screen for this procedure has a status of inactive."
79 S DIR(0)="Y",DIR("A")="However, would you like to activate it",DIR("B")="NO" D ^DIR S ECDEL=+Y I $D(DUOUT)!($D(DIRUT))!($D(DTOUT)) S ECOUT=1
80 Q
81MATCH ;Check ^TMP cross-references.
82 I XX="" S ECOUT=1 Q
83 I $O(^TMP("ECPRO",$J,"B",XX,0)) S ECPROC=+$O(^TMP("ECPRO",$J,"B",XX,0))
84 I $O(^TMP("ECPRO",$J,"N",XX,0)) S ECPROC=+$O(^TMP("ECPRO",$J,"N",XX,0))
85 I $O(^TMP("ECPRO",$J,"SYN",XX,0)) S ECPROC=+$O(^TMP("ECPRO",$J,"SYN",XX,0))
86 Q
87LABEL W !,"Num",?7,"Synonym",?41,"Procedure Name",?73,"Nat ID",!
88 W "---",?7,"-------",?41,"--------------",?73,"------",!
89 Q
90HELP ;Display user options.
91 W !!,"Enter one of the following: < Procedure Name",!,?29,"< Procedure Number"
92 W !,?29,"< Procedure Synonym",!,?29,"< Enter ""??"" to List Procedures",!
93 Q
94SPLIT ;
95 W !!,"Select Number, or press <RET> to continue listing : " R ANS:DTIME
96 I '$T!(ANS="^") S (ECOUT,ECHOICE)=1 Q
97 I ANS="" W @IOF D LABEL Q
98 I ANS["?" W !!,"Please enter the correct number corresponding to the desired procedure.",! D RETURN S ECR=1 Q
99 I ANS'?1.4N!'ANS W !!,"Select a single number corresponding to the procedure.",! D RETURN S ECR=1 Q
100 I '$D(^TMP("ECPRO",$J,+ANS)) W " ** Invalid Number **" D RETURN S ECR=1 Q
101 I $D(^TMP("ECPRO",$J,+ANS)) S ECPROC=+ANS,(ECDONE,ECHOICE)=1
102 Q
Note: See TracBrowser for help on using the repository browser.