-
Notifications
You must be signed in to change notification settings - Fork 6
/
VPRJPRN.m
287 lines (287 loc) · 12.4 KB
/
VPRJPRN.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
VPRJPRN ;V4W/DLW -- Wrap Patient CRUD calls to REST endpoints for consumption by jdsClient using cache.node in jds-cache-api
;
QUIT
;
; Get patient demographics from a single site, or from all sites
;
; @param {string} IDENTIFIER - Either a PID, or an ICN
; @param {string} [START=0] - The offset (by count of items) to begin at to add to the return array
; @param {string} [LIMIT=999999] - Limit of items (by count) to add to the return array
; @param {string} [STARTID=""] - The first item (by item number or uid) to add to the return array
; @param {string} [RETCNTS=0] - Return a header with the totalItems and currentItemCount
; @return {RETURNDATA^VPRJUTLN} RETURN - <0|1>:<UUID> Error code followed by UUID key to retrieveQueryResult in client-utils.js
GETPT(IDENTIFIER,START,LIMIT,STARTID,RETCNTS) ; Called as getPtDemographicsBy{Pid,Icn} in jds-client.js
N ARGS,HTTPERR,HTTPREQ,RESULT,UUID
;
; setup code
S ARGS("icndfn")=$G(IDENTIFIER)
S HTTPREQ("store")="vpr"
D SETUP^VPRJUTLN
;
S UUID=$$GENUUID^VPRJUTLN
Q:UUID="1:UUID EXCEPTION" UUID
;
; bail if no pid nor icn was passed in
I $G(IDENTIFIER)="" D SETERROR^VPRJRER(211) QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
;
; call endpoint
D GETPT^VPRJPR(.RESULT,.ARGS)
;
QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
;
; Get patient data by index
;
; @param {string} PID - Patient identifier
; @param {string} INDEX - Index name
; @param {string} [TEMPLATE=""] - Template to use to format the returned data
; @param {string} [ORDER=""] - Order of the data items in the return array [asc|desc] [ci|cs]
; @param {string} [RANGE=""] - A range of keys to limit the items being retrieved by index
; @param {string} [BAIL=""] - Similar to limit, but faster, and is unable to calculate totalItems in RETCNTS
; @param {string} [FILTER=""] - A filter expression to apply to the retrieved items
; @param {string} [START=0] - The offset (by count of items) to begin at to add to the return array
; @param {string} [LIMIT=999999] - Limit of items (by count) to add to the return array
; @param {string} [STARTID=""] - The first item (by item number or uid) to add to the return array
; @param {string} [RETCNTS=0] - Return a header with the totalItems and currentItemCount
; @return {RETURNDATA^VPRJUTLN} RETURN - <0|1>:<UUID> Error code followed by UUID key to retrieveQueryResult in client-utils.js
INDEX(PID,INDEX,TEMPLATE,ORDER,RANGE,BAIL,FILTER,START,LIMIT,STARTID,RETCNTS) ; Called as getPatientIndexData in jds-client.js
N ARGS,HTTPERR,HTTPREQ,RESULT,UUID
;
; setup code
S ARGS("pid")=$G(PID)
S ARGS("indexName")=$G(INDEX)
S ARGS("template")=$G(TEMPLATE)
S ARGS("order")=$G(ORDER)
S ARGS("range")=$G(RANGE)
S ARGS("bail")=$G(BAIL)
S ARGS("filter")=$G(FILTER)
S HTTPREQ("store")="vpr"
D SETUP^VPRJUTLN
;
S UUID=$$GENUUID^VPRJUTLN
Q:UUID="1:UUID EXCEPTION" UUID
;
; bail if no pid was passed in
I $G(PID)="" D SETERROR^VPRJRER(226) QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
; bail if no index was passed in
I $G(INDEX)="" D SETERROR^VPRJRER(101) QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
;
; call endpoint
D INDEX^VPRJPR(.RESULT,.ARGS)
;
QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
;
; Get patient data by searching the VPR data store
;
; @param {string} PID - Patient identifier
; @param {string} COLLECTION = Collection name
; @param {string} [TEMPLATE=""] - Template to use to format the returned data
; @param {string} [ORDER=""] - Order of the data items in the return array [asc|desc] [ci|cs]
; @param {string} [BAIL=""] - Similar to limit, but faster, and is unable to calculate totalItems in RETCNTS
; @param {string} [FILTER=""] - A filter expression to apply to the retrieved items
; @param {string} [START=0] - The offset (by count of items) to begin at to add to the return array
; @param {string} [LIMIT=999999] - Limit of items (by count) to add to the return array
; @param {string} [STARTID=""] - The first item (by item number or uid) to add to the return array
; @param {string} [RETCNTS=0] - Return a header with the totalItems and currentItemCount
; @return {RETURNDATA^VPRJUTLN} RETURN - <0|1>:<UUID> Error code followed by UUID key to retrieveQueryResult in client-utils.js
FIND(PID,COLLECTION,TEMPLATE,ORDER,BAIL,FILTER,START,LIMIT,STARTID,RETCNTS) ; Called as getPatientDomainData in jds-client.js
N ARGS,HTTPERR,HTTPREQ,RESULT,UUID
;
; setup code
S ARGS("pid")=$G(PID)
S ARGS("collection")=$G(COLLECTION)
S ARGS("template")=$G(TEMPLATE)
S ARGS("order")=$G(ORDER)
S ARGS("bail")=$G(BAIL)
S ARGS("filter")=$G(FILTER)
S HTTPREQ("store")="vpr"
D SETUP^VPRJUTLN
;
S UUID=$$GENUUID^VPRJUTLN
Q:UUID="1:UUID EXCEPTION" UUID
;
; bail if no pid was passed in
I $G(PID)="" D SETERROR^VPRJRER(226) QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
; bail if no collection was passed in
I $G(COLLECTION)="" D SETERROR^VPRJRER(215) QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
;
; call endpoint
D FIND^VPRJPR(.RESULT,.ARGS)
;
QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
;
; Get patient data counts per domain
;
; @param {string} PID - Patient identifier
; @param {string} COUNTNAME - Count name
; @param {string} [START=0] - The offset (by count of items) to begin at to add to the return array
; @param {string} [LIMIT=999999] - Limit of items (by count) to add to the return array
; @param {string} [STARTID=""] - The first item (by item number or uid) to add to the return array
; @param {string} [RETCNTS=0] - Return a header with the totalItems and currentItemCount
; @return {RETURNDATA^VPRJUTLN} RETURN - <0|1>:<UUID> Error code followed by UUID key to retrieveQueryResult in client-utils.js
COUNT(PID,COUNTNAME,START,LIMIT,STARTID,RETCNTS) ; Called as getPatientCountData in jds-client.js
N ARGS,HTTPERR,HTTPREQ,RESULT,UUID
;
; setup code
S ARGS("pid")=$G(PID)
S ARGS("countName")=$G(COUNTNAME)
S HTTPREQ("store")="vpr"
D SETUP^VPRJUTLN
;
S UUID=$$GENUUID^VPRJUTLN
Q:UUID="1:UUID EXCEPTION" UUID
;
; bail if no pid was passed in
I $G(PID)="" D SETERROR^VPRJRER(226) QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
;
; call endpoint
D COUNT^VPRJPR(.RESULT,.ARGS)
;
QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
;
; Get all patient data counts per domain
;
; @param {string} COUNTNAME
; @return {RETURNDATA^VPRJUTLN} RETURN - <0|1>:<UUID> Error code followed by UUID key
ALLCOUNT(COUNTNAME) ; Called as getAllCountData in jds-client.js
N ARGS,HTTPERR,HTTPREQ,LIMIT,RESULT,RETCNTS,START,STARTID,UUID
;
; setup code
S ARGS("countName")=$G(COUNTNAME)
S HTTPREQ("store")="xvpr"
D SETUP^VPRJUTLN
;
S UUID=$$GENUUID^VPRJUTLN
Q:UUID="1:UUID EXCEPTION" UUID
;
; call endpoint
D ALLCOUNT^VPRJPR(.RESULT,.ARGS)
;
QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
;
; Get all patient data by index
;
; @param {string} INDEX
; @param {string} [TEMPLATE=""] - Template to use to format the returned data
; @param {string} [ORDER=""] - Order of the data items in the return array [asc|desc] [ci|cs]
; @param {string} [RANGE=""] - A range of keys to limit the items being retrieved by index
; @param {string} [BAIL=""] - Similar to limit, but faster, and is unable to calculate totalItems in RETCNTS
; @param {string} [FILTER=""] - A filter expression to apply to the retrieved items
; @param {string} [START=0] - The offset (by count of items) to begin at to add to the return array
; @param {string} [LIMIT=999999] - Limit of items (by count) to add to the return array
; @param {string} [STARTID=""] - The first item (by item number or uid) to add to the return array
; @param {string} [RETCNTS=0] - Return a header with the totalItems and currentItemCount
; @return {RETURNDATA^VPRJUTLN} RETURN - <0|1>:<UUID> Error code followed by UUID key
ALLINDEX(INDEX,TEMPLATE,ORDER,RANGE,BAIL,FILTER,START,LIMIT,STARTID,RETCNTS) ; Called as getAllIndexData in jds-client.js
N ARGS,HTTPERR,HTTPREQ,RESULT,UUID
;
; setup code
S ARGS("indexName")=$G(INDEX)
S ARGS("template")=$G(TEMPLATE)
S ARGS("order")=$G(ORDER)
S ARGS("range")=$G(RANGE)
S ARGS("bail")=$G(BAIL)
S ARGS("filter")=$G(FILTER)
S HTTPREQ("store")="xvpr"
D SETUP^VPRJUTLN
;
S UUID=$$GENUUID^VPRJUTLN
Q:UUID="1:UUID EXCEPTION" UUID
;
; call endpoint
D ALLINDEX^VPRJPR(.RESULT,.ARGS)
;
QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
;
; Get all patient data by collection by searching the xvpr data store
; FILTER is not optional
;
; @param {string} COLLECTION - Collection name
; @param {string} [TEMPLATE=""] - Template to use to format the returned data
; @param {string} [ORDER=""] - Order of the data items in the return array [asc|desc] [ci|cs]
; @param {string} [BAIL=""] - Similar to limit, but faster, and is unable to calculate totalItems in RETCNTS
; @param {string} FILTER - A filter expression to apply to the retrieved items
; @param {string} [START=0] - The offset (by count of items) to begin at to add to the return array
; @param {string} [LIMIT=999999] - Limit of items (by count) to add to the return array
; @param {string} [STARTID=""] - The first item (by item number or uid) to add to the return array
; @param {string} [RETCNTS=0] - Return a header with the totalItems and currentItemCount
; @return {RETURNDATA^VPRJUTLN} RETURN - <0|1>:<UUID> Error code followed by UUID key
ALLFIND(COLLECTION,TEMPLATE,ORDER,BAIL,FILTER,START,LIMIT,STARTID,RETCNTS) ; Called as getAllDomainData in jds-client.js
N ARGS,HTTPERR,HTTPREQ,RESULT,UUID
;
; setup code
S ARGS("collection")=$G(COLLECTION)
S ARGS("template")=$G(TEMPLATE)
S ARGS("order")=$G(ORDER)
S ARGS("bail")=$G(BAIL)
S ARGS("filter")=$G(FILTER)
S HTTPREQ("store")="xvpr"
D SETUP^VPRJUTLN
;
S UUID=$$GENUUID^VPRJUTLN
Q:UUID="1:UUID EXCEPTION" UUID
;
; bail if no collection was passed in
I $G(COLLECTION)="" D SETERROR^VPRJRER(215) QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
;
; call endpoint
D ALLFIND^VPRJPR(.RESULT,.ARGS)
;
QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
;
; Get patient data item by PID and UID
;
; @param {string} PID - Patient identifier
; @param {string} UID - Patient data key
; @param {string} [TEMPLATE=""] - Template to use to format the returned data
; @param {string} [START=0] - The offset (by count of items) to begin at to add to the return array
; @param {string} [LIMIT=999999] - Limit of items (by count) to add to the return array
; @param {string} [STARTID=""] - The first item (by item number or uid) to add to the return array
; @param {string} [RETCNTS=0] - Return a header with the totalItems and currentItemCount
; @return {RETURNDATA^VPRJUTLN} RETURN - <0|1>:<UUID> Error code followed by UUID key to retrieveQueryResult in client-utils.js
GETOBJ(PID,UID,TEMPLATE,START,LIMIT,STARTID,RETCNTS) ; Called as getPatientDataByPidAndUid in jds-client.js
N ARGS,HTTPERR,HTTPREQ,RESULT,UUID
;
; setup code
S ARGS("pid")=$G(PID)
S ARGS("uid")=$G(UID)
S ARGS("template")=$G(TEMPLATE)
S HTTPREQ("store")="vpr"
D SETUP^VPRJUTLN
;
S UUID=$$GENUUID^VPRJUTLN
Q:UUID="1:UUID EXCEPTION" UUID
;
; bail if no pid was passed in
I $G(PID)="" D SETERROR^VPRJRER(226) QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
;
; call endpoint
D GETOBJ^VPRJPR(.RESULT,.ARGS)
;
QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
;
; Get patient data item by UID
;
; @param {string} UID - Patient data key
; @param {string} [TEMPLATE=""] - Template to use to format the returned data
; @param {string} [START=0] - The offset (by count of items) to begin at to add to the return array
; @param {string} [LIMIT=999999] - Limit of items (by count) to add to the return array
; @param {string} [STARTID=""] - The first item (by item number or uid) to add to the return array
; @param {string} [RETCNTS=0] - Return a header with the totalItems and currentItemCount
; @return {RETURNDATA^VPRJUTLN} RETURN - <0|1>:<UUID> Error code followed by UUID key to retrieveQueryResult in client-utils.js
GETUID(UID,TEMPLATE,START,LIMIT,STARTID,RETCNTS) ; Called as getPatientDataByUid in jds-client.js
N ARGS,HTTPERR,HTTPREQ,RESULT,UUID
;
; setup code
S ARGS("uid")=$G(UID)
S ARGS("template")=$G(TEMPLATE)
S HTTPREQ("store")="xvpr"
D SETUP^VPRJUTLN
;
S UUID=$$GENUUID^VPRJUTLN
Q:UUID="1:UUID EXCEPTION" UUID
;
; call endpoint
D GETUID^VPRJPR(.RESULT,.ARGS)
;
QUIT $$RETURNDATA^VPRJUTLN(.RESULT,UUID,START,LIMIT,STARTID,RETCNTS)
;