source: WorldVistAEHR/trunk/r/AUTOMATED_INFO_COLLECTION_SYS-IBD/IBDFQEA.m@ 1437

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

initial load of WorldVistAEHR

File size: 5.6 KB
Line 
1IBDFQEA ;ALB/CJM/MAF - ENCOUNTER FORM - BUILD FORM(editing action for group's selections list) ;JUN 16,1995
2 ;;3.0;AUTOMATED INFO COLLECTION SYS;**15,38**;APR 24, 1997
3 ;
4EDIT ;allows editing of an existing selection
5 D FULL^VALM1
6 N SEL,SUB,SLCTN,SC,NODE,OQTY,NQTY
7 D EN^VALM2($G(XQORNOD(0)),"S")
8 S SEL="" F S SEL=$O(VALMY(SEL)) Q:'SEL D
9 .W !,"Editing Entry #",SEL
10 .S SLCTN=$P($G(^TMP("SELIDX",$J,SEL)),"^",3) Q:'SLCTN
11 .S NODE=$G(^IBE(357.3,SLCTN,0))
12 .S IBGRP=$P(NODE,"^",4),ORD=$P(NODE,"^",5)
13 .;re-index the record, to insure it is good
14 .K DIK,DA S DIK="^IBE(357.3,",DA=SLCTN D IX^DIK K DIK
15 .;edit the order of the selection - also, for placeholders, the text, then quit
16 .I $P(NODE,"^",2) S DA=SLCTN,DIE=357.3,DR="[IBDF EDIT PLACE HOLDER]" D ^DIE K DIE,DA,DR Q
17 .S DA=SLCTN,DIE=357.3,DR=".05;I '$P($G(^IBE(357.6,$P($G(^IBE(357.2,+IBLIST,0)),""^"",11),16)),""^"",8) S Y=""@99"";S OQTY=$P(^IBE(357.3,DA,0),""^"",9);.09;S NQTY=X;@99;S CONT=1" S CONT=0 D ^DIE K DIE,DA,DR
18 .D CODES^IBDF4A W !
19 .D ADD^IBDF4C W !
20 .;add any missing subcolumns
21 .S SC=0 F SC=1:1:8 I $G(IBLIST("SCTYPE",SC))=1 I '$D(^IBE(357.3,SLCTN,1,"B",SC)) D
22 ..K DA,DO,DINUM,DIC
23 ..N DLAYGO
24 ..S DIC="^IBE(357.3,"_SLCTN_",1,",DA(1)=SLCTN,X=SC,DIC(0)="L",DLAYGO=357.3 D FILE^DICN
25 .;now allow the user to edit editable subcolumns - CONT=0 means the user up-arrowed out, so stop
26 .I CONT S SUB=0 F S SUB=$O(^IBE(357.3,SLCTN,1,SUB)) Q:'SUB D
27 ..S SC=+$G(^IBE(357.3,SLCTN,1,SUB,0)) I $G(IBLIST("SCTYPE",SC))=1,$G(IBLIST("SCPIECE",SC)),$G(IBLIST("SCEDITABLE",SC)) D
28 ...I $G(^IBE(357.3,SLCTN,1,0))="" S ^IBE(357.3,SLCTN,1,0)="^357.31IA^"
29 ...S DIE="^IBE(357.3,"_SLCTN_",1,",DA(1)=SLCTN,DA=SUB,DR=".02;S CONT=1",CONT=0 W !!,"Editing Subcolumn "_SC_": Header="_IBLIST("SCHDR",SC)
30 ...S IBVAL=$P($G(^IBE(357.3,SLCTN,1,SUB,0)),"^",2)
31 ...I $G(OQTY)'=$G(NQTY) D
32 ....S IBVAL=$P(IBVAL," x "_OQTY)_$S(NQTY>1:" x "_NQTY,1:""),DR=".02////^S X=IBVAL;I;"_DR
33 ...I $P($G(^IBE(357.3,SLCTN,3,0)),"^",4)>0 D
34 ....S IBVAL=$P($G(^IBE(357.3,SLCTN,1,SUB,0)),"^",2)
35 ....S:IBVAL'["w/ mod" IBVAL=IBVAL_" w/ mod"
36 ....S DR=".02////^S X=IBVAL;I;"_DR
37 ...D ^DIE K DIE,DA,DR,IBVAL I 'CONT Q
38 .D NARR^IBDF4 W !
39 .D TERM^IBDF4 W !
40 ;
41EDITEXIT ;
42 G EXIT
43DELETE ;allows the user to select selections to delete
44 D FULL^VALM1
45 N SEL
46 D EN^VALM2($G(XQORNOD(0)))
47 K DA
48 S SEL="" F S SEL=$O(VALMY(SEL)) Q:'SEL D
49 .S DIK="^IBE(357.3,",DA=$P($G(^TMP("SELIDX",$J,SEL)),"^",3) Q:'DA
50 .S NODE=$G(^IBE(357.3,DA,0))
51 .S IBGRP=$P(NODE,"^",4),ORD=$P(NODE,"^",5)
52 .Q:'$$RUSURE^IBDFU5("Selection #"_SEL)
53 .D ^DIK
54 .D KILL^VALM10(SEL)
55 K DIK,DA
56 G EXIT
57ADDSLCTN ;allows the user to add a selection to the selection group
58 N QUIT,SUB
59 ;
60 D FULL^VALM1
61 S IBRTN=IBLIST("RTN")
62 I $G(IBLIST("CLRM")) S IBLIST("EDITING CLRM")=1
63 D RTNDSCR^IBDFU1B(.IBRTN)
64 I IBRTN("ACTION")'=3 D NOGOOD^IBDF4 G ADDEXIT
65 K @IBRTN("DATA_LOCATION")
66 S QUIT=0 F D G:QUIT EXIT W !,"Now for another!",!
67 .I '$$DORTN^IBDFU1B(.IBRTN) S QUIT=1 D NOGOOD^IBDF4 Q
68 .I '$D(@IBRTN("DATA_LOCATION")) S QUIT=1 Q
69 .S DIC="^IBE(357.4,",DIC(0)="AEMN",DIC("S")="I $P(^IBE(357.4,+Y,0),""^"",3)=IBLIST" D ^DIC K DIC S:X="^" QUIT=1 Q:QUIT S IBGRP=+Y I Y<0 D Q:QUIT=1
70 ..W !!,"A SELECTION GROUP HEADER IS REQUIRED.... The selection will not be added if none is provided....Enter '??' for a list of choices.",!!
71 ..S DIC="^IBE(357.4,",DIC(0)="AEMN",DIC("S")="I $P(^IBE(357.4,+Y,0),""^"",3)=IBLIST" D ^DIC K DIC S IBGRP=+Y I Y<0 S QUIT=1 Q
72 .D ADDREC^IBDF4(.QUIT) ;edits and adds the selection
73 .K @IBRTN("DATA_LOCATION")
74ADDEXIT ;
75 G EXIT
76ADDBLANK ;allows the user to add a dummy selection to the selection group
77 ;i.e., a place holder that will not actually print a selection
78 ;
79 ;
80 N IBGRP
81 D FULL^VALM1
82 K DIC S DIC="^IBE(357.4,",DIC(0)="AEMN",DIC("S")="I $D(^IBE(357.3,""APO"",IBLIST,+Y))" D ^DIC S IBGRP=+Y K DIC
83 I ('$D(DIRUT))&(Y>0) D ADD^IBDF4A
84 D INIT^IBDFQSL1
85 S VALMBCK="R"
86 Q
87FORMAT ;allows the user to format all of the selections in the group in mass
88 ;
89 D FORMAT^IBDF9A1
90 G EXIT
91 ;
92GRPDEL ; -- Group Delete
93 D FULL^VALM1
94 N GRP
95 S DIC="^IBE(357.4,",DIC(0)="AEMN",DIC("S")="I $P(^IBE(357.4,+Y,0),""^"",3)=IBLIST" D ^DIC K DIC S IBGRP=+Y I Y<0 G EXIT
96 S GRP=+Y
97 Q:'$$RUSURE^IBDFU5($P($G(^IBE(357.4,GRP,0)),"^"))
98 I GRP D DELSLCTN^IBDF3 K DA S DIK="^IBE(357.4,",DA=GRP D ^DIK K DIK
99 D IDXGRP^IBDF3
100 S VALMBCK="R"
101 D EXIT Q
102 ;
103GROUPADD ; -- Add a new group to the selection list and to file 357.4.
104 D FULL^VALM1
105 N NAME,QUIT,GRP
106 S QUIT=0
107 F D D IDXGRP^IBDF3 G:QUIT EXIT
108 .K DIR S DIR(0)="357.4,.01O",DIR("B")="" D ^DIR K DIR I $D(DIRUT) S QUIT=1 Q
109 .S NAME=Y
110 .K DIC,DD,DO,DINUM S DIC="^IBE(357.4,",X=NAME,DIC(0)=""
111 .D FILE^DICN K DIC,DIE,DA
112 .I +Y<0 W !,"Unable to create a new record!" D PAUSE^VALM1 S QUIT=1 Q
113 .I +Y>0 K DA S DA=+Y,DIE="^IBE(357.4,",DIE("NO^")="Any value",DR=".02;.04;.03////"_IBLIST D ^DIE K DIC,DIE,DR,DA
114 .W !,"Now Another!",!
115 G EXIT
116 ;
117GRPEDIT ;
118 D FULL^VALM1
119 N DIC,DIE,DA,DR,GRP
120 S DIC="^IBE(357.4,",DIC(0)="AEMN",DIC("S")="I $P(^IBE(357.4,+Y,0),""^"",3)=IBLIST" D ^DIC K DIC S IBGRP=+Y I Y<0 G EXIT
121 S GRP=+Y
122 S (DIC,DIE)="^IBE(357.4,",DA=GRP,DR=".01;.02;.04" D ^DIE
123 I '$D(DA) D DELSLCTN^IBDF3
124 D IDXGRP^IBDF3
125 S VALMBCK="R"
126 D EXIT Q
127 Q
128 ;
129EXIT D INIT^IBDFQSL1 S VALMBCK="R"
130 Q
131GRPRESEQ ; -- Resequence numerically or alphabetically a group
132 ; within a block.
133 D FULL^VALM1
134 N DIC,GRP,IBGRP,IBGRUP
135 Q:$$LSTDSCR2^IBDFU1(.IBLIST) 1
136GRP1 S DIC="^IBE(357.4,",DIC(0)="AEMN",DIC("S")="I $P(^IBE(357.4,+Y,0),""^"",3)=IBLIST" D ^DIC K DIC S IBGRUP(+Y)=+Y
137 I Y<0&($D(IBGRUP)) D SEQUENCE^IBDF4,EXIT Q
138 I Y<0&('$D(IBGRUP)) G EXIT
139 G GRP1
140GRPRSEQ1 ; -- Resequence all groups chosen
141 N IBGROUP,IBFLAG
142 S IBGROUP=0,IBFLAG=1
143 F S IBGROUP=$O(IBGRP(IBGROUP)) Q:'IBGROUP D SEQUENCE^IBDF4
144 Q
Note: See TracBrowser for help on using the repository browser.