source: FOIAVistA/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMDLGH.m@ 1801

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

initial load of FOIAVistA 6/30/08 version

File size: 4.0 KB
Line 
1PXRMDLGH ; SLC/PJH - Reminder Dialog History ;08/16/2001
2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
3 ;
4 ;Called from PXRMDLGZ
5 ;
6START(PXRMITEM,PXRMDIEN,PXRMNAM) ;
7 N PXRMBG,PXRMLINK,PXRMREAD,PXRMSRC,PXRMVARM
8 N VALM,VALMAR,VALMBCK,VALMBG,VALMCNT,VALMHDR,VALMSG,X,XMZ
9 S X="IORESET",PXRMLINK=$P($G(^PXD(811.9,PXRMITEM,51)),U),PXRMDIEN=""
10 D ENDR^%ZISS,EN^VALM("PXRM DIALOG HISTORY")
11 W IORESET
12 D KILL^%ZISS
13 Q
14 ;
15 ;Labels called from list 'PXRM DIALOG HISTORY'
16 ;
17EXIT ;Exit code
18 D CLEAN^VALM10,FULL^VALM1
19 S VALMBCK="Q"
20 K ^TMP("PXRMDLGH",$J)
21 Q
22 ;
23HDR ; Header code
24 S VALMHDR(1)=PXRMHD
25 S VALMSG="+ Next Screen - Prev Screen ?? More Actions"
26 Q
27 ;
28HELP ;Help code
29 N ORU,ORUPRMT,XQORM,PXRMTAG
30 S PXRMTAG="GDLGH"
31 D EN^VALM("PXRM DIALOG MAIN HELP")
32 Q
33 ;
34INIT ;Init
35 S VALMCNT=0
36 ;Get linked dialog
37 S PXRMLINK=$P($G(^PXD(811.9,PXRMITEM,51)),U)
38 ;Load details of reminder dialog
39 D BUILD(PXRMITEM,PXRMLINK)
40 ;Reset Menu
41 D XQORM
42 Q
43 ;
44PEXIT ;PXRM DIALOG HISTORY MENU protocol exit code
45 S VALMSG="+ Next Screen - Prev Screen ?? More Actions"
46 D XQORM
47 Q
48 ;
49 ;Other Subroutines
50 ;
51 ;Build workfile (Entry action for protocol PXRM DIALOG HISTORY)
52BUILD(PXRMITEM,PXRMLINK) ;
53 ;
54 N ARRAY,DARRAY,DDAT,DIEN,DNAM,DSEQ,FIRST,HDR,RIEN,RNAM,TXT
55 ;Clear existing file
56 S VALMCNT=0,VALMBCK="R",FIRST=1,DSEQ=0 K ^TMP("PXRMDLG",$J)
57 ;Get the linked dialog first
58 I PXRMLINK D
59 .S VALMCNT=VALMCNT+1
60 .S ^TMP("PXRMDLG",$J,VALMCNT,0)=$J("",79)
61 .S VALMCNT=VALMCNT+1
62 .S ^TMP("PXRMDLG",$J,VALMCNT,0)="This reminder is linked to dialog:"
63 .S VALMCNT=VALMCNT+1
64 .S ^TMP("PXRMDLG",$J,VALMCNT,0)=$J("",79)
65 .D SET(PXRMITEM,PXRMLINK)
66 .;Get list of other reminders and display
67 .D OTHER(PXRMLINK),OLST("")
68 ;
69 ;Then other dialogs generated from this reminder (ALPHA order)
70 S DIEN=""
71 F S DIEN=$O(^PXRMD(801.41,"AG",PXRMITEM,DIEN)) Q:'DIEN D
72 .Q:DIEN=PXRMLINK
73 .S DNAM=$P($G(^PXRMD(801.41,DIEN,0)),U) Q:DNAM=""
74 .S DARRAY(DNAM)=DIEN
75 ;
76 S DNAM="",HDR=1
77 F S DNAM=$O(DARRAY(DNAM)) Q:DNAM="" D
78 .S DIEN=DARRAY(DNAM) Q:'DIEN
79 .S RIEN=$P($G(^PXD(811.9,DIEN,51)),U),FIRST=1
80 .;Get list of other reminders
81 .D OTHER(DIEN)
82 .;Other dialogs header
83 .I HDR D
84 ..S VALMCNT=VALMCNT+1
85 ..S ^TMP("PXRMDLG",$J,VALMCNT,0)=$J("",79)
86 ..S VALMCNT=VALMCNT+1
87 ..S ^TMP("PXRMDLG",$J,VALMCNT,0)="Other dialogs generated from this reminder:"
88 ..S VALMCNT=VALMCNT+1,HDR=0
89 ..S ^TMP("PXRMDLG",$J,VALMCNT,0)=$J("",79)
90 .;If this reminder isn't linked display the one that is
91 .I 'RIEN D
92 ..N RNAM
93 ..S RNAM=$O(ARRAY("")) Q:RNAM=""
94 ..S RIEN=$G(ARRAY(RNAM)) S:RIEN FIRST=0
95 .;Dialog detail
96 .D SET(RIEN,DIEN)
97 .;Additional reminder detail
98 .S:FIRST RIEN="" D OLST(RIEN)
99 ;
100 I VALMCNT=0 D
101 .S VALMCNT=VALMCNT+1
102 .S ^TMP("PXRMDLG",$J,VALMCNT,0)=" * NO DIALOGS DEFINED *"
103 ;
104 S VALMCNT=VALMCNT+1
105 S ^TMP("PXRMDLG",$J,VALMCNT,0)=$J("",79)
106 S ^TMP("PXRMDLG",$J,"VALMCNT")=VALMCNT
107 ;
108 Q
109 ;
110OTHER(DIEN) ;Other reminders linked to this dialog
111 N DLG,DNAM,RNAM,RSUB
112 ;Linked reminders
113 S RNAM="" K ARRAY
114 F S RNAM=$O(^PXD(811.9,"B",RNAM)) Q:RNAM="" D
115 .S RSUB=$O(^PXD(811.9,"B",RNAM,"")) Q:'RSUB D
116 ..S DLG=$P($G(^PXD(811.9,RSUB,51)),U) Q:DLG'=DIEN
117 ..S RNAM=$P($G(^PXD(811.9,RSUB,0)),U) Q:RNAM=""
118 ..S ARRAY(RNAM)=RSUB
119 Q
120 ;
121OLST(REM) ;List Other Reminders
122 N RNAM
123 S RNAM=""
124 F S RNAM=$O(ARRAY(RNAM)) Q:RNAM="" D
125 .Q:ARRAY(RNAM)=REM Q:ARRAY(RNAM)=PXRMITEM
126 .S VALMCNT=VALMCNT+1
127 .S ^TMP("PXRMDLG",$J,VALMCNT,0)=$J("",59)_RNAM
128 Q
129 ;
130SET(RIEN,DIEN) ;
131 N RNAM,DNAM,DDAT
132 S RNAM="*NONE*",DSEQ=DSEQ+1
133 ;Dialog details
134 S DNAM=$P($G(^PXRMD(801.41,DIEN,0)),U)
135 S DDAT=$P($G(^PXRMD(801.41,DIEN,99)),U,1)
136 S:DDAT="" DDAT=$P($G(^PXRMD(801.41,DIEN,99)),U,2)
137 S DDAT=$$FMTE^XLFDT(DDAT,"1D")
138 ;Reminder details
139 I RIEN D
140 .S RNAM=$P($G(^PXD(811.9,RIEN,0)),U)
141 .I RIEN=PXRMITEM S RNAM=""
142 ;Update display
143 S TXT=$J(DSEQ,4)_" "_$E(DNAM,1,32)_$J("",32-$L(DNAM))
144 S TXT=TXT_" "_DDAT_$J("",20-$L(DDAT))_RNAM
145 S VALMCNT=VALMCNT+1
146 S ^TMP("PXRMDLG",$J,VALMCNT,0)=TXT
147 S ^TMP("PXRMDLG",$J,"IDX",DSEQ,DIEN)=""
148 Q
149 ;
150XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM SELECTION ITEM",0))_U_"1:"_VALMCNT
151 S XQORM("A")="Select Item: "
152 Q
Note: See TracBrowser for help on using the repository browser.