Skip to content

Commit 143846c

Browse files
committed
Content fix
1 parent 64cd365 commit 143846c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,11 @@ http://docs.smarthealthit.org/authorization/scopes-and-launch-context/
240240
# 11. Get Patient Data using FHIR
241241
We now have a valid access token, and can use it to send requests to the FHIR endpoint to retrieve our patient's data. See http://docs.smarthealthit.org/authorization/#4-app-accesses-clinical-data-via-fhir-api
242242

243-
We will depend on the `fhir-client.js` library to retrieve these resources using some available APIs:
243+
We will depend on the `fhir-client.js` library to retrieve these resources using a couple of the available APIs:
244244

245245
- `smart.patient.read()`: This returns the context for the patient the app was launched for.
246246
- `smart.patient.api.fetchAll()`: This will use the fhir.js API to retrieve a complete set of resources for the patient in context.
247-
- `smart.byCodes()`:
247+
- `smart.byCodes()`: A utility function that returns a function to search a given resource for specific codes returned from that response.
248248

249249
Here's the relevant code in `example-smart-app.js`:
250250

@@ -261,15 +261,18 @@ var obv = smart.patient.api.fetchAll({
261261
'http://loinc.org|2089-1', 'http://loinc.org|55284-4']
262262
}
263263
}
264-
});
264+
});
265265

266+
...
267+
268+
$.when(pt, obv).done(function(patient, obv) {
269+
var byCodes = smart.byCodes(obv, 'code');
270+
...
266271
```
267272
268273
We'll walk through the code first, and then modify it to retrieve the data you require for your specific patient.
269274
270-
Also, the `fhir-client.js` library defines several more API’s that will come in handy while developing smart app. Check them out here:
271-
272-
http://docs.smarthealthit.org/clients/javascript/
275+
As an aside, the `fhir-client.js` library defines several more API’s that will come in handy while developing smart app. Check them out here: http://docs.smarthealthit.org/clients/javascript/
273276
274277
275278
## 11.1 Modify `example-smart-app.js` to grab desired data

0 commit comments

Comments
 (0)