source: WorldVistAEHR/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMETM.m@ 1261

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

revised back to 6/30/08 version

File size: 4.5 KB
RevLine 
[623]1PXRMETM ; SLC/PKR/PJH - Extract/Transmission Management ;05/15/2006
2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
3 ;
4 ;Main entry point for PXRM EXTRACT MANAGEMENT
5START N PXRMDONE,VALMBCK,VALMCNT,VALMSG,X,XMZ,XQORM,XQORNOD
6 S X="IORESET"
7 D ENDR^%ZISS
8 S VALMCNT=0
9 D EN^VALM("PXRM EXTRACT MANAGEMENT")
10 W IORESET
11 D KILL^%ZISS
12 Q
13 ;
14BLDLIST ;Build workfile
15 K ^TMP("PXRMETM",$J)
16 N IEN,IND,PLIST
17 D LIST(.PLIST,.IEN)
18 M ^TMP("PXRMETM",$J)=PLIST
19 S VALMCNT=PLIST("VALMCNT")
20 F IND=1:1:VALMCNT D
21 .S ^TMP("PXRMETM",$J,"IDX",IND,IND)=IEN(IND)
22 Q
23 ;
24LIST(RLIST,IEN) ;Build a list of extract definition entries.
25 N EPCLASS,IND,FNAME,NAME
26 ;Build the list in alphabetical order.
27 S VALMCNT=0
28 S NAME=""
29 F S NAME=$O(^PXRM(810.2,"B",NAME)) Q:NAME="" D
30 .S IND=$O(^PXRM(810.2,"B",NAME,"")) Q:'IND
31 .S FNAME=$P($G(^PXRM(810.2,IND,0)),U)
32 .S EPCLASS=$P($G(^PXRM(810.2,IND,100)),U)
33 .S VALMCNT=VALMCNT+1
34 .S RLIST(VALMCNT,0)=$$FRE(VALMCNT,FNAME,EPCLASS)
35 .S IEN(VALMCNT)=IND
36 S RLIST("VALMCNT")=VALMCNT
37 Q
38 ;
39FRE(NUMBER,NAME,CLASS) ;Format entry number, name
40 ;and date packed.
41 N TCLASS,TEMP,TNAME,TSOURCE
42 S TEMP=$$RJ^XLFSTR(NUMBER,5," ")
43 S TNAME=$E(NAME,1,46)
44 S TEMP=TEMP_" "_$$LJ^XLFSTR(TNAME,60," ")
45 S TCLASS=$S(CLASS="N":"NATIONAL",CLASS="V":"VISN",1:"LOCAL")
46 S TEMP=TEMP_" "_TCLASS
47 Q TEMP
48 ;
49ENTRY ;Entry code
50 D BLDLIST,XQORM
51 Q
52 ;
53EXIT ;Exit code
54 K ^TMP("PXRMETM",$J)
55 K ^TMP("PXRMETMH",$J)
56 D CLEAN^VALM10
57 D FULL^VALM1
58 S VALMBCK="Q"
59 Q
60 ;
61HDR ; Header code
62 S VALMHDR(1)="Available Extract Definitions:"
63 S VALMSG="+ Next Screen - Prev Screen ?? More Actions"
64 Q
65 ;
66HLP ;Help code
67 N ORU,ORUPRMT,SUB,XQORM
68 S SUB="PXRMETMH"
69 D EN^VALM("PXRM EXTRACT HELP")
70 Q
71 ;
72INIT ;Init
73 S VALMCNT=0
74 Q
75 ;
76PEXIT ;Protocol exit code
77 S VALMSG="+ Next Screen - Prev Screen ?? More Actions"
78 ;Reset after page up/down etc
79 D XQORM
80 Q
81 ;
82XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXTRACT MANAGEMENT SELECT ENTRY",0))_U_"1:"_VALMCNT
83 S XQORM("A")="Select Item: "
84 Q
85 ;
86XSEL ;PXRM EXTRACT MANAGEMENT SELECT ENTRY validation
87 N SEL,IEN
88 S SEL=$P(XQORNOD(0),"=",2)
89 ;Remove trailing ,
90 I $E(SEL,$L(SEL))="," S SEL=$E(SEL,1,$L(SEL)-1)
91 ;Invalid selection
92 I SEL["," D Q
93 .W $C(7),!,"Only one item number allowed." H 2
94 .S VALMBCK="R"
95 I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("IDX",SEL))) D Q
96 .W $C(7),!,SEL_" is not a valid item number." H 2
97 .S VALMBCK="R"
98 ;
99 ;Get the list ien.
100 S IEN=^TMP("PXRMETM",$J,"IDX",SEL,SEL)
101 ;
102 ;Full screen mode
103 D FULL^VALM1
104 ;
105 ;Options
106 N X,Y,DIR,OPTION K DIROUT,DIRUT,DTOUT,DUOUT
107 S DIR(0)="SBM"_U_"EDM:Extract Definition Management;"
108 S DIR(0)=DIR(0)_"VSE:Examine/Schedule Extract;"
109 S DIR("A")="Select Action"
110 S DIR("B")="VSE"
111 S DIR("?")="Select from the codes displayed. For detailed help type ??"
112 S DIR("??")=U_"D HELP^PXRMETM(1)"
113 D ^DIR K DIR
114 I $D(DIROUT) S DTOUT=1
115 I $D(DTOUT)!($D(DUOUT)) S VALMBCK="R" Q
116 S OPTION=Y
117 ;
118 ;Display Extract Definitions
119 I OPTION="EDM" D
120 .D START^PXRMEPED(IEN)
121 ;
122 ;Examine/Run Extract
123 I OPTION="VSE" D
124 .D START^PXRMETH(IEN)
125 ;
126 ;Examine/Run Extract
127 I OPTION="ERE" D
128 .D GENSEL(IEN)
129 ;
130 S VALMBCK="R"
131 Q
132 ;
133HELP(CALL) ;General help text routine
134 N HTEXT
135 I CALL=1 D
136 .S HTEXT(1)="Select EDM to edit/display extract definitions."
137 .S HTEXT(2)="extract. Select VSE to view previous extracts or "
138 .S HTEXT(3)="initiate a manual extract or transmission."
139 ;
140 D HELP^PXRMEUT(.HTEXT)
141 Q
142 ;
143GEN ;Ad hoc report option
144 ;
145 ;Reset Screen Mode
146 W IORESET
147 ;
148 N IND,LISTIEN,VALMY
149 D EN^VALM2(XQORNOD(0))
150 ;If there is no list quit.
151 I '$D(VALMY) Q
152 S PXRMDONE=0
153 S IND=""
154 F S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE) D
155 .;Get the ien.
156 .S LISTIEN=^TMP("PXRMETM",$J,"IDX",IND,IND)
157 .D GENSEL(LISTIEN)
158 ;
159 S VALMBCK="R"
160 Q
161 ;
162GENSEL(IEN) ;Report for selected extract definition
163 N ANS,BEGIN,END,RTN,TEXT
164 D DATES^PXRMEUT(.BEGIN,.END,"Report")
165 ;Options
166 S RTN="PXRMETM",TEXT="Run compliance report for this period"
167 S ANS=$$ASKYN^PXRMEUT("N",TEXT,RTN,1) Q:'ANS Q:$D(DUOUT)!$D(DTOUT)
168 ;Print Report
169 D ADHOC^PXRMETCO(IEN,BEGIN,END)
170 Q
171 ;
172HLIST ;Extract History
173 N IND,LISTIEN,VALMY
174 D EN^VALM2(XQORNOD(0))
175 ;If there is no list quit.
176 I '$D(VALMY) Q
177 S PXRMDONE=0
178 S IND=""
179 F S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE) D
180 .;Get the ien.
181 .S LISTIEN=^TMP("PXRMETM",$J,"IDX",IND,IND)
182 .D START^PXRMETH(LISTIEN)
183 S VALMBCK="R"
184 Q
185 ;
186PLIST ;Extract Definition Inquiry
187 N IND,EPIEN,VALMY
188 D EN^VALM2(XQORNOD(0))
189 ;If there is no list quit.
190 I '$D(VALMY) Q
191 S PXRMDONE=0
192 S IND=""
193 F S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE) D
194 .;Get the ien.
195 .S EPIEN=^TMP("PXRMETM",$J,"IDX",IND,IND)
196 .D START^PXRMEPED(EPIEN)
197 ;
198 S VALMBCK="R"
199 Q
Note: See TracBrowser for help on using the repository browser.