-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
426 lines (251 loc) · 17.5 KB
/
README
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
SMART Python Client Library
===========================
To generate this README:
$ python generate_readme.py > README
---
class SMARTClient(oauth2.Client)
Establishes OAuth communication with an SMART Container, and provides access to the API.
Method resolution order:
SMARTClient
oauth2.Client
oauth2.httplib2.Http
__builtin__.object
Methods defined here:
__init__(self, app_id, api_base, consumer_params, **state_vars)
absolute_uri(self, uri)
delete(self, uri, headers={}, **uri_params)
Make an OAuth-signed DELETE request to SMART Server.
delete_scratchpad_data = c(self, *args, **kwargs)
DELETE /records/{record_id}/apps/{smart_app_id}/scratchpad
Purges the scratchpad data stored in the SMART container for the selected app. If everything goes well, this call will respond with HTTP 200 status code.
Returns RDF Graph containing: http://smartplatforms.org/terms#ScratchpadData
delete_user_preferences = c(self, *args, **kwargs)
DELETE /users/{user_id}/apps/{smart_app_id}/preferences
Purges the user preferences stored in the SMART container for the selected app. If everything goes well, this call will respond with HTTP 200 status code.
Returns RDF Graph containing: http://smartplatforms.org/terms#UserPreferences
exchange_token(self, verifier)
Exchange the client's current token (should be a request token) for an access token.
fetch_request_token(self, params={})
Get a request token from the server.
get(self, uri, body={}, headers={}, **uri_params)
Make an OAuth-signed GET request to SMART Server.
get_allergies = c(self, *args, **kwargs)
GET /records/{record_id}/allergies/
Get all Allergies and Allergy Exclusions for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Allergy
get_allergy = c(self, *args, **kwargs)
GET /records/{record_id}/allergies/{allergy_id}
Get one Allergy for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Allergy
get_app_manifest = c(self, *args, **kwargs)
GET /apps/{descriptor}/manifest
Returns a JSON SMART UI app manifest for the app matching {descriptor}, or 404. Note that {descriptor} can be an app ID like "got-statins
Returns RDF Graph containing: http://smartplatforms.org/terms#AppManifest
get_app_manifests = c(self, *args, **kwargs)
GET /apps/manifests/
Returns a JSON list of all SMART UI app manifests installed on the container.
Returns RDF Graph containing: http://smartplatforms.org/terms#AppManifest
get_clinical_note = c(self, *args, **kwargs)
GET /records/{record_id}/clinical_notes/{clinical_note_id}
Get one Clinical Note for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#ClinicalNote
get_clinical_notes = c(self, *args, **kwargs)
GET /records/{record_id}/clinical_notes/
Get all Clinical Notes for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#ClinicalNote
get_container_manifest = c(self, *args, **kwargs)
GET /manifest
Get manifest for a container
Returns RDF Graph containing: http://smartplatforms.org/terms#ContainerManifest
get_demographics = c(self, *args, **kwargs)
GET /records/{record_id}/demographics
Get Demographics for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Demographics
get_document = c(self, *args, **kwargs)
GET /records/{record_id}/documents/{document_id}
Allows a SMART app to request a single document. The optional `format` parameter sets the output format of the call. The possible values are `metadata`, `raw`, and `combined`. In `format=metadata` mode, the container returns metadata and desceriptors of the document in RDF-XML. In `format=combined` mode the call returns the serialized document content in addition to all the data from the `format=metadata` mode. In `format=raw` mode, SMART returns the raw document content with the proper MIME type. In the absence of a `format` parameter, the API defaults to `format=raw`.
Returns RDF Graph containing: http://smartplatforms.org/terms#Document
get_documents = c(self, *args, **kwargs)
GET /records/{record_id}/documents/
Returns data about all the available documents for the patient record subject to the standard filter restrictions. The optional `format` parameter sets the output format of the call. The possible values are `metadata` and `combined`. In `format=metadata` mode, the container returns metadata and desceriptors of the documents in RDF-XML. In `format=combined` mode the call returns the serialized documents' content in addition to all the data from the `format=metadata` mode. In the absence of a `format` parameter, the API defaults to `format=metadata`.
Returns RDF Graph containing: http://smartplatforms.org/terms#Document
get_encounter = c(self, *args, **kwargs)
GET /records/{record_id}/encounters/{encounter_id}
Get one Encounter for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Encounter
get_encounters = c(self, *args, **kwargs)
GET /records/{record_id}/encounters/
Get all Encounters for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Encounter
get_family_history_observation = c(self, *args, **kwargs)
GET /records/{record_id}/family_history/{family_history_id}
Get one Family History for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#FamilyHistory
get_family_history_observations = c(self, *args, **kwargs)
GET /records/{record_id}/family_history/
Get all Family Histories for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#FamilyHistory
get_fulfillment = c(self, *args, **kwargs)
GET /records/{record_id}/fulfillments/{fulfillment_id}
Get one Fulfillment for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Fulfillment
get_fulfillments = c(self, *args, **kwargs)
GET /records/{record_id}/fulfillments/
Get all Fulfillments for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Fulfillment
get_imaging_studies = c(self, *args, **kwargs)
GET /records/{record_id}/imaging_studies/
Returns data about all the available imaging studies of the patient record.
Returns RDF Graph containing: http://smartplatforms.org/terms#ImagingStudy
get_imaging_study = c(self, *args, **kwargs)
GET /records/{record_id}/imaging_studies/{imaging_study_id}
Allows a SMART app to request a single medical imaging study.
Returns RDF Graph containing: http://smartplatforms.org/terms#ImagingStudy
get_immunization = c(self, *args, **kwargs)
GET /records/{record_id}/immunizations/{immunization_id}
Get one Immunization for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Immunization
get_immunizations = c(self, *args, **kwargs)
GET /records/{record_id}/immunizations/
Get all Immunizations for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Immunization
get_lab_panel = c(self, *args, **kwargs)
GET /records/{record_id}/lab_panels/
Get one Lab Panel for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#LabPanel
get_lab_panels = c(self, *args, **kwargs)
GET /records/{record_id}/lab_panels/
Get all Lab Panels for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#LabPanel
get_lab_result = c(self, *args, **kwargs)
GET /records/{record_id}/lab_results/{lab_result_id}
Get one Lab Result for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#LabResult
get_lab_results = c(self, *args, **kwargs)
GET /records/{record_id}/lab_results/
Get all Lab Results for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#LabResult
get_medical_image = c(self, *args, **kwargs)
GET /records/{record_id}/medical_images/{medical_image_id}
Allows a SMART app to request a single medical image of the patient's body.
Returns RDF Graph containing: http://smartplatforms.org/terms#MedicalImage
get_medical_images = c(self, *args, **kwargs)
GET /records/{record_id}/medical_images/
Returns data about all the available medical images of the patient's body.
Returns RDF Graph containing: http://smartplatforms.org/terms#MedicalImage
get_medication = c(self, *args, **kwargs)
GET /records/{record_id}/medications/{medication_id}
Get one Medication for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Medication
get_medications = c(self, *args, **kwargs)
GET /records/{record_id}/medications/
Get all Medications for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Medication
get_ontology = c(self, *args, **kwargs)
GET /ontology
Get the ontology used by a SMART container
Returns RDF Graph containing: http://smartplatforms.org/terms#Ontology
get_photograph = c(self, *args, **kwargs)
GET /records/{record_id}/photograph
Get one Photograph for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Photograph
get_problem = c(self, *args, **kwargs)
GET /records/{record_id}/problems/{problem_id}
Get one Problem for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Problem
get_problems = c(self, *args, **kwargs)
GET /records/{record_id}/problems/
Get all Problems for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Problem
get_procedure = c(self, *args, **kwargs)
GET /records/{record_id}/procedures/{procedure_id}
Get one Procedure for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Procedure
get_procedures = c(self, *args, **kwargs)
GET /records/{record_id}/procedures/
Get all Procedures for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#Procedure
get_scratchpad_data = c(self, *args, **kwargs)
GET /records/{record_id}/apps/{smart_app_id}/scratchpad
Returns the scratchpad blob unicode data stored in the patient's account by a previous run of the owner app in the response body. An app can ready any other app's scratchpad. If not data is available the call will return an empty string.
Returns RDF Graph containing: http://smartplatforms.org/terms#ScratchpadData
get_social_history = c(self, *args, **kwargs)
GET /records/{record_id}/social_history
Get Social History for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#SocialHistory
get_surl_credentials(self)
Produces a token and secret for signing URLs.
get_user = c(self, *args, **kwargs)
GET /users/{user_id}
Get a single user by ID
Returns RDF Graph containing: http://smartplatforms.org/terms#User
get_user_preferences = c(self, *args, **kwargs)
GET /users/{user_id}/apps/{smart_app_id}/preferences
Returns the preferences blob unicode data stored in the user's account by a previous run of the app in the response body. If not data is available the call will return an empty string.
Returns RDF Graph containing: http://smartplatforms.org/terms#UserPreferences
get_vital_sign_set = c(self, *args, **kwargs)
GET /records/{record_id}/vital_sign_sets/{vital_sign_set_id}
Get one Vital Sign Set for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#VitalSignSet
get_vital_sign_sets = c(self, *args, **kwargs)
GET /records/{record_id}/vital_sign_sets/
Get all Vital Sign Sets for a patient
Returns RDF Graph containing: http://smartplatforms.org/terms#VitalSignSet
loop_over_records(self)
Iterator allowing background apps to loop through each patient
record in the SMArt container, e.g. to perform reporting or analytics.
For each patient record in the container, sets access tokens on the
SmartClient object and yields the new record_id.
post(self, uri, body='', headers={}, content_type=None, **uri_params)
Make an OAuth-signed POST request to SMART Server.
post_clinical_note = c(self, *args, **kwargs)
POST /records/{record_id}/clinical_notes/
Post a Clinical Note for a patient. The body of the post should contain SMART RDF/XML serialization of the clinical note without the belongsTo predicate. The clinical note will be added to the collection of notes and the call will return a a copy of the posted data to indicate as successful posting.
Returns RDF Graph containing: http://smartplatforms.org/terms#ClinicalNote
put(self, uri, body='', headers={}, content_type=None, **uri_params)
Make an OAuth-signed PUT request to SMART Server.
put_scratchpad_data = c(self, *args, **kwargs)
PUT /records/{record_id}/apps/{smart_app_id}/scratchpad
Stores scratchpad data in the patient's account in the SMART container scoped to the current app. The HTTP request body represents the unicode-encoded data blob. The app chooses the best format for the data that makes sense for its use case (it is unstructured from SMART's perspective). If the data save was successful, the SMART server will respond with an HTTP 200 code and include the stored data in the response body. It is the app's responsibility to compare the response with the intended data content. If there are any discrepancies, then a concurrency problem occured while writing the data and the app should request a fresh copy of the scratchpad data stored on the server, merge it with its local copy and attempt writing it again.
Returns RDF Graph containing: http://smartplatforms.org/terms#ScratchpadData
put_user_preferences = c(self, *args, **kwargs)
PUT /users/{user_id}/apps/{smart_app_id}/preferences
Stores preferences data in the user's account in the SMART container scoped to the current app. The HTTP request body represents the unicode-encoded data blob. The app chooses the best format for the data that makes sense for its use case (it is unstructured from SMART's perspective). If the data save was successful, the SMART server will respond with an HTTP 200 code and include the stored data in the response body. It is the app's responsibility to compare the response with the intended data content. If there are any discrepancies, then a concurrency problem occured while writing the data and the app should request a fresh copy of the preferences data stored on the server, merge it with its local copy and attempt writing it again.
Returns RDF Graph containing: http://smartplatforms.org/terms#UserPreferences
request(self, uri, uri_params, *args, **kwargs)
search_records = c(self, *args, **kwargs)
GET /records/search
Get an RDF graph of sp:Demographics elements for all patients that match the query. Matching treats family_name and given_name as the *beginning* of a name. For instance given_name='J' matches /^J/i and thus matchs 'Josh'. Date of birth is an ISO8601 string like "2008-03-21"; gender is "male" or "female". Gender, date_of_birth, zipcode, and medical_record_number must match exactly.
Returns RDF Graph containing: http://smartplatforms.org/terms#Demographics
search_users = c(self, *args, **kwargs)
GET /users/search
Get users by name (or all users if blank)
Returns RDF Graph containing: http://smartplatforms.org/terms#User
update_token(self, resource_token)
Update the resource token used by the client to sign requests.
----------------------------------------------------------------------
Data descriptors defined here:
auth_redirect_url
launch_url
Returns the start URL where the user can login and select a record
record_id
----------------------------------------------------------------------
Methods inherited from oauth2.Client:
set_signature_method(self, method)
----------------------------------------------------------------------
Methods inherited from oauth2.httplib2.Http:
add_certificate(self, key, cert, domain)
Add a key and cert that will be used
any time a request requires authentication.
add_credentials(self, name, password, domain='')
Add a name and password that will be used
any time a request requires authentication.
clear_credentials(self)
Remove all the names and passwords
that are used for authentication
----------------------------------------------------------------------
Data descriptors inherited from oauth2.httplib2.Http:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)