source: FOIAVistA/trunk/r/AUTOMATED_INFO_COLLECTION_SYS-IBD/IBDF9B2.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 2.6 KB
Line 
1IBDF9B2 ;ALB/CJM - ENCOUNTER FORM - (edit,delete,add multiple choice fields) ;JUL 20,1994
2 ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
3 ;
4MFIELD ;Create, Edit, or Delete a multiple choice field from the form
5 ;
6 N IBVALMBG,QUIT
7 S IBVALMBG=VALMBG
8 S QUIT=0
9 S VALMBCK="R"
10 ;
11 F D Q:QUIT
12 .D FULL^VALM1
13 .K DIR S DIR("?",1)="You can Create, Edit, or Delete a multiple choice field, or Shift all of the",DIR("?")="multiple choice fields within a definable range either up or down."
14 .W !!,DIR("?",1),!,DIR("?"),!
15 .S DIR("B")="C",DIR(0)="SB^C:Create;E:Edit;D:Delete;S:Shift;Q:Quit",DIR("A")="[C]reate, [D]elete, [E]dit, [S]hift, [Q]uit"
16 .D ^DIR K DIR I $D(DIRUT)!(Y<0) S QUIT=1 Q
17 .I Y="Q" S QUIT=1 Q
18 .D @$S(Y="C":"NEWFLD",Y="E":"EDITFLD",Y="D":"DLTFLD",Y="S":"SHIFT",1:"")
19 .D RE^VALM4
20 .D FULL^VALM1
21 S VALMBCK="R",VALMBG=IBVALMBG
22 Q
23SHIFT ;expects IBBLK to be defined - shifts all input fields within range supplied by user
24 D SHIFT^IBDF10("M")
25 D UNCMPBLK^IBDF19(IBBLK),IDXBLOCK^IBDFU4
26 Q
27EDITFLD ;expects IBBLK to be defined
28 N IBFIELD,RTN,NODE
29 N IBOLD,IBX,IBY,IBLEN,IBTYPE,IBLABEL,IBQUAL,IBID ;these are used in the input template
30 D SELECT
31 I IBFIELD D
32 .D RE^VALM4
33 .S (IBX,IBY,IBLEN)=0
34 .S IBOLD=1,IBTYPE=$P($G(^IBE(357.93,IBFIELD,0)),"^",6)
35 .K DR,DIE,DA S DIE=357.93,DA=IBFIELD,DR="[IBDF EDIT MULT CHOICE FIELD]",DIE("NO^")="BACKOUTOK" D ^DIE K DIE,DR,DA,DIC
36 .D UNCMPBLK^IBDF19(IBBLK),IDXBLOCK^IBDFU4
37 Q
38SELECT ;
39 S IBFIELD=0
40 Q:'$G(IBBLK)
41 I '$O(^IBE(357.93,"C",IBBLK,0)) W !,"There is no multiple choice field!" D PAUSE^IBDFU5 Q
42AGAIN K DIC S DIC="^IBE(357.93,",DIC(0)="EFQ",DIC("B")="",D="C",X=IBBLK
43 S DIC("S")="I $P($G(^(0)),U,8)=IBBLK"
44 D IX^DIC K DIC
45 S:+Y>0 IBFIELD=+Y
46 I 'IBFIELD,'$D(DTOUT),'$D(DUOUT) K DIR S DIR(0)="Y",DIR("A")="No multiple choice field selected! Try again",DIR("B")="YES" D ^DIR K DIR I '$D(DIRUT),Y=1 G AGAIN
47 Q
48DLTFLD ;expects IBBLK to be defined
49 N IBFIELD
50 D SELECT
51 I IBFIELD D
52 .Q:'$$RUSURE^IBDFU5($P($G(^IBE(357.93,IBFIELD,0)),"^"))
53 .D DLTIFLD^IBDFU3(357.93,IBBLK,IBFIELD)
54 .D UNCMPBLK^IBDF19(IBBLK),IDXBLOCK^IBDFU4
55 Q
56NEWFLD ;adds a new field, expects IBBLK to be defined
57 N NAME,FIELD,NODE,IBRTN,DLAYGO
58 N IBX,IBY,IBLEN,IBOLD,IBTYPE,IBLABEL,IBQUAL,IBID ;these are used in the input template
59 S NAME=$$NEWNAME^IBDF9B
60 Q:NAME=-1
61 S IBOLD=0,(IBX,IBY,IBLEN)=""
62 K DIC,DIE,DD,DO,DINUM S DIC="^IBE(357.93,",DIC(0)="FL",X=NAME,DLAYGO=357.93
63 D FILE^DICN K DIC,DIE,DA
64 S FIELD=$S(+Y<0:"",1:+Y)
65 I 'FIELD D
66 .W !,"Unable to create a new input field!" D PAUSE^IBDFU5
67 I FIELD D
68 .K DIE,DA,DR S DIE=357.93,DA=FIELD,DR="[IBDF EDIT MULT CHOICE FIELD]",DIE("NO^")="BACKOUTOK" D ^DIE K DIE,DR,DA,DIC
69 .D UNCMPBLK^IBDF19(IBBLK),IDXBLOCK^IBDFU4
70 Q
Note: See TracBrowser for help on using the repository browser.