From bd8ca89a69177f369868b653d13f7e6b8700b0ba Mon Sep 17 00:00:00 2001 From: Riley Shea Date: Sun, 10 Nov 2019 23:10:48 -0500 Subject: [PATCH 1/2] Beaker Version Fixed Before this change the flask example would fail to run. The old beaker version listed in requirements was from before python 3.6, and was broken due to using `async` as a variable. After this change the Flask example is closer to being in a working state. --- requirements_flask_app.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_flask_app.txt b/requirements_flask_app.txt index 6daf56b1a..7fe08aafc 100644 --- a/requirements_flask_app.txt +++ b/requirements_flask_app.txt @@ -1,4 +1,4 @@ -Beaker==1.7.0 +Beaker==1.10.0 Flask==0.10.1 Jinja2==2.7.3 MarkupSafe==0.23 From e0e31c0fe1cabf0fe129284873c3b7988abb6bf3 Mon Sep 17 00:00:00 2001 From: Riley Shea Date: Sun, 10 Nov 2019 23:17:59 -0500 Subject: [PATCH 2/2] README endpoint fixed Before this change the example in the README.md referenced an old defunct endpoint and patient. This caused the example to fail. After this change, the example in the README works. --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ff67ea4ad..83d8d1247 100644 --- a/README.md +++ b/README.md @@ -44,20 +44,21 @@ To read a given patient from an open FHIR server, you can use: ```python from fhirclient import client + settings = { 'app_id': 'my_web_app', - 'api_base': 'https://fhir-open-api-dstu2.smarthealthit.org' + 'api_base': 'https://r3.smarthealthit.org' } smart = client.FHIRClient(settings=settings) import fhirclient.models.patient as p -patient = p.Patient.read('hca-pat-1', smart.server) -patient.birthDate.isostring -# '1963-06-12' -smart.human_name(patient.name[0]) -# 'Christy Ebert' -``` +patient = p.Patient.read('2e27c71e-30c8-4ceb-8c1c-5641e066c0a4', smart.server) +print(patient.birthDate.isostring) +# '1951-03-09' +print(smart.human_name(patient.name[0])) +# 'Ms. Buena Abbott' +``` If this is a protected server, you will first have to send your user to the authorize endpoint to log in. Just call `smart.authorize_url` to obtain the correct URL. You can use `smart.prepare()`, which will return `False` if the server is protected and you need to authorize.