source: WorldVistAEHR/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMDLG5.m@ 949

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

revised back to 6/30/08 version

File size: 3.9 KB
Line 
1PXRMDLG5 ; SLC/PJH - Reminder Dialog Edit/Inquiry ;05/17/2006
2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
3 ;
4 ;
5ASK(YESNO,PIEN) ;Confirm
6 K DIR,DIROUT,DIRUT,DNAME,DTOUT,DTYP,DUOUT,TEXT,X,Y
7 N DDATA,DNAME,DTYP
8 S DDATA=$G(^PXRMD(801.41,PIEN,0))
9 ;Parent name and type
10 S DNAME=$P(DDATA,U),DTYP=$P(DDATA,U,4)
11 ;
12 S DIR(0)="YA0"
13 S DIR("A")="Add sequence "_SEQ_" to "
14 I DTYP="G" S DIR("A")=DIR("A")_"group "_DNAME_": "
15 E S DIR("A")=DIR("A")_"reminder dialog ?: "
16 S DIR("B")="N",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 S YESNO=$E(Y(0)) I YESNO'="Y" S DUOUT=1
22 S VALMBCK="R"
23 Q
24 ;
25MSEL(NUM) ;
26 I NUM=4,'$$PATCH^XPDUTL("OR*3.0*243") D EN^DDIOL("THIS SELECTION IS NOT VALID, UNTIL CPRS 27 IS INSTALLED") Q 0
27 Q 1
28 ;
29ALT(DIEN,LEV,DSEQ,NODE,VIEW,NLINE,CNT,ALTLEN) ;
30 ;Display branching logic text in dialog summary view
31 N DATA,DNAM,DTYP,IEN,TERM,TNAME,TSTAT,TEMP
32 S DATA=$G(^PXRMD(801.41,DIEN,49))
33 I '+$P(DATA,U)!($P($G(DATA),U,2)="") Q
34 S TNAME=$P($G(^PXRMD(811.5,$P(DATA,U),0)),U)
35 S TSTAT=$S($P(DATA,U,2)="1":"TRUE",1:"FALSE")
36 I +$P(DATA,U,3)>0 D
37 .S IEN=$P(DATA,U,3),DNAM=$P($G(^PXRMD(801.41,IEN,0)),U)
38 .S DTYP=$S($P($G(^PXRMD(801.41,IEN,0)),U,4)="E":"Element",$P($G(^PXRMD(801.41,IEN,0)),U,4)="G":"Group")
39 I $G(DNAM)="" S TEMP="Suppressed if Reminder Term "_TNAME_" evaluates as "_TSTAT
40 I $G(DNAM)'="" S TEMP="Replaced by "_DNAM_" if Reminder Term "_TNAME_" evaluates as "_TSTAT
41 D TEXT(.NLINES,CNT,ALTLEN,TEMP,NODE)
42 Q
43 ;
44OTERM(DA) ;
45 K OTERM
46 S OTERM=$P($G(^PXRMD(801.41,DA,49)),U) Q
47 ;
48NTERM(DA,OTERM,NTERM) ;
49 I +OTERM=0 S OTERM=$P($G(DA),U)
50 I +NTERM=0 K OTERM Q 2
51 I +OTERM=0,+NTERM>0 K OTERM Q 1
52 I +OTERM'=+NTERM K OTERM Q 0
53 K OTERM
54 Q 1
55 ;
56TERMS(DA,X) ;
57 N TERM
58 S TERM=$P($G(^PXRMD(801.41,DA,49)),U)
59 I +TERM=0 D Q 0
60 .W !,"Cannot set Reminder Term Status if the Reminder Term field is blank"
61 .H 2
62 I +TERM>0,$G(X)="" Q 2
63 Q 1
64 ;
65BHELP(VALUE) ;
66 N HTEXT
67 D FULL^VALM1
68 ;Help text for Reminder Dialog Branching logic
69 I VALUE=1 D
70 .;Reminder Term field
71 .S HTEXT(1)="Enter a reminder term that will be used to determine if the reminder"
72 .S HTEXT(2)="element/group should be replaced or suppressed if the reminder term evaluation"
73 .S HTEXT(3)="matches the value in the Reminder Term Status field."
74 I VALUE=2 D
75 .;Reminder Term Status field
76 .S HTEXT(1)="Enter either 1 for true or 0 for false. This value will be used with the"
77 .S HTEXT(2)="reminder term field to determine if this item should be replaced with a"
78 .S HTEXT(3)="different element/group defined in the Replacement Element/Group field, or if"
79 .S HTEXT(4)="this item should be suppressed."
80 I VALUE=3 D
81 .;Replacement Element/Group field
82 .S HTEXT(1)="Enter an element/group that will be used as a replacement to thisitem, or"
83 .S HTEXT(2)="leave this field blank to suppress this item if the term evaluation"
84 .S HTEXT(3)="matches the value defined in the term status field. "
85 I VALUE=4 D
86 .;Patient Specific field
87 .S HTEXT(1)="Enter either 1 for true or 0 for false. This value must be set totrue"
88 .S HTEXT(2)="if item in this dialog will be using reminder term to either replace an item"
89 .S HTEXT(3)="or to suppress an item."
90 D HELP^PXRMEUT(.HTEXT)
91 Q
92 ;
93TEXT(NLINES,CNT,ATLEN,TEMP,NODE) ;
94 N CNT1,NOUT,OUTPUT,WIDHT
95 S WIDTH=IOM-(2+(CNT+ATLEN))
96 S CNT1=1 D FORMATS^PXRMTEXT(1,WIDTH,TEMP,.NOUT,.OUTPUT)
97 I NOUT>0 F CNT1=1:1:NOUT D
98 .S NLINE=NLINE+1,^TMP(NODE,$J,NLINE,0)=$J("",2+(CNT+ATLEN))_OUTPUT(CNT1)
99 Q
100 ;
101INQ(DIEN) ;INQ Inquiry/Print option
102 ;
103 ; Used by 801.41 print templates
104 ; [PXRM REMINDER DIALOG]
105 ; [PXRM DIALOG GROUP]
106 ;
107 N DEF,DEF1,DEF2 D DEF^PXRMRUTL("811.902",.DEF,.DEF1,.DEF2)
108 N NLINE,NODE,NSEL,SUB
109 S NLINE=0,NODE="PXRMDLG4",NSEL=0
110 K ^TMP(NODE,$J)
111 ;
112 ;Components
113 W !!," Seq. Dialog",!
114 D DETAIL^PXRMDLG4(DIEN,"",4,NODE)
115 ;
116 ;Print lines from workfile
117 S SUB=""
118 F S SUB=$O(^TMP(NODE,$J,SUB)) Q:'SUB W !,^TMP(NODE,$J,SUB,0)
119 K ^TMP(NODE,$J)
120 Q
Note: See TracBrowser for help on using the repository browser.