source: FOIAVistA/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMDEDI.m@ 765

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

initial load of FOIAVistA 6/30/08 version

File size: 4.4 KB
Line 
1PXRMDEDI ; SLC/PJH - Edit PXRM reminder dialog. ;05/31/2006
2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
3 ;
4 ;Used by protocol PXRM DIALOG SELECTION ITEM
5 ;
6ASK(PIEN,SEQ) ;Ask if OK to delete
7 N DDATA,DIR,DTYP,NAME,TYP,X,Y
8 K DIROUT,DIRUT,DTOUT,DUOUT
9 S DDATA=$G(^PXRMD(801.41,PIEN,0))
10 S NAME=$P(DDATA,U),TYP=$P(DDATA,U,4)
11 S DIR(0)="YA0"
12 S DIR("A")="Delete sequence "_SEQ_" from "
13 I TYP="G" S DIR("A")=DIR("A")_"group "_NAME_": "
14 E S DIR("A")=DIR("A")_"reminder dialog "_NAME_": "
15 S DIR("B")="N"
16 S DIR("?")="Enter Y or N. For detailed help type ??"
17 S DIR("??")=U_"D XHLP^PXRMDLG(1)"
18 D ^DIR K DIR
19 I $D(DIROUT) S DTOUT=1
20 I $D(DTOUT)!($D(DUOUT)) Q
21 I $E(Y(0))="N" S DUOUT=1
22 S VALMBCK="R"
23 Q
24 ;
25DEL(SEQ,PXRMDIEN) ;Delete individual element from dialog or group
26 N DA,DIK
27 S DIEN=0
28 F S DIEN=$O(^PXRMD(801.41,PXRMDIEN,10,DIEN)) Q:'DIEN D
29 .I $P($G(^PXRMD(801.41,PXRMDIEN,10,DIEN,0)),U)=SEQ D
30 ..S DA(1)=PXRMDIEN,DA=DIEN W !,"DA: "_DA Q:'DA
31 ..S DIK="^PXRMD(801.41,"_DA(1)_",10,"
32 ..D ^DIK
33 S VALMBG=1
34 Q
35 ;
36IND(DIEN,SEL) ;Edit individual element
37 W IORESET
38 N DIC,DIDEL,DR,DTOUT,DTYP,DUOUT,DINUSE,HED,LFIND,LOCK,NATIONAL,OIEN,PLOCK,Y
39 ;
40 S OIEN=0
41 ;Check for Uneditable flag
42 S LOCK=$P($G(^PXRMD(801.41,DIEN,100)),U,4)
43 S LFIND=$P($G(^PXRMD(801.41,DIEN,1)),U,5)
44 I LOCK=1,$G(LFIND)'="",$G(LFIND)'["ORD",'$G(PXRMINST) D Q
45 .W !,"This item can not be edited" H 2
46 ;
47 S NATIONAL=0
48 ;Limited edit of National dialogs
49 I $P($G(^PXRMD(801.41,PXRMDIEN,100)),U)="N" D
50 .I $G(PXRMINST)=1,DUZ(0)="@" Q
51 .S NATIONAL=1
52 .S PLOCK=$P($G(^PXRMD(801.41,PXRMDIEN,100)),U,4)
53 ;
54 N ANS,DATA,PIEN,SEQ
55 ;Get group or reminder dialog ien for this component
56 S DATA=$G(^TMP("PXRMDLG4",$J,"IEN",SEL))
57 S PIEN=$P(DATA,U),SEQ=$P(DATA,U,2)
58 ;National dialogs can only be edited
59 I NATIONAL S ANS="E"
60 ;In Group edit the group can only be edited
61 I DIEN=PXRMDIEN S ANS="E"
62 ;Ask what to do with local dialogs
63 S DTYP=$P($G(^PXRMD(801.41,DIEN,0)),U,4) Q:DTYP=""
64 I (('NATIONAL)&(DIEN'=PXRMDIEN))!((NATIONAL)&($G(PLOCK)=1)&(DIEN'=PXRMDIEN)&($G(LOCK)'=1)) D Q:$D(DUOUT)!$D(DTOUT)
65 .D PROMPT(.ANS,DIEN) Q:$D(DTOUT)!$D(DUOUT)
66 .;Display usage
67 .I "DC"[ANS D
68 ..W !,"Dialog Name: "_$P($G(^PXRMD(801.41,DIEN,0)),U)
69 .; Verify delete
70 .I ANS="D" D ASK(PIEN,SEQ)
71 ;Ask what to do with National Dialogs that have a lock on them
72 ;I NATIONAL,DIEN'=PXRMDIEN,$P($G(^PXRMD(801.41,DIEN,100)),U,4)=1 D Q:$D(DUOUT)!$D(DTOUT)
73 I NATIONAL,DIEN'=PXRMDIEN,LOCK=1,DTYP="G" D Q
74 .W !,"Cannot modify lock group from a higher level view. Please modify"
75 .W !,"this group from the group editor screen." H 2
76 ;
77 ;Delete line
78 I ANS="D" D DEL(SEQ,PIEN) Q
79 ;Copy and Replace option
80 I ANS="C" D SEL^PXRMDCPY(.DIEN,PIEN) Q:$D(DTOUT)!$D(DUOUT)
81 ;Determine if a taxonomy dialog
82 N FIND
83 I ANS="R" S OIEN=DIEN,(IEN,DIEN)=$P($G(^PXRMD(801.41,DIEN,49)),U,3)
84 S FIND=$P($G(^PXRMD(801.41,IEN,1)),U,5),VALMBCK="R"
85 ;Edit taxomomy dialog
86 I $P(FIND,";",2)="PXD(811.2," D EDIT^PXRMGEDT("DTAX",$P(FIND,";"),0) Q
87 ;Option to change an element to a group
88 I DTYP="E",'NATIONAL D NTYP^PXRMDEDT(.DTYP) Q:$D(DUOUT)!$D(DTOUT) D:DTYP="G"
89 .S $P(^PXRMD(801.41,DIEN,0),U,4)=DTYP
90 .W !,"Dialog element changed to a dialog group"
91 ;Edit Element
92 D EDIT^PXRMDEDT(DTYP,DIEN,OIEN)
93 Q
94 ;
95PROMPT(ANS,DIEN) ;Select Dialog Element Action
96 N NAME,X,Y,DIR K DIROUT,DIRUT,DTOUT,DUOUT
97 S DIR(0)="S"_U_"E:Edit;"
98 S DIR(0)=DIR(0)_"C:Copy and Replace current element;"
99 S DIR(0)=DIR(0)_"D:Delete element from this dialog;"
100 I $P($G(^PXRMD(801.41,DIEN,49)),U,3)>0 D
101 .S NAME=$P($G(^PXRMD(801.41,$P($G(^PXRMD(801.41,DIEN,49)),U,3),0)),U)
102 .S DIR(0)=DIR(0)_"R:Edit Replacement Element/Group "_NAME_";"
103 S DIR("A")="Select Dialog Element Action"
104 S DIR("B")="E"
105 S DIR("?")="Select from the codes displayed. For detailed help type ??"
106 S DIR("??")=U_"D HELP^PXRMDEDI(1)"
107 D ^DIR K DIR
108 I $D(DIROUT) S DTOUT=1
109 I $D(DTOUT)!($D(DUOUT)) Q
110 S ANS=Y
111 Q
112 ;
113HELP(CALL) ;General help text routine
114 N HTEXT
115 N DIWF,DIWL,DIWR,IC
116 S DIWF="C70",DIWL=0,DIWR=70
117 ;
118 I CALL=1 D
119 .S HTEXT(1)="Select E to edit dialog element. If you wish to create"
120 .S HTEXT(2)="a new dialog element just for this reminder dialog select"
121 .S HTEXT(3)="C to copy and replace the current element. Select D to"
122 .S HTEXT(4)="delete the sequence number/element from the dialog."
123 K ^UTILITY($J,"W")
124 S IC=""
125 F S IC=$O(HTEXT(IC)) Q:IC="" D
126 . S X=HTEXT(IC)
127 . D ^DIWP
128 W !
129 S IC=0
130 F S IC=$O(^UTILITY($J,"W",0,IC)) Q:IC="" D
131 . W !,^UTILITY($J,"W",0,IC,0)
132 K ^UTILITY($J,"W")
133 W !
134 Q
Note: See TracBrowser for help on using the repository browser.