Skip to content

Commit 16540a4

Browse files
raheelsayeedCulby
authored andcommitted
Update to FHIR 4.0.0 (#67)
Updates Data models to R4 and closes #59.
1 parent 68a63dd commit 16540a4

File tree

363 files changed

+32847
-15982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

363 files changed

+32847
-15982
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[bumpversion]
2-
current_version = 3.2.0
2+
current_version = 4.0.0
33
files = fhirclient/client.py
44

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ session_data
1212
# IDE files
1313
*.sublime-*
1414

15+
.DS_Store

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The following wonderful people contributed directly or indirectly to this projec
1313
- Josh Mandel <https://github.com/jmandel>
1414
- Nikolai Schwertner <https://github.com/nschwertner>
1515
- Pascal Pfiffner <https://github.com/p2>
16+
- Raheel Sayeed <https://github.com/raheelsayeed>
1617
- Trinadh Baranika <https://github.com/bktrinadh>
1718

1819
Please add yourself here alphabetically when you submit your first pull request.

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "SMART on FHIR Python Client"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 3.2.0
41+
PROJECT_NUMBER = 4.0.0
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The `develop` branch should be on recent freezes, and the `feature/latest-ci` br
1010

1111
Version | FHIR | &nbsp;
1212
-----------|---------------|---------
13+
**4.0.0** | `4.0.0` | (R4)
1314
**3.0.0** | `3.0.0` | (STU-3)
1415
**x.x** | `1.8.0` | (STU-3 Ballot, Jan 2017)
1516
**x.x** | `1.6.0` | (STU-3 Ballot, Sep 2016)

fhir-parser-resources/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from Default.settings import *
66

77
# Base URL for where to load specification data from
8-
specification_url = 'http://hl7.org/fhir/STU3'
8+
specification_url = 'http://hl7.org/fhir/R4'
99

1010
# In which directory to find the templates. See below for settings that start with `tpl_`: these are the template names.
1111
tpl_base = '../fhir-parser-resources'

fhir-parser-resources/template-unittest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test{{ class.name }}{{ loop.index }}(self):
3636
def impl{{ class.name }}{{ loop.index }}(self, inst):
3737
{%- for onetest in tcase.tests %}
3838
{%- if "str" == onetest.klass.name %}
39-
self.assertEqual(inst.{{ onetest.path }}, "{{ onetest.value|replace('"', '\\"') }}")
39+
self.assertEqual(inst.{{ onetest.path }}, "{{ onetest.value|replace('\\n', '\\\\n')|replace('"', '\\"') }}")
4040
{%- else %}{% if "int" == onetest.klass.name or "float" == onetest.klass.name or "NSDecimalNumber" == onetest.klass.name %}
4141
self.assertEqual(inst.{{ onetest.path }}, {{ onetest.value }})
4242
{%- else %}{% if "bool" == onetest.klass.name %}

fhirclient/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from server import FHIRServer, FHIRUnauthorizedException, FHIRNotFoundException
66

7-
__version__ = '3.2.0'
7+
__version__ = '4.0.0'
88
__author__ = 'SMART Platforms Team'
99
__license__ = 'APACHE2'
1010
__copyright__ = "Copyright 2017 Boston Children's Hospital"

fhirclient/fhirreference_tests.py

100644100755
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,24 @@ def testContainedResourceDetection(self):
3030
self.assertEqual('Observation.subject', group.linkId)
3131
question = group.item[0]
3232
self.assertEqual('Observation.subject._type', question.linkId)
33-
self.assertIsNotNone(question.options)
33+
self.assertIsNotNone(question.answerOption)
3434
with self.assertRaises(Exception):
35-
question.options.resolved()
36-
35+
question.answerOption[0].valueReference.resolved()
36+
reference = question.answerOption[0].valueReference
3737
# 1st resolve, extracting from contained resources
38-
contained = question.options.resolved(medication.Medication)
38+
contained = reference.resolved(medication.Medication)
3939
self.assertIsNone(contained, "Must not resolve on resource type mismatch")
40-
contained = question.options.resolved(valueset.ValueSet)
40+
contained = reference.resolved(valueset.ValueSet)
4141
self.assertIsNotNone(contained, "Must resolve contained ValueSet")
4242
self.assertEqual('ValueSet', contained.resource_type)
4343
self.assertEqual('Type options for Observation.subject', contained.name)
4444

4545
# 2nd resolve, should pull from cache
46-
contained = question.options.resolved(medication.Medication)
46+
contained = reference.resolved(medication.Medication)
4747
self.assertIsNone(contained, "Must not resolve on resource type mismatch")
48-
contained = question.options.resolved(resource.Resource)
48+
contained = reference.resolved(resource.Resource)
4949
self.assertIsNotNone(contained, "Must resolve contained ValueSet even if requesting `Resource`")
50-
contained = question.options.resolved(valueset.ValueSet)
50+
contained = reference.resolved(valueset.ValueSet)
5151
self.assertIsNotNone(contained, "Must resolve contained ValueSet")
5252
self.assertEqual('ValueSet', contained.resource_type)
5353

@@ -63,20 +63,21 @@ def testRelativeReference(self):
6363
self.assertEqual('Observation.subject', group.linkId)
6464
question = group.item[0]
6565
self.assertEqual('Observation.subject._type', question.linkId)
66-
self.assertIsNotNone(question.options)
66+
self.assertIsNotNone(question.answerOption)
6767
with self.assertRaises(Exception):
68-
question.options.resolved()
68+
question.answerOption[0].valueReference.resolved()
69+
reference = question.answerOption[0].valueReference
6970

7071
# resolve relative resource
71-
relative = question.options.resolved(valueset.ValueSet)
72+
relative = reference.resolved(valueset.ValueSet)
7273
self.assertIsNotNone(relative, "Must resolve relative ValueSet")
7374
self.assertEqual('ValueSet', relative.resource_type)
7475
self.assertEqual('Type options for Observation.subject', relative.name)
7576

7677
# 2nd resolve, should pull from cache
77-
relative = question.options.resolved(medication.Medication)
78+
relative = reference.resolved(medication.Medication)
7879
self.assertIsNone(relative, "Must not resolve on resource type mismatch")
79-
relative = question.options.resolved(resource.Resource)
80+
relative = reference.resolved(resource.Resource)
8081
self.assertIsNotNone(relative, "Must resolve relative ValueSet even if requesting `Resource`")
8182

8283
def testBundleReferences(self):

0 commit comments

Comments
 (0)