diff --git a/.bumpversion.cfg b/.bumpversion.cfg index b6b233b52..9a25df2c5 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,3 +1,3 @@ [bumpversion] -current_version = 4.1.0 +current_version = 4.2.0 files = fhirclient/client.py diff --git a/.gitignore b/.gitignore index 417ae8d26..ab60dc8d5 100644 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,5 @@ session_data # IDE files *.sublime-* - +/.idea/ .DS_Store diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9f014ccd1..43f705026 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,5 +33,5 @@ If you have any question or concerns, feel free to reach out to us at [pep257]: http://www.python.org/dev/peps/pep-0257/ [good commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html [squash]: http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html -[AUTHORS.md]: https://github.com/smart-on-fhir/client-py/blob/master/AUTHORS.md +[AUTHORS.md]: https://github.com/smart-on-fhir/client-py/blob/main/AUTHORS.md [procedures]: http://twistedmatrix.com/trac/wiki/CompatibilityPolicy diff --git a/README.md b/README.md index 625141cb6..6eb0bfd63 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,14 @@ SMART FHIR Client ================= This is _fhirclient_, a flexible Python client for [FHIR][] servers supporting the [SMART on FHIR][smart] protocol. -The client is compatible with Python 2.7.10 and Python 3. Client versioning is not identical to FHIR versioning. -The `master` branch is usually on the latest version of the client as shown below, possibly on bugfix releases thereof. +The `main` branch is usually on the latest version of the client as shown below, possibly on bugfix releases thereof. The `develop` branch should be on recent freezes, and the `feature/latest-ci` branch is periodically updated to the latest FHIR continuous integration builds. - Version | FHIR |   ------------|---------------|--------- + Version | FHIR |   +-----------|--------------|--------- + **4.2.0** | `4.0.1` | (R4) **4.0.0** | `4.0.0` | (R4) **3.0.0** | `3.0.0` | (STU-3) **x.x** | `1.8.0` | (STU-3 Ballot, Jan 2017) @@ -224,6 +224,6 @@ Using setuptools (*Note*: Alternatively, you can use twine https://pypi.python.o [smart]: http://docs.smarthealthit.org [fhir-parser]: https://github.com/smart-on-fhir/fhir-parser [docs]: https://smart-on-fhir.github.io/client-py -[flask_app]: https://github.com/smart-on-fhir/client-py/blob/master/flask_app.py +[flask_app]: https://github.com/smart-on-fhir/client-py/blob/main/flask_app.py [doxygen]: http://www.stack.nl/~dimitri/doxygen [doxypypy]: https://github.com/Feneric/doxypypy diff --git a/fhir-parser b/fhir-parser index 505e283af..174bfd12f 160000 --- a/fhir-parser +++ b/fhir-parser @@ -1 +1 @@ -Subproject commit 505e283afaa047dcb2e8fe0860f0427d54033d70 +Subproject commit 174bfd12f9405c7a9536f4b10fe70c4b63da1546 diff --git a/fhir-parser-resources/fhirsearch_tests.py b/fhir-parser-resources/fhirsearch_tests.py index 57b0f1509..95ea00996 100644 --- a/fhir-parser-resources/fhirsearch_tests.py +++ b/fhir-parser-resources/fhirsearch_tests.py @@ -1,10 +1,10 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from models.fhirsearch import FHIRSearch +from fhirclient.models.fhirsearch import FHIRSearch if '__main__' == __name__: - from models.patient import Patient + from fhirclient.models.patient import Patient print('1 '+FHIRSearch(Patient, {'name': 'Willis'}).construct()) print('1 '+Patient.where({'name': 'Willis'}).construct()) # print('1 '+Patient.where().name('Willis').construct()) diff --git a/fhir-parser-resources/settings.py b/fhir-parser-resources/settings.py index af9f69bc5..0ef3928bb 100644 --- a/fhir-parser-resources/settings.py +++ b/fhir-parser-resources/settings.py @@ -22,6 +22,7 @@ # unit tests write_unittests = True tpl_unittest_target = '../fhirclient/models' # target directory to write the generated unit test files to +tpl_unittest_target_ptrn = '{}_tests.py' # TODO: remove in future when we re-organize tests # all these files should be copied to dirname(`tpl_resource_target_ptrn`): tuples of (path/to/file, module, array-of-class-names) diff --git a/fhir-parser-resources/template-elementfactory.py b/fhir-parser-resources/template-elementfactory.py index d04a4d2e3..401b3b176 100644 --- a/fhir-parser-resources/template-elementfactory.py +++ b/fhir-parser-resources/template-elementfactory.py @@ -17,10 +17,21 @@ def instantiate(cls, resource_type, jsondict): :param dict jsondict: The JSON dictionary to use for data :returns: A resource of the respective type or `Element` """ - {%- for klass in classes %}{% if klass.resource_type %} + {%- for klass in classes %} + {%- if klass.resource_type %} if "{{ klass.resource_type }}" == resource_type: from . import {{ klass.module }} return {{ klass.module }}.{{ klass.name }}(jsondict) + {%- elif klass.name %} + {#- backwards compatibility: + # fhir-parser stopped providing resource_type for non-resources. + # But we already shipped code that allowed creating non-resources. + # So to avoid an API break, we keep generating this for all classes. + # Can reconsider whether we want this once we jump to R5. (R4-QUIRK) + #} + if "{{ klass.name }}" == resource_type: + from . import {{ klass.module }} + return {{ klass.module }}.{{ klass.name }}(jsondict) {%- endif %}{% endfor %} from . import element return element.Element(jsondict) diff --git a/fhir-parser-resources/template-resource.py b/fhir-parser-resources/template-resource.py index cfc16478c..1858b4cd0 100644 --- a/fhir-parser-resources/template-resource.py +++ b/fhir-parser-resources/template-resource.py @@ -24,6 +24,15 @@ class {{ klass.name }}({% if klass.superclass in imports %}{{ klass.superclass.m {%- if klass.resource_type %} resource_type = "{{ klass.resource_type }}" +{%- elif klass.name %} +{#- backwards compatibility: +# fhir-parser stopped providing resource_type for non-resources. +# But we already shipped code that had this property for all classes. +# So to avoid an API break, we keep generating this for all classes. +# Can remove once we jump to R5. (R4-QUIRK) +#} + + resource_type = "{{ klass.name }}" {%- endif %} def __init__(self, jsondict=None, strict=True): @@ -33,7 +42,8 @@ def __init__(self, jsondict=None, strict=True): :param dict jsondict: A JSON dictionary to use for initialization :param bool strict: If True (the default), invalid variables will raise a TypeError """ - {%- for prop in klass.properties %} + {#- sorted just to avoid churn during another update - can remove as its own PR at some point #} + {%- for prop in klass.properties|sort(attribute="name", case_sensitive=True) %} self.{{ prop.name }} = None """ {{ prop.short|wordwrap(67, wrapstring="\n ") }}. @@ -55,7 +65,8 @@ def elementProperties(self): {%- endif %}{% endfor %} {%- endif %} js.extend([ - {%- for prop in klass.properties %} + {#- sorted just to avoid churn during another update - can remove as its own PR at some point #} + {%- for prop in klass.properties|sort(attribute="name", case_sensitive=True) %} ("{{ prop.name }}", "{{ prop.orig_name }}", {%- if prop.module_name %} {{ prop.module_name }}.{% else %} {% endif %}{{ prop.class_name }}, {# #} {{- prop.is_array }}, diff --git a/fhirclient/client.py b/fhirclient/client.py index 45f5fec26..7999820ad 100644 --- a/fhirclient/client.py +++ b/fhirclient/client.py @@ -4,7 +4,7 @@ from server import FHIRServer, FHIRUnauthorizedException, FHIRNotFoundException -__version__ = '4.1.0' +__version__ = '4.2.0' __author__ = 'SMART Platforms Team' __license__ = 'APACHE2' __copyright__ = "Copyright 2017 Boston Children's Hospital" diff --git a/fhirclient/fhirreference_tests.py b/fhirclient/fhirreference_tests.py index 5e9870ed2..86e4dfe30 100755 --- a/fhirclient/fhirreference_tests.py +++ b/fhirclient/fhirreference_tests.py @@ -20,7 +20,7 @@ class TestResourceReference(unittest.TestCase): def testContainedResourceDetection(self): - with io.open('test_contained_resource.json', 'r', encoding='utf-8') as h: + with io.open('fhirclient/test_contained_resource.json', 'r', encoding='utf-8') as h: data = json.load(h) q = questionnaire.Questionnaire(data) self.assertIsNotNone(q, "Must instantiate Questionnaire") @@ -52,7 +52,7 @@ def testContainedResourceDetection(self): self.assertEqual('ValueSet', contained.resource_type) def testRelativeReference(self): - with io.open('test_relative_reference.json', 'r', encoding='utf-8') as h: + with io.open('fhirclient/test_relative_reference.json', 'r', encoding='utf-8') as h: data = json.load(h) q = questionnaire.Questionnaire(data) self.assertIsNotNone(q, "Must instantiate Questionnaire") @@ -81,7 +81,7 @@ def testRelativeReference(self): self.assertIsNotNone(relative, "Must resolve relative ValueSet even if requesting `Resource`") def testBundleReferences(self): - with io.open('test_bundle.json', 'r', encoding='utf-8') as h: + with io.open('fhirclient/test_bundle.json', 'r', encoding='utf-8') as h: data = json.load(h) b = bundle.Bundle(data) self.assertIsNotNone(b, "Must instantiate Bundle") @@ -128,7 +128,7 @@ def __init__(self): def request_json(self, path, nosign=False): assert path parts = os.path.split(path) - filename = '_'.join(parts) + '.json' + filename = 'fhirclient/' + '_'.join(parts) + '.json' with io.open(filename, 'r', encoding='utf-8') as handle: return json.load(handle) return None diff --git a/fhirclient/models/account.py b/fhirclient/models/account.py index 2447ca29f..fa66ff9cc 100644 --- a/fhirclient/models/account.py +++ b/fhirclient/models/account.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Account) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Account) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/account_tests.py b/fhirclient/models/account_tests.py index b8148e855..cc2459524 100644 --- a/fhirclient/models/account_tests.py +++ b/fhirclient/models/account_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return account.Account(js) def testAccount1(self): - inst = self.instantiate_from("account-example.json") + inst = self.instantiate_from("account-example-with-guarantor.json") self.assertIsNotNone(inst, "Must have instantiated a Account instance") self.implAccount1(inst) @@ -33,20 +33,24 @@ def testAccount1(self): def implAccount1(self, inst): self.assertEqual(inst.coverage[0].priority, 1) + self.assertEqual(inst.coverage[1].priority, 2) self.assertEqual(inst.description, "Hospital charges") - self.assertEqual(inst.id, "example") + self.assertFalse(inst.guarantor[0].onHold) + self.assertEqual(inst.guarantor[0].period.start.date, FHIRDate("2016-01-01").date) + self.assertEqual(inst.guarantor[0].period.start.as_json(), "2016-01-01") + self.assertEqual(inst.id, "ewg") self.assertEqual(inst.identifier[0].system, "urn:oid:0.1.2.3.4.5.6.7") self.assertEqual(inst.identifier[0].value, "654321") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "HACC Funded Billing for Peter James Chalmers") + self.assertEqual(inst.name, "Inpatient: Peter James Chalmers") self.assertEqual(inst.servicePeriod.end.date, FHIRDate("2016-06-30").date) self.assertEqual(inst.servicePeriod.end.as_json(), "2016-06-30") self.assertEqual(inst.servicePeriod.start.date, FHIRDate("2016-01-01").date) self.assertEqual(inst.servicePeriod.start.as_json(), "2016-01-01") self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.div, "
HACC Funded Billing for Peter James Chalmers
") + self.assertEqual(inst.text.div, "
Inpatient Admission for Peter James Chalmers Account
") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type.coding[0].code, "PBILLACCT") self.assertEqual(inst.type.coding[0].display, "patient billing account") @@ -54,7 +58,7 @@ def implAccount1(self, inst): self.assertEqual(inst.type.text, "patient") def testAccount2(self): - inst = self.instantiate_from("account-example-with-guarantor.json") + inst = self.instantiate_from("account-example.json") self.assertIsNotNone(inst, "Must have instantiated a Account instance") self.implAccount2(inst) @@ -65,24 +69,20 @@ def testAccount2(self): def implAccount2(self, inst): self.assertEqual(inst.coverage[0].priority, 1) - self.assertEqual(inst.coverage[1].priority, 2) self.assertEqual(inst.description, "Hospital charges") - self.assertFalse(inst.guarantor[0].onHold) - self.assertEqual(inst.guarantor[0].period.start.date, FHIRDate("2016-01-01").date) - self.assertEqual(inst.guarantor[0].period.start.as_json(), "2016-01-01") - self.assertEqual(inst.id, "ewg") + self.assertEqual(inst.id, "example") self.assertEqual(inst.identifier[0].system, "urn:oid:0.1.2.3.4.5.6.7") self.assertEqual(inst.identifier[0].value, "654321") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "Inpatient: Peter James Chalmers") + self.assertEqual(inst.name, "HACC Funded Billing for Peter James Chalmers") self.assertEqual(inst.servicePeriod.end.date, FHIRDate("2016-06-30").date) self.assertEqual(inst.servicePeriod.end.as_json(), "2016-06-30") self.assertEqual(inst.servicePeriod.start.date, FHIRDate("2016-01-01").date) self.assertEqual(inst.servicePeriod.start.as_json(), "2016-01-01") self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.div, "
Inpatient Admission for Peter James Chalmers Account
") + self.assertEqual(inst.text.div, "
HACC Funded Billing for Peter James Chalmers
") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type.coding[0].code, "PBILLACCT") self.assertEqual(inst.type.coding[0].display, "patient billing account") diff --git a/fhirclient/models/activitydefinition.py b/fhirclient/models/activitydefinition.py index 132df79ff..32b396a05 100644 --- a/fhirclient/models/activitydefinition.py +++ b/fhirclient/models/activitydefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ActivityDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ActivityDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -91,7 +91,8 @@ def __init__(self, jsondict=None, strict=True): List of `Identifier` items (represented as `dict` in JSON). """ self.intent = None - """ proposal | plan | order. + """ proposal | plan | directive | order | original-order | reflex-order + | filler-order | instance-order | option. Type `str`. """ self.jurisdiction = None diff --git a/fhirclient/models/activitydefinition_tests.py b/fhirclient/models/activitydefinition_tests.py index beab57bbb..21170ff85 100644 --- a/fhirclient/models/activitydefinition_tests.py +++ b/fhirclient/models/activitydefinition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return activitydefinition.ActivityDefinition(js) def testActivityDefinition1(self): - inst = self.instantiate_from("activitydefinition-predecessor-example.json") + inst = self.instantiate_from("activitydefinition-supplyrequest-example.json") self.assertIsNotNone(inst, "Must have instantiated a ActivityDefinition instance") self.implActivityDefinition1(inst) @@ -32,6 +32,31 @@ def testActivityDefinition1(self): self.implActivityDefinition1(inst2) def implActivityDefinition1(self, inst): + self.assertEqual(inst.code.coding[0].code, "BlueTubes") + self.assertEqual(inst.code.coding[0].display, "Blood collect tubes blue cap") + self.assertEqual(inst.description, "10 Blood collect tubes blue cap") + self.assertEqual(inst.id, "blood-tubes-supply") + self.assertEqual(inst.kind, "SupplyRequest") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.purpose, "Describes a request for 10 Blood collection tubes with blue caps.") + self.assertEqual(inst.quantity.value, 10) + self.assertEqual(inst.status, "draft") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.transform, "StructureMap/supplyrequest-transform") + + def testActivityDefinition2(self): + inst = self.instantiate_from("activitydefinition-predecessor-example.json") + self.assertIsNotNone(inst, "Must have instantiated a ActivityDefinition instance") + self.implActivityDefinition2(inst) + + js = inst.as_json() + self.assertEqual("ActivityDefinition", js["resourceType"]) + inst2 = activitydefinition.ActivityDefinition(js) + self.implActivityDefinition2(inst2) + + def implActivityDefinition2(self, inst): self.assertEqual(inst.approvalDate.date, FHIRDate("2016-03-12").date) self.assertEqual(inst.approvalDate.as_json(), "2016-03-12") self.assertEqual(inst.author[0].name, "Motive Medical Intelligence") @@ -118,17 +143,17 @@ def implActivityDefinition1(self, inst): self.assertEqual(inst.useContext[6].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.version, "1.0.0") - def testActivityDefinition2(self): + def testActivityDefinition3(self): inst = self.instantiate_from("activitydefinition-medicationorder-example.json") self.assertIsNotNone(inst, "Must have instantiated a ActivityDefinition instance") - self.implActivityDefinition2(inst) + self.implActivityDefinition3(inst) js = inst.as_json() self.assertEqual("ActivityDefinition", js["resourceType"]) inst2 = activitydefinition.ActivityDefinition(js) - self.implActivityDefinition2(inst2) + self.implActivityDefinition3(inst2) - def implActivityDefinition2(self, inst): + def implActivityDefinition3(self, inst): self.assertEqual(inst.approvalDate.date, FHIRDate("2016-03-12").date) self.assertEqual(inst.approvalDate.as_json(), "2016-03-12") self.assertEqual(inst.author[0].name, "Motive Medical Intelligence") @@ -235,17 +260,62 @@ def implActivityDefinition2(self, inst): self.assertEqual(inst.useContext[6].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.version, "1.0.0") - def testActivityDefinition3(self): + def testActivityDefinition4(self): + inst = self.instantiate_from("activitydefinition-servicerequest-example.json") + self.assertIsNotNone(inst, "Must have instantiated a ActivityDefinition instance") + self.implActivityDefinition4(inst) + + js = inst.as_json() + self.assertEqual("ActivityDefinition", js["resourceType"]) + inst2 = activitydefinition.ActivityDefinition(js) + self.implActivityDefinition4(inst2) + + def implActivityDefinition4(self, inst): + self.assertEqual(inst.bodySite[0].coding[0].code, "17401000") + self.assertEqual(inst.bodySite[0].coding[0].display, "Heart valve structure") + self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.code.coding[0].code, "34068001") + self.assertEqual(inst.code.coding[0].display, "Heart valve replacement") + self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.description, "Heart valve replacement") + self.assertEqual(inst.id, "heart-valve-replacement") + self.assertEqual(inst.kind, "ServiceRequest") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.participant[0].role.coding[0].code, "207RI0011X") + self.assertEqual(inst.participant[0].role.coding[0].display, "Interventional Cardiology") + self.assertEqual(inst.participant[0].role.coding[0].system, "http://nucc.org/provider-taxonomy") + self.assertEqual(inst.participant[0].role.text, "Interventional Cardiology") + self.assertEqual(inst.participant[0].type, "practitioner") + self.assertEqual(inst.purpose, "Describes the proposal to perform a Heart Valve replacement.") + self.assertEqual(inst.status, "draft") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.topic[0].coding[0].code, "34068001") + self.assertEqual(inst.topic[0].coding[0].display, "Heart valve replacement") + self.assertEqual(inst.topic[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.useContext[0].code.code, "age") + self.assertEqual(inst.useContext[0].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") + self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].code, "D000328") + self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].display, "Adult") + self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].system, "https://meshb.nlm.nih.gov") + self.assertEqual(inst.useContext[1].code.code, "user") + self.assertEqual(inst.useContext[1].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") + self.assertEqual(inst.useContext[1].valueCodeableConcept.coding[0].code, "309343006") + self.assertEqual(inst.useContext[1].valueCodeableConcept.coding[0].display, "Physician") + self.assertEqual(inst.useContext[1].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") + + def testActivityDefinition5(self): inst = self.instantiate_from("activitydefinition-example.json") self.assertIsNotNone(inst, "Must have instantiated a ActivityDefinition instance") - self.implActivityDefinition3(inst) + self.implActivityDefinition5(inst) js = inst.as_json() self.assertEqual("ActivityDefinition", js["resourceType"]) inst2 = activitydefinition.ActivityDefinition(js) - self.implActivityDefinition3(inst2) + self.implActivityDefinition5(inst2) - def implActivityDefinition3(self, inst): + def implActivityDefinition5(self, inst): self.assertEqual(inst.approvalDate.date, FHIRDate("2017-03-01").date) self.assertEqual(inst.approvalDate.as_json(), "2017-03-01") self.assertEqual(inst.author[0].name, "Motive Medical Intelligence") @@ -331,74 +401,4 @@ def implActivityDefinition3(self, inst): self.assertEqual(inst.useContext[6].valueCodeableConcept.coding[0].display, "Outpatient environment") self.assertEqual(inst.useContext[6].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.version, "1.1.0") - - def testActivityDefinition4(self): - inst = self.instantiate_from("activitydefinition-servicerequest-example.json") - self.assertIsNotNone(inst, "Must have instantiated a ActivityDefinition instance") - self.implActivityDefinition4(inst) - - js = inst.as_json() - self.assertEqual("ActivityDefinition", js["resourceType"]) - inst2 = activitydefinition.ActivityDefinition(js) - self.implActivityDefinition4(inst2) - - def implActivityDefinition4(self, inst): - self.assertEqual(inst.bodySite[0].coding[0].code, "17401000") - self.assertEqual(inst.bodySite[0].coding[0].display, "Heart valve structure") - self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.code.coding[0].code, "34068001") - self.assertEqual(inst.code.coding[0].display, "Heart valve replacement") - self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.description, "Heart valve replacement") - self.assertEqual(inst.id, "heart-valve-replacement") - self.assertEqual(inst.kind, "ServiceRequest") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.participant[0].role.coding[0].code, "207RI0011X") - self.assertEqual(inst.participant[0].role.coding[0].display, "Interventional Cardiology") - self.assertEqual(inst.participant[0].role.coding[0].system, "http://nucc.org/provider-taxonomy") - self.assertEqual(inst.participant[0].role.text, "Interventional Cardiology") - self.assertEqual(inst.participant[0].type, "practitioner") - self.assertEqual(inst.purpose, "Describes the proposal to perform a Heart Valve replacement.") - self.assertEqual(inst.status, "draft") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.topic[0].coding[0].code, "34068001") - self.assertEqual(inst.topic[0].coding[0].display, "Heart valve replacement") - self.assertEqual(inst.topic[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.useContext[0].code.code, "age") - self.assertEqual(inst.useContext[0].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") - self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].code, "D000328") - self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].display, "Adult") - self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].system, "https://meshb.nlm.nih.gov") - self.assertEqual(inst.useContext[1].code.code, "user") - self.assertEqual(inst.useContext[1].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") - self.assertEqual(inst.useContext[1].valueCodeableConcept.coding[0].code, "309343006") - self.assertEqual(inst.useContext[1].valueCodeableConcept.coding[0].display, "Physician") - self.assertEqual(inst.useContext[1].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") - - def testActivityDefinition5(self): - inst = self.instantiate_from("activitydefinition-supplyrequest-example.json") - self.assertIsNotNone(inst, "Must have instantiated a ActivityDefinition instance") - self.implActivityDefinition5(inst) - - js = inst.as_json() - self.assertEqual("ActivityDefinition", js["resourceType"]) - inst2 = activitydefinition.ActivityDefinition(js) - self.implActivityDefinition5(inst2) - - def implActivityDefinition5(self, inst): - self.assertEqual(inst.code.coding[0].code, "BlueTubes") - self.assertEqual(inst.code.coding[0].display, "Blood collect tubes blue cap") - self.assertEqual(inst.description, "10 Blood collect tubes blue cap") - self.assertEqual(inst.id, "blood-tubes-supply") - self.assertEqual(inst.kind, "SupplyRequest") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.purpose, "Describes a request for 10 Blood collection tubes with blue caps.") - self.assertEqual(inst.quantity.value, 10) - self.assertEqual(inst.status, "draft") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.transform, "StructureMap/supplyrequest-transform") diff --git a/fhirclient/models/address.py b/fhirclient/models/address.py index ea7c384ac..566b5f689 100644 --- a/fhirclient/models/address.py +++ b/fhirclient/models/address.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Address) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Address) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/adverseevent.py b/fhirclient/models/adverseevent.py index d34b8e2ce..9808dbe77 100644 --- a/fhirclient/models/adverseevent.py +++ b/fhirclient/models/adverseevent.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/AdverseEvent) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/AdverseEvent) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/adverseevent_tests.py b/fhirclient/models/adverseevent_tests.py index 7ac2b20dd..fa4f0c7d8 100644 --- a/fhirclient/models/adverseevent_tests.py +++ b/fhirclient/models/adverseevent_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/age.py b/fhirclient/models/age.py index 20f8e7cce..bc692ae10 100644 --- a/fhirclient/models/age.py +++ b/fhirclient/models/age.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Age) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Age) on 2024-07-15. +# 2024, SMART Health IT. from . import quantity diff --git a/fhirclient/models/allergyintolerance.py b/fhirclient/models/allergyintolerance.py index 45a7bcaf9..bfd5fa3b1 100644 --- a/fhirclient/models/allergyintolerance.py +++ b/fhirclient/models/allergyintolerance.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/AllergyIntolerance) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/AllergyIntolerance) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/allergyintolerance_tests.py b/fhirclient/models/allergyintolerance_tests.py index 49fd70409..9b9acff80 100644 --- a/fhirclient/models/allergyintolerance_tests.py +++ b/fhirclient/models/allergyintolerance_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/annotation.py b/fhirclient/models/annotation.py index 5cf300532..a4f834256 100644 --- a/fhirclient/models/annotation.py +++ b/fhirclient/models/annotation.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Annotation) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Annotation) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/appointment.py b/fhirclient/models/appointment.py index 19ccd53c2..ec5d6aabc 100644 --- a/fhirclient/models/appointment.py +++ b/fhirclient/models/appointment.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Appointment) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Appointment) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/appointment_tests.py b/fhirclient/models/appointment_tests.py index cdce75f33..b27a29ed2 100644 --- a/fhirclient/models/appointment_tests.py +++ b/fhirclient/models/appointment_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return appointment.Appointment(js) def testAppointment1(self): - inst = self.instantiate_from("appointment-example.json") + inst = self.instantiate_from("appointment-example2doctors.json") self.assertIsNotNone(inst, "Must have instantiated a Appointment instance") self.implAppointment1(inst) @@ -32,27 +32,25 @@ def testAppointment1(self): self.implAppointment1(inst2) def implAppointment1(self, inst): - self.assertEqual(inst.appointmentType.coding[0].code, "FOLLOWUP") - self.assertEqual(inst.appointmentType.coding[0].display, "A follow up visit from a previous appointment") + self.assertEqual(inst.appointmentType.coding[0].code, "WALKIN") + self.assertEqual(inst.appointmentType.coding[0].display, "A previously unscheduled walk-in visit") self.assertEqual(inst.appointmentType.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0276") - self.assertEqual(inst.comment, "Further expand on the results of the MRI and determine the next actions that may be appropriate.") - self.assertEqual(inst.created.date, FHIRDate("2013-10-10").date) - self.assertEqual(inst.created.as_json(), "2013-10-10") - self.assertEqual(inst.description, "Discussion on the results of your recent MRI") - self.assertEqual(inst.end.date, FHIRDate("2013-12-10T11:00:00Z").date) - self.assertEqual(inst.end.as_json(), "2013-12-10T11:00:00Z") - self.assertEqual(inst.id, "example") + self.assertEqual(inst.comment, "Clarify the results of the MRI to ensure context of test was correct") + self.assertEqual(inst.description, "Discussion about Peter Chalmers MRI results") + self.assertEqual(inst.end.date, FHIRDate("2013-12-09T11:00:00Z").date) + self.assertEqual(inst.end.as_json(), "2013-12-09T11:00:00Z") + self.assertEqual(inst.id, "2docs") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.participant[0].required, "required") + self.assertEqual(inst.participant[0].required, "information-only") self.assertEqual(inst.participant[0].status, "accepted") self.assertEqual(inst.participant[1].required, "required") self.assertEqual(inst.participant[1].status, "accepted") - self.assertEqual(inst.participant[1].type[0].coding[0].code, "ATND") - self.assertEqual(inst.participant[1].type[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") self.assertEqual(inst.participant[2].required, "required") self.assertEqual(inst.participant[2].status, "accepted") + self.assertEqual(inst.participant[3].required, "information-only") + self.assertEqual(inst.participant[3].status, "accepted") self.assertEqual(inst.priority, 5) self.assertEqual(inst.serviceCategory[0].coding[0].code, "gp") self.assertEqual(inst.serviceCategory[0].coding[0].display, "General Practice") @@ -62,14 +60,14 @@ def implAppointment1(self, inst): self.assertEqual(inst.specialty[0].coding[0].code, "394814009") self.assertEqual(inst.specialty[0].coding[0].display, "General practice") self.assertEqual(inst.specialty[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.start.date, FHIRDate("2013-12-10T09:00:00Z").date) - self.assertEqual(inst.start.as_json(), "2013-12-10T09:00:00Z") + self.assertEqual(inst.start.date, FHIRDate("2013-12-09T09:00:00Z").date) + self.assertEqual(inst.start.as_json(), "2013-12-09T09:00:00Z") self.assertEqual(inst.status, "booked") self.assertEqual(inst.text.div, "
Brian MRI results discussion
") self.assertEqual(inst.text.status, "generated") def testAppointment2(self): - inst = self.instantiate_from("appointment-example-request.json") + inst = self.instantiate_from("appointment-example.json") self.assertIsNotNone(inst, "Must have instantiated a Appointment instance") self.implAppointment2(inst) @@ -79,48 +77,44 @@ def testAppointment2(self): self.implAppointment2(inst2) def implAppointment2(self, inst): - self.assertEqual(inst.appointmentType.coding[0].code, "WALKIN") - self.assertEqual(inst.appointmentType.coding[0].display, "A previously unscheduled walk-in visit") + self.assertEqual(inst.appointmentType.coding[0].code, "FOLLOWUP") + self.assertEqual(inst.appointmentType.coding[0].display, "A follow up visit from a previous appointment") self.assertEqual(inst.appointmentType.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0276") self.assertEqual(inst.comment, "Further expand on the results of the MRI and determine the next actions that may be appropriate.") - self.assertEqual(inst.created.date, FHIRDate("2015-12-02").date) - self.assertEqual(inst.created.as_json(), "2015-12-02") + self.assertEqual(inst.created.date, FHIRDate("2013-10-10").date) + self.assertEqual(inst.created.as_json(), "2013-10-10") self.assertEqual(inst.description, "Discussion on the results of your recent MRI") - self.assertEqual(inst.id, "examplereq") - self.assertEqual(inst.identifier[0].system, "http://example.org/sampleappointment-identifier") - self.assertEqual(inst.identifier[0].value, "123") + self.assertEqual(inst.end.date, FHIRDate("2013-12-10T11:00:00Z").date) + self.assertEqual(inst.end.as_json(), "2013-12-10T11:00:00Z") + self.assertEqual(inst.id, "example") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.minutesDuration, 15) self.assertEqual(inst.participant[0].required, "required") - self.assertEqual(inst.participant[0].status, "needs-action") + self.assertEqual(inst.participant[0].status, "accepted") self.assertEqual(inst.participant[1].required, "required") - self.assertEqual(inst.participant[1].status, "needs-action") + self.assertEqual(inst.participant[1].status, "accepted") self.assertEqual(inst.participant[1].type[0].coding[0].code, "ATND") self.assertEqual(inst.participant[1].type[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") self.assertEqual(inst.participant[2].required, "required") self.assertEqual(inst.participant[2].status, "accepted") self.assertEqual(inst.priority, 5) - self.assertEqual(inst.reasonCode[0].coding[0].code, "413095006") - self.assertEqual(inst.reasonCode[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.reasonCode[0].text, "Clinical Review") - self.assertEqual(inst.requestedPeriod[0].end.date, FHIRDate("2016-06-09").date) - self.assertEqual(inst.requestedPeriod[0].end.as_json(), "2016-06-09") - self.assertEqual(inst.requestedPeriod[0].start.date, FHIRDate("2016-06-02").date) - self.assertEqual(inst.requestedPeriod[0].start.as_json(), "2016-06-02") self.assertEqual(inst.serviceCategory[0].coding[0].code, "gp") self.assertEqual(inst.serviceCategory[0].coding[0].display, "General Practice") self.assertEqual(inst.serviceCategory[0].coding[0].system, "http://example.org/service-category") + self.assertEqual(inst.serviceType[0].coding[0].code, "52") + self.assertEqual(inst.serviceType[0].coding[0].display, "General Discussion") self.assertEqual(inst.specialty[0].coding[0].code, "394814009") self.assertEqual(inst.specialty[0].coding[0].display, "General practice") self.assertEqual(inst.specialty[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.status, "proposed") + self.assertEqual(inst.start.date, FHIRDate("2013-12-10T09:00:00Z").date) + self.assertEqual(inst.start.as_json(), "2013-12-10T09:00:00Z") + self.assertEqual(inst.status, "booked") self.assertEqual(inst.text.div, "
Brian MRI results discussion
") self.assertEqual(inst.text.status, "generated") def testAppointment3(self): - inst = self.instantiate_from("appointment-example2doctors.json") + inst = self.instantiate_from("appointment-example-request.json") self.assertIsNotNone(inst, "Must have instantiated a Appointment instance") self.implAppointment3(inst) @@ -133,34 +127,40 @@ def implAppointment3(self, inst): self.assertEqual(inst.appointmentType.coding[0].code, "WALKIN") self.assertEqual(inst.appointmentType.coding[0].display, "A previously unscheduled walk-in visit") self.assertEqual(inst.appointmentType.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0276") - self.assertEqual(inst.comment, "Clarify the results of the MRI to ensure context of test was correct") - self.assertEqual(inst.description, "Discussion about Peter Chalmers MRI results") - self.assertEqual(inst.end.date, FHIRDate("2013-12-09T11:00:00Z").date) - self.assertEqual(inst.end.as_json(), "2013-12-09T11:00:00Z") - self.assertEqual(inst.id, "2docs") + self.assertEqual(inst.comment, "Further expand on the results of the MRI and determine the next actions that may be appropriate.") + self.assertEqual(inst.created.date, FHIRDate("2015-12-02").date) + self.assertEqual(inst.created.as_json(), "2015-12-02") + self.assertEqual(inst.description, "Discussion on the results of your recent MRI") + self.assertEqual(inst.id, "examplereq") + self.assertEqual(inst.identifier[0].system, "http://example.org/sampleappointment-identifier") + self.assertEqual(inst.identifier[0].value, "123") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.participant[0].required, "information-only") - self.assertEqual(inst.participant[0].status, "accepted") + self.assertEqual(inst.minutesDuration, 15) + self.assertEqual(inst.participant[0].required, "required") + self.assertEqual(inst.participant[0].status, "needs-action") self.assertEqual(inst.participant[1].required, "required") - self.assertEqual(inst.participant[1].status, "accepted") + self.assertEqual(inst.participant[1].status, "needs-action") + self.assertEqual(inst.participant[1].type[0].coding[0].code, "ATND") + self.assertEqual(inst.participant[1].type[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") self.assertEqual(inst.participant[2].required, "required") self.assertEqual(inst.participant[2].status, "accepted") - self.assertEqual(inst.participant[3].required, "information-only") - self.assertEqual(inst.participant[3].status, "accepted") self.assertEqual(inst.priority, 5) + self.assertEqual(inst.reasonCode[0].coding[0].code, "413095006") + self.assertEqual(inst.reasonCode[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.reasonCode[0].text, "Clinical Review") + self.assertEqual(inst.requestedPeriod[0].end.date, FHIRDate("2016-06-09").date) + self.assertEqual(inst.requestedPeriod[0].end.as_json(), "2016-06-09") + self.assertEqual(inst.requestedPeriod[0].start.date, FHIRDate("2016-06-02").date) + self.assertEqual(inst.requestedPeriod[0].start.as_json(), "2016-06-02") self.assertEqual(inst.serviceCategory[0].coding[0].code, "gp") self.assertEqual(inst.serviceCategory[0].coding[0].display, "General Practice") self.assertEqual(inst.serviceCategory[0].coding[0].system, "http://example.org/service-category") - self.assertEqual(inst.serviceType[0].coding[0].code, "52") - self.assertEqual(inst.serviceType[0].coding[0].display, "General Discussion") self.assertEqual(inst.specialty[0].coding[0].code, "394814009") self.assertEqual(inst.specialty[0].coding[0].display, "General practice") self.assertEqual(inst.specialty[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.start.date, FHIRDate("2013-12-09T09:00:00Z").date) - self.assertEqual(inst.start.as_json(), "2013-12-09T09:00:00Z") - self.assertEqual(inst.status, "booked") + self.assertEqual(inst.status, "proposed") self.assertEqual(inst.text.div, "
Brian MRI results discussion
") self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/appointmentresponse.py b/fhirclient/models/appointmentresponse.py index 332d26c48..a89cafa18 100644 --- a/fhirclient/models/appointmentresponse.py +++ b/fhirclient/models/appointmentresponse.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/AppointmentResponse) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/AppointmentResponse) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -43,8 +43,7 @@ def __init__(self, jsondict=None, strict=True): List of `Identifier` items (represented as `dict` in JSON). """ self.participantStatus = None - """ accepted | declined | tentative | in-process | completed | needs- - action | entered-in-error. + """ accepted | declined | tentative | needs-action. Type `str`. """ self.participantType = None diff --git a/fhirclient/models/appointmentresponse_tests.py b/fhirclient/models/appointmentresponse_tests.py index 63e4eb807..d68046e99 100644 --- a/fhirclient/models/appointmentresponse_tests.py +++ b/fhirclient/models/appointmentresponse_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/attachment.py b/fhirclient/models/attachment.py index d58385a16..f5413948a 100644 --- a/fhirclient/models/attachment.py +++ b/fhirclient/models/attachment.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Attachment) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Attachment) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/auditevent.py b/fhirclient/models/auditevent.py index 690d61e66..e00758edc 100644 --- a/fhirclient/models/auditevent.py +++ b/fhirclient/models/auditevent.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/AuditEvent) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/AuditEvent) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/auditevent_tests.py b/fhirclient/models/auditevent_tests.py index e5f9f1a97..7f72a7d72 100644 --- a/fhirclient/models/auditevent_tests.py +++ b/fhirclient/models/auditevent_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return auditevent.AuditEvent(js) def testAuditEvent1(self): - inst = self.instantiate_from("audit-event-example-search.json") + inst = self.instantiate_from("audit-event-example-vread.json") self.assertIsNotNone(inst, "Must have instantiated a AuditEvent instance") self.implAuditEvent1(inst) @@ -32,7 +32,7 @@ def testAuditEvent1(self): self.implAuditEvent1(inst2) def implAuditEvent1(self, inst): - self.assertEqual(inst.action, "E") + self.assertEqual(inst.action, "R") self.assertEqual(inst.agent[0].altId, "601847123") self.assertEqual(inst.agent[0].name, "Grahame Grieve") self.assertTrue(inst.agent[0].requestor) @@ -46,26 +46,25 @@ def implAuditEvent1(self, inst): self.assertEqual(inst.agent[1].type.coding[0].code, "110153") self.assertEqual(inst.agent[1].type.coding[0].display, "Source Role ID") self.assertEqual(inst.agent[1].type.coding[0].system, "http://dicom.nema.org/resources/ontology/DCM") - self.assertEqual(inst.entity[0].query, "aHR0cDovL2ZoaXItZGV2LmhlYWx0aGludGVyc2VjdGlvbnMuY29tLmF1L29wZW4vRW5jb3VudGVyP3BhcnRpY2lwYW50PTEz") - self.assertEqual(inst.entity[0].role.code, "24") - self.assertEqual(inst.entity[0].role.display, "Query") - self.assertEqual(inst.entity[0].role.system, "http://terminology.hl7.org/CodeSystem/object-role") + self.assertEqual(inst.entity[0].lifecycle.code, "6") + self.assertEqual(inst.entity[0].lifecycle.display, "Access / Use") + self.assertEqual(inst.entity[0].lifecycle.system, "http://terminology.hl7.org/CodeSystem/dicom-audit-lifecycle") self.assertEqual(inst.entity[0].type.code, "2") self.assertEqual(inst.entity[0].type.display, "System Object") self.assertEqual(inst.entity[0].type.system, "http://terminology.hl7.org/CodeSystem/audit-entity-type") - self.assertEqual(inst.id, "example-search") + self.assertEqual(inst.id, "example-rest") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.outcome, "0") - self.assertEqual(inst.recorded.date, FHIRDate("2015-08-22T23:42:24Z").date) - self.assertEqual(inst.recorded.as_json(), "2015-08-22T23:42:24Z") + self.assertEqual(inst.recorded.date, FHIRDate("2013-06-20T23:42:24Z").date) + self.assertEqual(inst.recorded.as_json(), "2013-06-20T23:42:24Z") self.assertEqual(inst.source.site, "Cloud") self.assertEqual(inst.source.type[0].code, "3") self.assertEqual(inst.source.type[0].display, "Web Server") self.assertEqual(inst.source.type[0].system, "http://terminology.hl7.org/CodeSystem/security-source-type") - self.assertEqual(inst.subtype[0].code, "search") - self.assertEqual(inst.subtype[0].display, "search") + self.assertEqual(inst.subtype[0].code, "vread") + self.assertEqual(inst.subtype[0].display, "vread") self.assertEqual(inst.subtype[0].system, "http://hl7.org/fhir/restful-interaction") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type.code, "rest") @@ -73,7 +72,7 @@ def implAuditEvent1(self, inst): self.assertEqual(inst.type.system, "http://terminology.hl7.org/CodeSystem/audit-event-type") def testAuditEvent2(self): - inst = self.instantiate_from("audit-event-example-logout.json") + inst = self.instantiate_from("auditevent-example-disclosure.json") self.assertIsNotNone(inst, "Must have instantiated a AuditEvent instance") self.implAuditEvent2(inst) @@ -83,43 +82,76 @@ def testAuditEvent2(self): self.implAuditEvent2(inst2) def implAuditEvent2(self, inst): - self.assertEqual(inst.action, "E") - self.assertEqual(inst.agent[0].altId, "601847123") - self.assertEqual(inst.agent[0].name, "Grahame Grieve") - self.assertEqual(inst.agent[0].network.address, "127.0.0.1") - self.assertEqual(inst.agent[0].network.type, "2") + self.assertEqual(inst.action, "R") + self.assertEqual(inst.agent[0].altId, "notMe") + self.assertEqual(inst.agent[0].name, "That guy everyone wishes would be caught") + self.assertEqual(inst.agent[0].network.address, "custodian.net") + self.assertEqual(inst.agent[0].network.type, "1") + self.assertEqual(inst.agent[0].policy[0], "http://consent.com/yes") self.assertTrue(inst.agent[0].requestor) - self.assertEqual(inst.agent[0].type.coding[0].code, "humanuser") - self.assertEqual(inst.agent[0].type.coding[0].display, "human user") - self.assertEqual(inst.agent[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/extra-security-role-type") - self.assertEqual(inst.agent[1].altId, "6580") - self.assertEqual(inst.agent[1].network.address, "Workstation1.ehr.familyclinic.com") + self.assertEqual(inst.agent[0].type.coding[0].code, "110153") + self.assertEqual(inst.agent[0].type.coding[0].display, "Source Role ID") + self.assertEqual(inst.agent[0].type.coding[0].system, "http://dicom.nema.org/resources/ontology/DCM") + self.assertEqual(inst.agent[1].network.address, "marketing.land") self.assertEqual(inst.agent[1].network.type, "1") + self.assertEqual(inst.agent[1].purposeOfUse[0].coding[0].code, "HMARKT") + self.assertEqual(inst.agent[1].purposeOfUse[0].coding[0].display, "healthcare marketing") + self.assertEqual(inst.agent[1].purposeOfUse[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertFalse(inst.agent[1].requestor) - self.assertEqual(inst.agent[1].type.coding[0].code, "110153") - self.assertEqual(inst.agent[1].type.coding[0].display, "Source Role ID") + self.assertEqual(inst.agent[1].type.coding[0].code, "110152") + self.assertEqual(inst.agent[1].type.coding[0].display, "Destination Role ID") self.assertEqual(inst.agent[1].type.coding[0].system, "http://dicom.nema.org/resources/ontology/DCM") - self.assertEqual(inst.id, "example-logout") + self.assertEqual(inst.entity[0].role.code, "1") + self.assertEqual(inst.entity[0].role.display, "Patient") + self.assertEqual(inst.entity[0].role.system, "http://terminology.hl7.org/CodeSystem/object-role") + self.assertEqual(inst.entity[0].type.code, "1") + self.assertEqual(inst.entity[0].type.display, "Person") + self.assertEqual(inst.entity[0].type.system, "http://terminology.hl7.org/CodeSystem/audit-entity-type") + self.assertEqual(inst.entity[1].description, "data about Everthing important") + self.assertEqual(inst.entity[1].lifecycle.code, "11") + self.assertEqual(inst.entity[1].lifecycle.display, "Disclosure") + self.assertEqual(inst.entity[1].lifecycle.system, "http://terminology.hl7.org/CodeSystem/dicom-audit-lifecycle") + self.assertEqual(inst.entity[1].name, "Namne of What") + self.assertEqual(inst.entity[1].role.code, "4") + self.assertEqual(inst.entity[1].role.display, "Domain Resource") + self.assertEqual(inst.entity[1].role.system, "http://terminology.hl7.org/CodeSystem/object-role") + self.assertEqual(inst.entity[1].securityLabel[0].code, "V") + self.assertEqual(inst.entity[1].securityLabel[0].display, "very restricted") + self.assertEqual(inst.entity[1].securityLabel[0].system, "http://terminology.hl7.org/CodeSystem/v3-Confidentiality") + self.assertEqual(inst.entity[1].securityLabel[1].code, "STD") + self.assertEqual(inst.entity[1].securityLabel[1].display, "sexually transmitted disease information sensitivity") + self.assertEqual(inst.entity[1].securityLabel[1].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") + self.assertEqual(inst.entity[1].securityLabel[2].code, "DELAU") + self.assertEqual(inst.entity[1].securityLabel[2].display, "delete after use") + self.assertEqual(inst.entity[1].securityLabel[2].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") + self.assertEqual(inst.entity[1].type.code, "2") + self.assertEqual(inst.entity[1].type.display, "System Object") + self.assertEqual(inst.entity[1].type.system, "http://terminology.hl7.org/CodeSystem/audit-entity-type") + self.assertEqual(inst.id, "example-disclosure") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.outcome, "0") - self.assertEqual(inst.recorded.date, FHIRDate("2013-06-20T23:46:41Z").date) - self.assertEqual(inst.recorded.as_json(), "2013-06-20T23:46:41Z") - self.assertEqual(inst.source.site, "Cloud") - self.assertEqual(inst.source.type[0].code, "3") - self.assertEqual(inst.source.type[0].display, "Web Server") + self.assertEqual(inst.outcomeDesc, "Successful Disclosure") + self.assertEqual(inst.purposeOfEvent[0].coding[0].code, "HMARKT") + self.assertEqual(inst.purposeOfEvent[0].coding[0].display, "healthcare marketing") + self.assertEqual(inst.purposeOfEvent[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.recorded.date, FHIRDate("2013-09-22T00:08:00Z").date) + self.assertEqual(inst.recorded.as_json(), "2013-09-22T00:08:00Z") + self.assertEqual(inst.source.site, "Watcher") + self.assertEqual(inst.source.type[0].code, "4") + self.assertEqual(inst.source.type[0].display, "Application Server") self.assertEqual(inst.source.type[0].system, "http://terminology.hl7.org/CodeSystem/security-source-type") - self.assertEqual(inst.subtype[0].code, "110123") - self.assertEqual(inst.subtype[0].display, "Logout") - self.assertEqual(inst.subtype[0].system, "http://dicom.nema.org/resources/ontology/DCM") + self.assertEqual(inst.subtype[0].code, "Disclosure") + self.assertEqual(inst.subtype[0].display, "HIPAA disclosure") + self.assertEqual(inst.text.div, "
Disclosure by some idiot, for marketing reasons, to places unknown, of a Poor Sap, data about Everthing important.
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.code, "110114") - self.assertEqual(inst.type.display, "User Authentication") + self.assertEqual(inst.type.code, "110106") + self.assertEqual(inst.type.display, "Export") self.assertEqual(inst.type.system, "http://dicom.nema.org/resources/ontology/DCM") def testAuditEvent3(self): - inst = self.instantiate_from("audit-event-example-vread.json") + inst = self.instantiate_from("auditevent-example-error.json") self.assertIsNotNone(inst, "Must have instantiated a AuditEvent instance") self.implAuditEvent3(inst) @@ -129,7 +161,7 @@ def testAuditEvent3(self): self.implAuditEvent3(inst2) def implAuditEvent3(self, inst): - self.assertEqual(inst.action, "R") + self.assertEqual(inst.action, "C") self.assertEqual(inst.agent[0].altId, "601847123") self.assertEqual(inst.agent[0].name, "Grahame Grieve") self.assertTrue(inst.agent[0].requestor) @@ -143,25 +175,30 @@ def implAuditEvent3(self, inst): self.assertEqual(inst.agent[1].type.coding[0].code, "110153") self.assertEqual(inst.agent[1].type.coding[0].display, "Source Role ID") self.assertEqual(inst.agent[1].type.coding[0].system, "http://dicom.nema.org/resources/ontology/DCM") - self.assertEqual(inst.entity[0].lifecycle.code, "6") - self.assertEqual(inst.entity[0].lifecycle.display, "Access / Use") - self.assertEqual(inst.entity[0].lifecycle.system, "http://terminology.hl7.org/CodeSystem/dicom-audit-lifecycle") + self.assertEqual(inst.contained[0].id, "o1") + self.assertEqual(inst.entity[0].detail[0].type, "requested transaction") + self.assertEqual(inst.entity[0].detail[0].valueString, "http POST ..... ") self.assertEqual(inst.entity[0].type.code, "2") self.assertEqual(inst.entity[0].type.display, "System Object") self.assertEqual(inst.entity[0].type.system, "http://terminology.hl7.org/CodeSystem/audit-entity-type") - self.assertEqual(inst.id, "example-rest") + self.assertEqual(inst.entity[1].description, "transaction failed") + self.assertEqual(inst.entity[1].type.code, "OperationOutcome") + self.assertEqual(inst.entity[1].type.display, "OperationOutcome") + self.assertEqual(inst.entity[1].type.system, "http://hl7.org/fhir/resource-types") + self.assertEqual(inst.id, "example-error") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.outcome, "0") - self.assertEqual(inst.recorded.date, FHIRDate("2013-06-20T23:42:24Z").date) - self.assertEqual(inst.recorded.as_json(), "2013-06-20T23:42:24Z") + self.assertEqual(inst.outcome, "8") + self.assertEqual(inst.outcomeDesc, "Invalid request to create an Operation resource on the Patient endpoint.") + self.assertEqual(inst.recorded.date, FHIRDate("2017-09-07T23:42:24Z").date) + self.assertEqual(inst.recorded.as_json(), "2017-09-07T23:42:24Z") self.assertEqual(inst.source.site, "Cloud") self.assertEqual(inst.source.type[0].code, "3") self.assertEqual(inst.source.type[0].display, "Web Server") self.assertEqual(inst.source.type[0].system, "http://terminology.hl7.org/CodeSystem/security-source-type") - self.assertEqual(inst.subtype[0].code, "vread") - self.assertEqual(inst.subtype[0].display, "vread") + self.assertEqual(inst.subtype[0].code, "create") + self.assertEqual(inst.subtype[0].display, "create") self.assertEqual(inst.subtype[0].system, "http://hl7.org/fhir/restful-interaction") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type.code, "rest") @@ -229,7 +266,7 @@ def implAuditEvent4(self, inst): self.assertEqual(inst.type.system, "http://dicom.nema.org/resources/ontology/DCM") def testAuditEvent5(self): - inst = self.instantiate_from("audit-event-example-login.json") + inst = self.instantiate_from("audit-event-example-logout.json") self.assertIsNotNone(inst, "Must have instantiated a AuditEvent instance") self.implAuditEvent5(inst) @@ -255,19 +292,19 @@ def implAuditEvent5(self, inst): self.assertEqual(inst.agent[1].type.coding[0].code, "110153") self.assertEqual(inst.agent[1].type.coding[0].display, "Source Role ID") self.assertEqual(inst.agent[1].type.coding[0].system, "http://dicom.nema.org/resources/ontology/DCM") - self.assertEqual(inst.id, "example-login") + self.assertEqual(inst.id, "example-logout") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.outcome, "0") - self.assertEqual(inst.recorded.date, FHIRDate("2013-06-20T23:41:23Z").date) - self.assertEqual(inst.recorded.as_json(), "2013-06-20T23:41:23Z") + self.assertEqual(inst.recorded.date, FHIRDate("2013-06-20T23:46:41Z").date) + self.assertEqual(inst.recorded.as_json(), "2013-06-20T23:46:41Z") self.assertEqual(inst.source.site, "Cloud") self.assertEqual(inst.source.type[0].code, "3") self.assertEqual(inst.source.type[0].display, "Web Server") self.assertEqual(inst.source.type[0].system, "http://terminology.hl7.org/CodeSystem/security-source-type") - self.assertEqual(inst.subtype[0].code, "110122") - self.assertEqual(inst.subtype[0].display, "Login") + self.assertEqual(inst.subtype[0].code, "110123") + self.assertEqual(inst.subtype[0].display, "Logout") self.assertEqual(inst.subtype[0].system, "http://dicom.nema.org/resources/ontology/DCM") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type.code, "110114") @@ -275,7 +312,7 @@ def implAuditEvent5(self, inst): self.assertEqual(inst.type.system, "http://dicom.nema.org/resources/ontology/DCM") def testAuditEvent6(self): - inst = self.instantiate_from("audit-event-example-pixQuery.json") + inst = self.instantiate_from("audit-event-example-login.json") self.assertIsNotNone(inst, "Must have instantiated a AuditEvent instance") self.implAuditEvent6(inst) @@ -286,46 +323,38 @@ def testAuditEvent6(self): def implAuditEvent6(self, inst): self.assertEqual(inst.action, "E") - self.assertEqual(inst.agent[0].altId, "6580") - self.assertEqual(inst.agent[0].network.address, "Workstation1.ehr.familyclinic.com") - self.assertEqual(inst.agent[0].network.type, "1") - self.assertFalse(inst.agent[0].requestor) - self.assertEqual(inst.agent[0].type.coding[0].code, "110153") - self.assertEqual(inst.agent[0].type.coding[0].display, "Source Role ID") - self.assertEqual(inst.agent[0].type.coding[0].system, "http://dicom.nema.org/resources/ontology/DCM") - self.assertEqual(inst.agent[1].altId, "601847123") - self.assertEqual(inst.agent[1].name, "Grahame Grieve") - self.assertTrue(inst.agent[1].requestor) - self.assertEqual(inst.agent[1].type.coding[0].code, "humanuser") - self.assertEqual(inst.agent[1].type.coding[0].display, "human user") - self.assertEqual(inst.agent[1].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/extra-security-role-type") - self.assertEqual(inst.entity[0].role.code, "1") - self.assertEqual(inst.entity[0].role.display, "Patient") - self.assertEqual(inst.entity[0].role.system, "http://terminology.hl7.org/CodeSystem/object-role") - self.assertEqual(inst.entity[0].type.code, "1") - self.assertEqual(inst.entity[0].type.display, "Person") - self.assertEqual(inst.entity[0].type.system, "http://terminology.hl7.org/CodeSystem/audit-entity-type") - self.assertEqual(inst.entity[1].detail[0].type, "MSH-10") - self.assertEqual(inst.entity[1].detail[0].valueBase64Binary, "MS4yLjg0MC4xMTQzNTAuMS4xMy4wLjEuNy4xLjE=") - self.assertEqual(inst.entity[1].role.code, "24") - self.assertEqual(inst.entity[1].role.display, "Query") - self.assertEqual(inst.entity[1].role.system, "http://terminology.hl7.org/CodeSystem/object-role") - self.assertEqual(inst.entity[1].type.code, "2") - self.assertEqual(inst.entity[1].type.display, "System Object") - self.assertEqual(inst.entity[1].type.system, "http://terminology.hl7.org/CodeSystem/audit-entity-type") - self.assertEqual(inst.id, "example-pixQuery") + self.assertEqual(inst.agent[0].altId, "601847123") + self.assertEqual(inst.agent[0].name, "Grahame Grieve") + self.assertEqual(inst.agent[0].network.address, "127.0.0.1") + self.assertEqual(inst.agent[0].network.type, "2") + self.assertTrue(inst.agent[0].requestor) + self.assertEqual(inst.agent[0].type.coding[0].code, "humanuser") + self.assertEqual(inst.agent[0].type.coding[0].display, "human user") + self.assertEqual(inst.agent[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/extra-security-role-type") + self.assertEqual(inst.agent[1].altId, "6580") + self.assertEqual(inst.agent[1].network.address, "Workstation1.ehr.familyclinic.com") + self.assertEqual(inst.agent[1].network.type, "1") + self.assertFalse(inst.agent[1].requestor) + self.assertEqual(inst.agent[1].type.coding[0].code, "110153") + self.assertEqual(inst.agent[1].type.coding[0].display, "Source Role ID") + self.assertEqual(inst.agent[1].type.coding[0].system, "http://dicom.nema.org/resources/ontology/DCM") + self.assertEqual(inst.id, "example-login") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.outcome, "0") - self.assertEqual(inst.recorded.date, FHIRDate("2015-08-26T23:42:24Z").date) - self.assertEqual(inst.recorded.as_json(), "2015-08-26T23:42:24Z") - self.assertEqual(inst.subtype[0].code, "ITI-9") - self.assertEqual(inst.subtype[0].display, "PIX Query") - self.assertEqual(inst.subtype[0].system, "urn:oid:1.3.6.1.4.1.19376.1.2") + self.assertEqual(inst.recorded.date, FHIRDate("2013-06-20T23:41:23Z").date) + self.assertEqual(inst.recorded.as_json(), "2013-06-20T23:41:23Z") + self.assertEqual(inst.source.site, "Cloud") + self.assertEqual(inst.source.type[0].code, "3") + self.assertEqual(inst.source.type[0].display, "Web Server") + self.assertEqual(inst.source.type[0].system, "http://terminology.hl7.org/CodeSystem/security-source-type") + self.assertEqual(inst.subtype[0].code, "110122") + self.assertEqual(inst.subtype[0].display, "Login") + self.assertEqual(inst.subtype[0].system, "http://dicom.nema.org/resources/ontology/DCM") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.code, "110112") - self.assertEqual(inst.type.display, "Query") + self.assertEqual(inst.type.code, "110114") + self.assertEqual(inst.type.display, "User Authentication") self.assertEqual(inst.type.system, "http://dicom.nema.org/resources/ontology/DCM") def testAuditEvent7(self): @@ -385,7 +414,7 @@ def implAuditEvent7(self, inst): self.assertEqual(inst.type.system, "http://dicom.nema.org/resources/ontology/DCM") def testAuditEvent8(self): - inst = self.instantiate_from("auditevent-example-disclosure.json") + inst = self.instantiate_from("audit-event-example-pixQuery.json") self.assertIsNotNone(inst, "Must have instantiated a AuditEvent instance") self.implAuditEvent8(inst) @@ -395,76 +424,51 @@ def testAuditEvent8(self): self.implAuditEvent8(inst2) def implAuditEvent8(self, inst): - self.assertEqual(inst.action, "R") - self.assertEqual(inst.agent[0].altId, "notMe") - self.assertEqual(inst.agent[0].name, "That guy everyone wishes would be caught") - self.assertEqual(inst.agent[0].network.address, "custodian.net") + self.assertEqual(inst.action, "E") + self.assertEqual(inst.agent[0].altId, "6580") + self.assertEqual(inst.agent[0].network.address, "Workstation1.ehr.familyclinic.com") self.assertEqual(inst.agent[0].network.type, "1") - self.assertEqual(inst.agent[0].policy[0], "http://consent.com/yes") - self.assertTrue(inst.agent[0].requestor) + self.assertFalse(inst.agent[0].requestor) self.assertEqual(inst.agent[0].type.coding[0].code, "110153") self.assertEqual(inst.agent[0].type.coding[0].display, "Source Role ID") self.assertEqual(inst.agent[0].type.coding[0].system, "http://dicom.nema.org/resources/ontology/DCM") - self.assertEqual(inst.agent[1].network.address, "marketing.land") - self.assertEqual(inst.agent[1].network.type, "1") - self.assertEqual(inst.agent[1].purposeOfUse[0].coding[0].code, "HMARKT") - self.assertEqual(inst.agent[1].purposeOfUse[0].coding[0].display, "healthcare marketing") - self.assertEqual(inst.agent[1].purposeOfUse[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertFalse(inst.agent[1].requestor) - self.assertEqual(inst.agent[1].type.coding[0].code, "110152") - self.assertEqual(inst.agent[1].type.coding[0].display, "Destination Role ID") - self.assertEqual(inst.agent[1].type.coding[0].system, "http://dicom.nema.org/resources/ontology/DCM") + self.assertEqual(inst.agent[1].altId, "601847123") + self.assertEqual(inst.agent[1].name, "Grahame Grieve") + self.assertTrue(inst.agent[1].requestor) + self.assertEqual(inst.agent[1].type.coding[0].code, "humanuser") + self.assertEqual(inst.agent[1].type.coding[0].display, "human user") + self.assertEqual(inst.agent[1].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/extra-security-role-type") self.assertEqual(inst.entity[0].role.code, "1") self.assertEqual(inst.entity[0].role.display, "Patient") self.assertEqual(inst.entity[0].role.system, "http://terminology.hl7.org/CodeSystem/object-role") self.assertEqual(inst.entity[0].type.code, "1") self.assertEqual(inst.entity[0].type.display, "Person") self.assertEqual(inst.entity[0].type.system, "http://terminology.hl7.org/CodeSystem/audit-entity-type") - self.assertEqual(inst.entity[1].description, "data about Everthing important") - self.assertEqual(inst.entity[1].lifecycle.code, "11") - self.assertEqual(inst.entity[1].lifecycle.display, "Disclosure") - self.assertEqual(inst.entity[1].lifecycle.system, "http://terminology.hl7.org/CodeSystem/dicom-audit-lifecycle") - self.assertEqual(inst.entity[1].name, "Namne of What") - self.assertEqual(inst.entity[1].role.code, "4") - self.assertEqual(inst.entity[1].role.display, "Domain Resource") + self.assertEqual(inst.entity[1].detail[0].type, "MSH-10") + self.assertEqual(inst.entity[1].detail[0].valueBase64Binary, "MS4yLjg0MC4xMTQzNTAuMS4xMy4wLjEuNy4xLjE=") + self.assertEqual(inst.entity[1].role.code, "24") + self.assertEqual(inst.entity[1].role.display, "Query") self.assertEqual(inst.entity[1].role.system, "http://terminology.hl7.org/CodeSystem/object-role") - self.assertEqual(inst.entity[1].securityLabel[0].code, "V") - self.assertEqual(inst.entity[1].securityLabel[0].display, "very restricted") - self.assertEqual(inst.entity[1].securityLabel[0].system, "http://terminology.hl7.org/CodeSystem/v3-Confidentiality") - self.assertEqual(inst.entity[1].securityLabel[1].code, "STD") - self.assertEqual(inst.entity[1].securityLabel[1].display, "sexually transmitted disease information sensitivity") - self.assertEqual(inst.entity[1].securityLabel[1].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.entity[1].securityLabel[2].code, "DELAU") - self.assertEqual(inst.entity[1].securityLabel[2].display, "delete after use") - self.assertEqual(inst.entity[1].securityLabel[2].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") self.assertEqual(inst.entity[1].type.code, "2") self.assertEqual(inst.entity[1].type.display, "System Object") self.assertEqual(inst.entity[1].type.system, "http://terminology.hl7.org/CodeSystem/audit-entity-type") - self.assertEqual(inst.id, "example-disclosure") + self.assertEqual(inst.id, "example-pixQuery") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.outcome, "0") - self.assertEqual(inst.outcomeDesc, "Successful Disclosure") - self.assertEqual(inst.purposeOfEvent[0].coding[0].code, "HMARKT") - self.assertEqual(inst.purposeOfEvent[0].coding[0].display, "healthcare marketing") - self.assertEqual(inst.purposeOfEvent[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.recorded.date, FHIRDate("2013-09-22T00:08:00Z").date) - self.assertEqual(inst.recorded.as_json(), "2013-09-22T00:08:00Z") - self.assertEqual(inst.source.site, "Watcher") - self.assertEqual(inst.source.type[0].code, "4") - self.assertEqual(inst.source.type[0].display, "Application Server") - self.assertEqual(inst.source.type[0].system, "http://terminology.hl7.org/CodeSystem/security-source-type") - self.assertEqual(inst.subtype[0].code, "Disclosure") - self.assertEqual(inst.subtype[0].display, "HIPAA disclosure") - self.assertEqual(inst.text.div, "
Disclosure by some idiot, for marketing reasons, to places unknown, of a Poor Sap, data about Everthing important.
") + self.assertEqual(inst.recorded.date, FHIRDate("2015-08-26T23:42:24Z").date) + self.assertEqual(inst.recorded.as_json(), "2015-08-26T23:42:24Z") + self.assertEqual(inst.subtype[0].code, "ITI-9") + self.assertEqual(inst.subtype[0].display, "PIX Query") + self.assertEqual(inst.subtype[0].system, "urn:oid:1.3.6.1.4.1.19376.1.2") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.code, "110106") - self.assertEqual(inst.type.display, "Export") + self.assertEqual(inst.type.code, "110112") + self.assertEqual(inst.type.display, "Query") self.assertEqual(inst.type.system, "http://dicom.nema.org/resources/ontology/DCM") def testAuditEvent9(self): - inst = self.instantiate_from("auditevent-example-error.json") + inst = self.instantiate_from("audit-event-example-search.json") self.assertIsNotNone(inst, "Must have instantiated a AuditEvent instance") self.implAuditEvent9(inst) @@ -474,7 +478,7 @@ def testAuditEvent9(self): self.implAuditEvent9(inst2) def implAuditEvent9(self, inst): - self.assertEqual(inst.action, "C") + self.assertEqual(inst.action, "E") self.assertEqual(inst.agent[0].altId, "601847123") self.assertEqual(inst.agent[0].name, "Grahame Grieve") self.assertTrue(inst.agent[0].requestor) @@ -488,30 +492,26 @@ def implAuditEvent9(self, inst): self.assertEqual(inst.agent[1].type.coding[0].code, "110153") self.assertEqual(inst.agent[1].type.coding[0].display, "Source Role ID") self.assertEqual(inst.agent[1].type.coding[0].system, "http://dicom.nema.org/resources/ontology/DCM") - self.assertEqual(inst.contained[0].id, "o1") - self.assertEqual(inst.entity[0].detail[0].type, "requested transaction") - self.assertEqual(inst.entity[0].detail[0].valueString, "http POST ..... ") + self.assertEqual(inst.entity[0].query, "aHR0cDovL2ZoaXItZGV2LmhlYWx0aGludGVyc2VjdGlvbnMuY29tLmF1L29wZW4vRW5jb3VudGVyP3BhcnRpY2lwYW50PTEz") + self.assertEqual(inst.entity[0].role.code, "24") + self.assertEqual(inst.entity[0].role.display, "Query") + self.assertEqual(inst.entity[0].role.system, "http://terminology.hl7.org/CodeSystem/object-role") self.assertEqual(inst.entity[0].type.code, "2") self.assertEqual(inst.entity[0].type.display, "System Object") self.assertEqual(inst.entity[0].type.system, "http://terminology.hl7.org/CodeSystem/audit-entity-type") - self.assertEqual(inst.entity[1].description, "transaction failed") - self.assertEqual(inst.entity[1].type.code, "OperationOutcome") - self.assertEqual(inst.entity[1].type.display, "OperationOutcome") - self.assertEqual(inst.entity[1].type.system, "http://hl7.org/fhir/resource-types") - self.assertEqual(inst.id, "example-error") + self.assertEqual(inst.id, "example-search") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.outcome, "8") - self.assertEqual(inst.outcomeDesc, "Invalid request to create an Operation resource on the Patient endpoint.") - self.assertEqual(inst.recorded.date, FHIRDate("2017-09-07T23:42:24Z").date) - self.assertEqual(inst.recorded.as_json(), "2017-09-07T23:42:24Z") + self.assertEqual(inst.outcome, "0") + self.assertEqual(inst.recorded.date, FHIRDate("2015-08-22T23:42:24Z").date) + self.assertEqual(inst.recorded.as_json(), "2015-08-22T23:42:24Z") self.assertEqual(inst.source.site, "Cloud") self.assertEqual(inst.source.type[0].code, "3") self.assertEqual(inst.source.type[0].display, "Web Server") self.assertEqual(inst.source.type[0].system, "http://terminology.hl7.org/CodeSystem/security-source-type") - self.assertEqual(inst.subtype[0].code, "create") - self.assertEqual(inst.subtype[0].display, "create") + self.assertEqual(inst.subtype[0].code, "search") + self.assertEqual(inst.subtype[0].display, "search") self.assertEqual(inst.subtype[0].system, "http://hl7.org/fhir/restful-interaction") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type.code, "rest") diff --git a/fhirclient/models/backboneelement.py b/fhirclient/models/backboneelement.py index 84a55649e..a45ac3c96 100644 --- a/fhirclient/models/backboneelement.py +++ b/fhirclient/models/backboneelement.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/BackboneElement) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/BackboneElement) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/basic.py b/fhirclient/models/basic.py index 39ebf97ba..15f75d6a8 100644 --- a/fhirclient/models/basic.py +++ b/fhirclient/models/basic.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Basic) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Basic) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/basic_tests.py b/fhirclient/models/basic_tests.py index 8b9075f87..b90a2a07d 100644 --- a/fhirclient/models/basic_tests.py +++ b/fhirclient/models/basic_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return basic.Basic(js) def testBasic1(self): - inst = self.instantiate_from("basic-example2.json") + inst = self.instantiate_from("basic-example.json") self.assertIsNotNone(inst, "Must have instantiated a Basic instance") self.implBasic1(inst) @@ -32,6 +32,44 @@ def testBasic1(self): self.implBasic1(inst2) def implBasic1(self, inst): + self.assertEqual(inst.code.coding[0].code, "referral") + self.assertEqual(inst.code.coding[0].system, "http://terminology.hl7.org/CodeSystem/basic-resource-type") + self.assertEqual(inst.created.date, FHIRDate("2013-05-14").date) + self.assertEqual(inst.created.as_json(), "2013-05-14") + self.assertEqual(inst.extension[0].url, "http://example.org/do-not-use/fhir-extensions/referral#requestingPractitioner") + self.assertEqual(inst.extension[1].url, "http://example.org/do-not-use/fhir-extensions/referral#notes") + self.assertEqual(inst.extension[1].valueString, "The patient had fever peaks over the last couple of days. He is worried about these peaks.") + self.assertEqual(inst.extension[2].url, "http://example.org/do-not-use/fhir-extensions/referral#fulfillingEncounter") + self.assertEqual(inst.id, "referral") + self.assertEqual(inst.identifier[0].system, "http://goodhealth.org/basic/identifiers") + self.assertEqual(inst.identifier[0].value, "19283746") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.modifierExtension[0].url, "http://example.org/do-not-use/fhir-extensions/referral#referredForService") + self.assertEqual(inst.modifierExtension[0].valueCodeableConcept.coding[0].code, "11429006") + self.assertEqual(inst.modifierExtension[0].valueCodeableConcept.coding[0].display, "Consultation") + self.assertEqual(inst.modifierExtension[0].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.modifierExtension[1].url, "http://example.org/do-not-use/fhir-extensions/referral#targetDate") + self.assertEqual(inst.modifierExtension[1].valuePeriod.end.date, FHIRDate("2013-04-15").date) + self.assertEqual(inst.modifierExtension[1].valuePeriod.end.as_json(), "2013-04-15") + self.assertEqual(inst.modifierExtension[1].valuePeriod.start.date, FHIRDate("2013-04-01").date) + self.assertEqual(inst.modifierExtension[1].valuePeriod.start.as_json(), "2013-04-01") + self.assertEqual(inst.modifierExtension[2].url, "http://example.org/do-not-use/fhir-extensions/referral#status") + self.assertEqual(inst.modifierExtension[2].valueCode, "complete") + self.assertEqual(inst.text.status, "generated") + + def testBasic2(self): + inst = self.instantiate_from("basic-example2.json") + self.assertIsNotNone(inst, "Must have instantiated a Basic instance") + self.implBasic2(inst) + + js = inst.as_json() + self.assertEqual("Basic", js["resourceType"]) + inst2 = basic.Basic(js) + self.implBasic2(inst2) + + def implBasic2(self, inst): self.assertEqual(inst.code.coding[0].code, "UMLCLASSMODEL") self.assertEqual(inst.code.coding[0].system, "http://example.org/do-not-use/fhir-codes#resourceTypes") self.assertEqual(inst.extension[0].extension[0].url, "name") @@ -57,26 +95,8 @@ def implBasic1(self, inst): self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.text.status, "generated") - def testBasic2(self): - inst = self.instantiate_from("basic-example-narrative.json") - self.assertIsNotNone(inst, "Must have instantiated a Basic instance") - self.implBasic2(inst) - - js = inst.as_json() - self.assertEqual("Basic", js["resourceType"]) - inst2 = basic.Basic(js) - self.implBasic2(inst2) - - def implBasic2(self, inst): - self.assertEqual(inst.code.text, "Example Narrative Tester") - self.assertEqual(inst.id, "basic-example-narrative") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.text.status, "additional") - def testBasic3(self): - inst = self.instantiate_from("basic-example.json") + inst = self.instantiate_from("basic-example-narrative.json") self.assertIsNotNone(inst, "Must have instantiated a Basic instance") self.implBasic3(inst) @@ -86,30 +106,10 @@ def testBasic3(self): self.implBasic3(inst2) def implBasic3(self, inst): - self.assertEqual(inst.code.coding[0].code, "referral") - self.assertEqual(inst.code.coding[0].system, "http://terminology.hl7.org/CodeSystem/basic-resource-type") - self.assertEqual(inst.created.date, FHIRDate("2013-05-14").date) - self.assertEqual(inst.created.as_json(), "2013-05-14") - self.assertEqual(inst.extension[0].url, "http://example.org/do-not-use/fhir-extensions/referral#requestingPractitioner") - self.assertEqual(inst.extension[1].url, "http://example.org/do-not-use/fhir-extensions/referral#notes") - self.assertEqual(inst.extension[1].valueString, "The patient had fever peaks over the last couple of days. He is worried about these peaks.") - self.assertEqual(inst.extension[2].url, "http://example.org/do-not-use/fhir-extensions/referral#fulfillingEncounter") - self.assertEqual(inst.id, "referral") - self.assertEqual(inst.identifier[0].system, "http://goodhealth.org/basic/identifiers") - self.assertEqual(inst.identifier[0].value, "19283746") + self.assertEqual(inst.code.text, "Example Narrative Tester") + self.assertEqual(inst.id, "basic-example-narrative") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.modifierExtension[0].url, "http://example.org/do-not-use/fhir-extensions/referral#referredForService") - self.assertEqual(inst.modifierExtension[0].valueCodeableConcept.coding[0].code, "11429006") - self.assertEqual(inst.modifierExtension[0].valueCodeableConcept.coding[0].display, "Consultation") - self.assertEqual(inst.modifierExtension[0].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.modifierExtension[1].url, "http://example.org/do-not-use/fhir-extensions/referral#targetDate") - self.assertEqual(inst.modifierExtension[1].valuePeriod.end.date, FHIRDate("2013-04-15").date) - self.assertEqual(inst.modifierExtension[1].valuePeriod.end.as_json(), "2013-04-15") - self.assertEqual(inst.modifierExtension[1].valuePeriod.start.date, FHIRDate("2013-04-01").date) - self.assertEqual(inst.modifierExtension[1].valuePeriod.start.as_json(), "2013-04-01") - self.assertEqual(inst.modifierExtension[2].url, "http://example.org/do-not-use/fhir-extensions/referral#status") - self.assertEqual(inst.modifierExtension[2].valueCode, "complete") - self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.text.status, "additional") diff --git a/fhirclient/models/binary.py b/fhirclient/models/binary.py index b91f8b6f0..95ff72057 100644 --- a/fhirclient/models/binary.py +++ b/fhirclient/models/binary.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Binary) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Binary) on 2024-07-15. +# 2024, SMART Health IT. from . import resource diff --git a/fhirclient/models/binary_tests.py b/fhirclient/models/binary_tests.py index 19feed45a..12f2a5189 100644 --- a/fhirclient/models/binary_tests.py +++ b/fhirclient/models/binary_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/biologicallyderivedproduct.py b/fhirclient/models/biologicallyderivedproduct.py index eb1197294..094af8b06 100644 --- a/fhirclient/models/biologicallyderivedproduct.py +++ b/fhirclient/models/biologicallyderivedproduct.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProduct) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProduct) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/biologicallyderivedproduct_tests.py b/fhirclient/models/biologicallyderivedproduct_tests.py index 40d478ac1..12ef8b413 100644 --- a/fhirclient/models/biologicallyderivedproduct_tests.py +++ b/fhirclient/models/biologicallyderivedproduct_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/bodystructure.py b/fhirclient/models/bodystructure.py index 5c258c5a7..33a4cf241 100644 --- a/fhirclient/models/bodystructure.py +++ b/fhirclient/models/bodystructure.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/BodyStructure) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/BodyStructure) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/bodystructure_tests.py b/fhirclient/models/bodystructure_tests.py index 9966e4ea6..f2cb95542 100644 --- a/fhirclient/models/bodystructure_tests.py +++ b/fhirclient/models/bodystructure_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return bodystructure.BodyStructure(js) def testBodyStructure1(self): - inst = self.instantiate_from("bodystructure-example-fetus.json") + inst = self.instantiate_from("bodystructure-example-skin-patch.json") self.assertIsNotNone(inst, "Must have instantiated a BodyStructure instance") self.implBodyStructure1(inst) @@ -32,17 +32,27 @@ def testBodyStructure1(self): self.implBodyStructure1(inst2) def implBodyStructure1(self, inst): - self.assertEqual(inst.description, "EDD 1/1/2017 confirmation by LMP") - self.assertEqual(inst.id, "fetus") + self.assertFalse(inst.active) + self.assertEqual(inst.description, "inner surface (volar) of the left forearm") + self.assertEqual(inst.id, "skin-patch") self.assertEqual(inst.identifier[0].system, "http://goodhealth.org/bodystructure/identifiers") self.assertEqual(inst.identifier[0].value, "12345") - self.assertEqual(inst.location.coding[0].code, "83418008") - self.assertEqual(inst.location.coding[0].display, "Entire fetus (body structure)") + self.assertEqual(inst.location.coding[0].code, "14975008") + self.assertEqual(inst.location.coding[0].display, "Forearm") self.assertEqual(inst.location.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.location.text, "Fetus") + self.assertEqual(inst.location.text, "Forearm") + self.assertEqual(inst.locationQualifier[0].coding[0].code, "419161000") + self.assertEqual(inst.locationQualifier[0].coding[0].display, "Unilateral left") + self.assertEqual(inst.locationQualifier[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.locationQualifier[0].text, "Left") + self.assertEqual(inst.locationQualifier[1].coding[0].code, "263929005") + self.assertEqual(inst.locationQualifier[1].coding[0].display, "Volar") + self.assertEqual(inst.locationQualifier[1].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.locationQualifier[1].text, "Volar") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.morphology.text, "Skin patch") self.assertEqual(inst.text.status, "generated") def testBodyStructure2(self): @@ -76,7 +86,7 @@ def implBodyStructure2(self, inst): self.assertEqual(inst.text.status, "generated") def testBodyStructure3(self): - inst = self.instantiate_from("bodystructure-example-skin-patch.json") + inst = self.instantiate_from("bodystructure-example-fetus.json") self.assertIsNotNone(inst, "Must have instantiated a BodyStructure instance") self.implBodyStructure3(inst) @@ -86,26 +96,16 @@ def testBodyStructure3(self): self.implBodyStructure3(inst2) def implBodyStructure3(self, inst): - self.assertFalse(inst.active) - self.assertEqual(inst.description, "inner surface (volar) of the left forearm") - self.assertEqual(inst.id, "skin-patch") + self.assertEqual(inst.description, "EDD 1/1/2017 confirmation by LMP") + self.assertEqual(inst.id, "fetus") self.assertEqual(inst.identifier[0].system, "http://goodhealth.org/bodystructure/identifiers") self.assertEqual(inst.identifier[0].value, "12345") - self.assertEqual(inst.location.coding[0].code, "14975008") - self.assertEqual(inst.location.coding[0].display, "Forearm") + self.assertEqual(inst.location.coding[0].code, "83418008") + self.assertEqual(inst.location.coding[0].display, "Entire fetus (body structure)") self.assertEqual(inst.location.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.location.text, "Forearm") - self.assertEqual(inst.locationQualifier[0].coding[0].code, "419161000") - self.assertEqual(inst.locationQualifier[0].coding[0].display, "Unilateral left") - self.assertEqual(inst.locationQualifier[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.locationQualifier[0].text, "Left") - self.assertEqual(inst.locationQualifier[1].coding[0].code, "263929005") - self.assertEqual(inst.locationQualifier[1].coding[0].display, "Volar") - self.assertEqual(inst.locationQualifier[1].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.locationQualifier[1].text, "Volar") + self.assertEqual(inst.location.text, "Fetus") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.morphology.text, "Skin patch") self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/bundle.py b/fhirclient/models/bundle.py index 8cddee0c9..a789dca86 100644 --- a/fhirclient/models/bundle.py +++ b/fhirclient/models/bundle.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Bundle) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Bundle) on 2024-07-15. +# 2024, SMART Health IT. from . import resource diff --git a/fhirclient/models/bundle_tests.py b/fhirclient/models/bundle_tests.py index 2f262effb..fabfbd08f 100644 --- a/fhirclient/models/bundle_tests.py +++ b/fhirclient/models/bundle_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return bundle.Bundle(js) def testBundle1(self): - inst = self.instantiate_from("diagnosticreport-example-f202-bloodculture.json") + inst = self.instantiate_from("practitionerrole-examples-general.json") self.assertIsNotNone(inst, "Must have instantiated a Bundle instance") self.implBundle1(inst) @@ -32,11 +32,27 @@ def testBundle1(self): self.implBundle1(inst2) def implBundle1(self, inst): - self.assertEqual(inst.entry[0].fullUrl, "https://example.com/base/DiagnosticReport/f202") - self.assertEqual(inst.entry[0].resource.id, "f202") - self.assertEqual(inst.entry[1].fullUrl, "https://example.com/base/ServiceRequest/req") - self.assertEqual(inst.entry[1].resource.id, "req") - self.assertEqual(inst.id, "f202") + self.assertEqual(inst.entry[0].fullUrl, "http://hl7.org/fhir/PractitionerRole/f003-0") + self.assertEqual(inst.entry[0].resource.id, "f003-0") + self.assertEqual(inst.entry[1].fullUrl, "http://hl7.org/fhir/PractitionerRole/example-0") + self.assertEqual(inst.entry[1].resource.id, "example-0") + self.assertEqual(inst.entry[2].fullUrl, "http://hl7.org/fhir/PractitionerRole/example-1") + self.assertEqual(inst.entry[2].resource.id, "example-1") + self.assertEqual(inst.entry[3].fullUrl, "http://hl7.org/fhir/PractitionerRole/example-2") + self.assertEqual(inst.entry[3].resource.id, "example-2") + self.assertEqual(inst.entry[4].fullUrl, "http://hl7.org/fhir/PractitionerRole/f007-0") + self.assertEqual(inst.entry[4].resource.id, "f007-0") + self.assertEqual(inst.entry[5].fullUrl, "http://hl7.org/fhir/PractitionerRole/f004-0") + self.assertEqual(inst.entry[5].resource.id, "f004-0") + self.assertEqual(inst.entry[6].fullUrl, "http://hl7.org/fhir/PractitionerRole/xcda1-0") + self.assertEqual(inst.entry[6].resource.id, "xcda1-0") + self.assertEqual(inst.entry[7].fullUrl, "http://hl7.org/fhir/PractitionerRole/f202-0") + self.assertEqual(inst.entry[7].resource.id, "f202-0") + self.assertEqual(inst.entry[8].fullUrl, "http://hl7.org/fhir/PractitionerRole/f201-0") + self.assertEqual(inst.entry[8].resource.id, "f201-0") + self.assertEqual(inst.entry[9].fullUrl, "http://hl7.org/fhir/PractitionerRole/f203-0") + self.assertEqual(inst.entry[9].resource.id, "f203-0") + self.assertEqual(inst.id, "3ad0687e-f477-468c-afd5-fcc2bf897808") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") @@ -92,7 +108,7 @@ def implBundle2(self, inst): self.assertEqual(inst.type, "transaction") def testBundle3(self): - inst = self.instantiate_from("diagnosticreport-example-ghp.json") + inst = self.instantiate_from("diagnosticreport-example-f001-bloodexam.json") self.assertIsNotNone(inst, "Must have instantiated a Bundle instance") self.implBundle3(inst) @@ -102,36 +118,18 @@ def testBundle3(self): self.implBundle3(inst2) def implBundle3(self, inst): - self.assertEqual(inst.entry[0].fullUrl, "https://example.com/base/DiagnosticReport/ghp") - self.assertEqual(inst.entry[0].resource.id, "ghp") - self.assertEqual(inst.entry[0].resource.meta.lastUpdated.date, FHIRDate("2015-08-16T10:35:23Z").date) - self.assertEqual(inst.entry[0].resource.meta.lastUpdated.as_json(), "2015-08-16T10:35:23Z") - self.assertEqual(inst.entry[1].fullUrl, "https://example.com/base/Specimen/rtt") - self.assertEqual(inst.entry[1].resource.id, "rtt") - self.assertEqual(inst.entry[2].fullUrl, "https://example.com/base/Specimen/ltt") - self.assertEqual(inst.entry[2].resource.id, "ltt") - self.assertEqual(inst.entry[3].fullUrl, "https://example.com/base/Specimen/urine") - self.assertEqual(inst.entry[3].resource.id, "urine") - self.assertEqual(inst.entry[4].fullUrl, "https://example.com/base/Observation/p2") - self.assertEqual(inst.entry[4].resource.id, "p2") - self.assertEqual(inst.entry[5].fullUrl, "https://example.com/base/Observation/r1") - self.assertEqual(inst.entry[5].resource.id, "r1") - self.assertEqual(inst.entry[6].fullUrl, "https://example.com/base/Observation/r2") - self.assertEqual(inst.entry[6].resource.id, "r2") - self.assertEqual(inst.entry[7].fullUrl, "https://example.com/base/Observation/r3") - self.assertEqual(inst.entry[7].resource.id, "r3") - self.assertEqual(inst.entry[8].fullUrl, "https://example.com/base/Observation/r4") - self.assertEqual(inst.entry[8].resource.id, "r4") - self.assertEqual(inst.entry[9].fullUrl, "https://example.com/base/Observation/r5") - self.assertEqual(inst.entry[9].resource.id, "r5") - self.assertEqual(inst.id, "ghp") + self.assertEqual(inst.entry[0].fullUrl, "https://example.com/base/DiagnosticReport/f001") + self.assertEqual(inst.entry[0].resource.id, "f001") + self.assertEqual(inst.entry[1].fullUrl, "https://example.com/base/ServiceRequest/req") + self.assertEqual(inst.entry[1].resource.id, "req") + self.assertEqual(inst.id, "f001") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.type, "collection") def testBundle4(self): - inst = self.instantiate_from("practitioner-examples-general.json") + inst = self.instantiate_from("diagnosticreport-example-f202-bloodculture.json") self.assertIsNotNone(inst, "Must have instantiated a Bundle instance") self.implBundle4(inst) @@ -141,54 +139,18 @@ def testBundle4(self): self.implBundle4(inst2) def implBundle4(self, inst): - self.assertEqual(inst.entry[0].fullUrl, "http://hl7.org/fhir/Practitioner/1") - self.assertEqual(inst.entry[0].resource.id, "1") - self.assertEqual(inst.entry[1].fullUrl, "http://hl7.org/fhir/Practitioner/13") - self.assertEqual(inst.entry[1].resource.id, "13") - self.assertEqual(inst.entry[1].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) - self.assertEqual(inst.entry[1].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") - self.assertEqual(inst.entry[2].fullUrl, "http://hl7.org/fhir/Practitioner/14") - self.assertEqual(inst.entry[2].resource.id, "14") - self.assertEqual(inst.entry[2].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) - self.assertEqual(inst.entry[2].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") - self.assertEqual(inst.entry[3].fullUrl, "http://hl7.org/fhir/Practitioner/15") - self.assertEqual(inst.entry[3].resource.id, "15") - self.assertEqual(inst.entry[3].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) - self.assertEqual(inst.entry[3].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") - self.assertEqual(inst.entry[4].fullUrl, "http://hl7.org/fhir/Practitioner/16") - self.assertEqual(inst.entry[4].resource.id, "16") - self.assertEqual(inst.entry[4].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) - self.assertEqual(inst.entry[4].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") - self.assertEqual(inst.entry[5].fullUrl, "http://hl7.org/fhir/Practitioner/17") - self.assertEqual(inst.entry[5].resource.id, "17") - self.assertEqual(inst.entry[5].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) - self.assertEqual(inst.entry[5].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") - self.assertEqual(inst.entry[6].fullUrl, "http://hl7.org/fhir/Practitioner/18") - self.assertEqual(inst.entry[6].resource.id, "18") - self.assertEqual(inst.entry[6].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) - self.assertEqual(inst.entry[6].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") - self.assertEqual(inst.entry[7].fullUrl, "http://hl7.org/fhir/Practitioner/19") - self.assertEqual(inst.entry[7].resource.id, "19") - self.assertEqual(inst.entry[7].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) - self.assertEqual(inst.entry[7].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") - self.assertEqual(inst.entry[8].fullUrl, "http://hl7.org/fhir/Practitioner/20") - self.assertEqual(inst.entry[8].resource.id, "20") - self.assertEqual(inst.entry[8].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) - self.assertEqual(inst.entry[8].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") - self.assertEqual(inst.entry[9].fullUrl, "http://hl7.org/fhir/Practitioner/21") - self.assertEqual(inst.entry[9].resource.id, "21") - self.assertEqual(inst.entry[9].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) - self.assertEqual(inst.entry[9].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") - self.assertEqual(inst.id, "3ad0687e-f477-468c-afd5-fcc2bf897809") - self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) - self.assertEqual(inst.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") + self.assertEqual(inst.entry[0].fullUrl, "https://example.com/base/DiagnosticReport/f202") + self.assertEqual(inst.entry[0].resource.id, "f202") + self.assertEqual(inst.entry[1].fullUrl, "https://example.com/base/ServiceRequest/req") + self.assertEqual(inst.entry[1].resource.id, "req") + self.assertEqual(inst.id, "f202") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.type, "collection") def testBundle5(self): - inst = self.instantiate_from("diagnosticreport-example-lipids.json") + inst = self.instantiate_from("location-examples-general.json") self.assertIsNotNone(inst, "Must have instantiated a Bundle instance") self.implBundle5(inst) @@ -198,24 +160,18 @@ def testBundle5(self): self.implBundle5(inst2) def implBundle5(self, inst): - self.assertEqual(inst.entry[0].fullUrl, "https://example.com/base/DiagnosticReport/lipids") - self.assertEqual(inst.entry[0].resource.id, "lipids") - self.assertEqual(inst.entry[1].fullUrl, "https://example.com/base/Observation/cholesterol") - self.assertEqual(inst.entry[1].resource.id, "cholesterol") - self.assertEqual(inst.entry[2].fullUrl, "https://example.com/base/Observation/triglyceride") - self.assertEqual(inst.entry[2].resource.id, "triglyceride") - self.assertEqual(inst.entry[3].fullUrl, "https://example.com/base/Observation/hdlcholesterol") - self.assertEqual(inst.entry[3].resource.id, "hdlcholesterol") - self.assertEqual(inst.entry[4].fullUrl, "https://example.com/base/Observation/ldlcholesterol") - self.assertEqual(inst.entry[4].resource.id, "ldlcholesterol") - self.assertEqual(inst.id, "lipids") + self.assertEqual(inst.entry[0].fullUrl, "http://hl7.org/fhir/Location/2") + self.assertEqual(inst.entry[0].resource.id, "2") + self.assertEqual(inst.entry[1].fullUrl, "http://hl7.org/fhir/Location/3") + self.assertEqual(inst.entry[1].resource.id, "3") + self.assertEqual(inst.id, "3ad0687e-f477-468c-afd5-fcc2bf897819") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.type, "collection") def testBundle6(self): - inst = self.instantiate_from("diagnosticreport-hla-genetics-results-example.json") + inst = self.instantiate_from("questionnaire-profile-example-ussg-fht.json") self.assertIsNotNone(inst, "Must have instantiated a Bundle instance") self.implBundle6(inst) @@ -225,6 +181,73 @@ def testBundle6(self): self.implBundle6(inst2) def implBundle6(self, inst): + self.assertEqual(inst.entry[0].fullUrl, "http://hl7.org/fhir/us/sdc/Questionnaire/54127-6") + self.assertEqual(inst.entry[0].request.method, "PUT") + self.assertEqual(inst.entry[0].request.url, "http://hl7.org/fhir/us/sdc/Questionnaire/54127-6") + self.assertEqual(inst.entry[0].resource.id, "54127-6") + self.assertEqual(inst.entry[0].resource.meta.profile[0], "http://hl7.org/fhir/us/sdc/StructureDefinition/sdc-questionnaire") + self.assertEqual(inst.entry[1].fullUrl, "http://hl7.org/fhir/us/sdc/ValueSet/LL1-9") + self.assertEqual(inst.entry[1].request.method, "PUT") + self.assertEqual(inst.entry[1].request.url, "http://hl7.org/fhir/us/sdc/ValueSet/LL1-9") + self.assertEqual(inst.entry[1].resource.id, "LL1-9") + self.assertEqual(inst.entry[1].resource.meta.profile[0], "http://hl7.org/fhir/us/sdc/StructureDefinition/sdc-valueset") + self.assertEqual(inst.entry[2].fullUrl, "http://hl7.org/fhir/us/sdc/ValueSet/LL623-0") + self.assertEqual(inst.entry[2].request.method, "PUT") + self.assertEqual(inst.entry[2].request.url, "http://hl7.org/fhir/us/sdc/ValueSet/LL623-0") + self.assertEqual(inst.entry[2].resource.id, "LL623-0") + self.assertEqual(inst.entry[2].resource.meta.profile[0], "http://hl7.org/fhir/us/sdc/StructureDefinition/sdc-valueset") + self.assertEqual(inst.entry[3].fullUrl, "http://hl7.org/fhir/us/sdc/ValueSet/LL361-7") + self.assertEqual(inst.entry[3].request.method, "PUT") + self.assertEqual(inst.entry[3].request.url, "http://hl7.org/fhir/us/sdc/ValueSet/LL361-7") + self.assertEqual(inst.entry[3].resource.id, "LL361-7") + self.assertEqual(inst.entry[3].resource.meta.profile[0], "http://hl7.org/fhir/us/sdc/StructureDefinition/sdc-valueset") + self.assertEqual(inst.entry[4].fullUrl, "http://hl7.org/fhir/us/sdc/ValueSet/LL629-7") + self.assertEqual(inst.entry[4].request.method, "PUT") + self.assertEqual(inst.entry[4].request.url, "http://hl7.org/fhir/us/sdc/ValueSet/LL629-7") + self.assertEqual(inst.entry[4].resource.id, "LL629-7") + self.assertEqual(inst.entry[4].resource.meta.profile[0], "http://hl7.org/fhir/us/sdc/StructureDefinition/sdc-valueset") + self.assertEqual(inst.entry[5].fullUrl, "http://hl7.org/fhir/us/sdc/ValueSet/LL628-9") + self.assertEqual(inst.entry[5].request.method, "PUT") + self.assertEqual(inst.entry[5].request.url, "http://hl7.org/fhir/us/sdc/ValueSet/LL628-9") + self.assertEqual(inst.entry[5].resource.id, "LL628-9") + self.assertEqual(inst.entry[5].resource.meta.profile[0], "http://hl7.org/fhir/us/sdc/StructureDefinition/sdc-valueset") + self.assertEqual(inst.entry[6].fullUrl, "http://hl7.org/fhir/us/sdc/ValueSet/LL626-3") + self.assertEqual(inst.entry[6].request.method, "PUT") + self.assertEqual(inst.entry[6].request.url, "http://hl7.org/fhir/us/sdc/ValueSet/LL626-3") + self.assertEqual(inst.entry[6].resource.id, "LL626-3") + self.assertEqual(inst.entry[6].resource.meta.profile[0], "http://hl7.org/fhir/us/sdc/StructureDefinition/sdc-valueset") + self.assertEqual(inst.entry[7].fullUrl, "http://hl7.org/fhir/us/sdc/ValueSet/LL619-8") + self.assertEqual(inst.entry[7].request.method, "PUT") + self.assertEqual(inst.entry[7].request.url, "http://hl7.org/fhir/us/sdc/ValueSet/LL619-8") + self.assertEqual(inst.entry[7].resource.id, "LL619-8") + self.assertEqual(inst.entry[7].resource.meta.profile[0], "http://hl7.org/fhir/us/sdc/StructureDefinition/sdc-valueset") + self.assertEqual(inst.entry[8].fullUrl, "http://hl7.org/fhir/us/sdc/ValueSet/LL621-4") + self.assertEqual(inst.entry[8].request.method, "PUT") + self.assertEqual(inst.entry[8].request.url, "http://hl7.org/fhir/us/sdc/ValueSet/LL621-4") + self.assertEqual(inst.entry[8].resource.id, "LL621-4") + self.assertEqual(inst.entry[8].resource.meta.profile[0], "http://hl7.org/fhir/us/sdc/StructureDefinition/sdc-valueset") + self.assertEqual(inst.entry[9].fullUrl, "http://hl7.org/fhir/us/sdc/ValueSet/LL624-8") + self.assertEqual(inst.entry[9].request.method, "PUT") + self.assertEqual(inst.entry[9].request.url, "http://hl7.org/fhir/us/sdc/ValueSet/LL624-8") + self.assertEqual(inst.entry[9].resource.id, "LL624-8") + self.assertEqual(inst.entry[9].resource.meta.profile[0], "http://hl7.org/fhir/us/sdc/StructureDefinition/sdc-valueset") + self.assertEqual(inst.id, "ussg-fht") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.type, "transaction") + + def testBundle7(self): + inst = self.instantiate_from("diagnosticreport-hla-genetics-results-example.json") + self.assertIsNotNone(inst, "Must have instantiated a Bundle instance") + self.implBundle7(inst) + + js = inst.as_json() + self.assertEqual("Bundle", js["resourceType"]) + inst2 = bundle.Bundle(js) + self.implBundle7(inst2) + + def implBundle7(self, inst): self.assertEqual(inst.entry[0].fullUrl, "urn:uuid:b0a4b18e-94e7-4b1b-8031-c7ae4bdd8db9") self.assertEqual(inst.entry[0].request.method, "POST") self.assertEqual(inst.entry[0].request.url, "DiagnosticReport") @@ -261,45 +284,8 @@ def implBundle6(self, inst): self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.type, "transaction") - def testBundle7(self): - inst = self.instantiate_from("practitionerrole-examples-general.json") - self.assertIsNotNone(inst, "Must have instantiated a Bundle instance") - self.implBundle7(inst) - - js = inst.as_json() - self.assertEqual("Bundle", js["resourceType"]) - inst2 = bundle.Bundle(js) - self.implBundle7(inst2) - - def implBundle7(self, inst): - self.assertEqual(inst.entry[0].fullUrl, "http://hl7.org/fhir/PractitionerRole/f003-0") - self.assertEqual(inst.entry[0].resource.id, "f003-0") - self.assertEqual(inst.entry[1].fullUrl, "http://hl7.org/fhir/PractitionerRole/example-0") - self.assertEqual(inst.entry[1].resource.id, "example-0") - self.assertEqual(inst.entry[2].fullUrl, "http://hl7.org/fhir/PractitionerRole/example-1") - self.assertEqual(inst.entry[2].resource.id, "example-1") - self.assertEqual(inst.entry[3].fullUrl, "http://hl7.org/fhir/PractitionerRole/example-2") - self.assertEqual(inst.entry[3].resource.id, "example-2") - self.assertEqual(inst.entry[4].fullUrl, "http://hl7.org/fhir/PractitionerRole/f007-0") - self.assertEqual(inst.entry[4].resource.id, "f007-0") - self.assertEqual(inst.entry[5].fullUrl, "http://hl7.org/fhir/PractitionerRole/f004-0") - self.assertEqual(inst.entry[5].resource.id, "f004-0") - self.assertEqual(inst.entry[6].fullUrl, "http://hl7.org/fhir/PractitionerRole/xcda1-0") - self.assertEqual(inst.entry[6].resource.id, "xcda1-0") - self.assertEqual(inst.entry[7].fullUrl, "http://hl7.org/fhir/PractitionerRole/f202-0") - self.assertEqual(inst.entry[7].resource.id, "f202-0") - self.assertEqual(inst.entry[8].fullUrl, "http://hl7.org/fhir/PractitionerRole/f201-0") - self.assertEqual(inst.entry[8].resource.id, "f201-0") - self.assertEqual(inst.entry[9].fullUrl, "http://hl7.org/fhir/PractitionerRole/f203-0") - self.assertEqual(inst.entry[9].resource.id, "f203-0") - self.assertEqual(inst.id, "3ad0687e-f477-468c-afd5-fcc2bf897808") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.type, "collection") - def testBundle8(self): - inst = self.instantiate_from("diagnosticreport-example-f001-bloodexam.json") + inst = self.instantiate_from("bundle-example.json") self.assertIsNotNone(inst, "Must have instantiated a Bundle instance") self.implBundle8(inst) @@ -309,18 +295,28 @@ def testBundle8(self): self.implBundle8(inst2) def implBundle8(self, inst): - self.assertEqual(inst.entry[0].fullUrl, "https://example.com/base/DiagnosticReport/f001") - self.assertEqual(inst.entry[0].resource.id, "f001") - self.assertEqual(inst.entry[1].fullUrl, "https://example.com/base/ServiceRequest/req") - self.assertEqual(inst.entry[1].resource.id, "req") - self.assertEqual(inst.id, "f001") + self.assertEqual(inst.entry[0].fullUrl, "https://example.com/base/MedicationRequest/3123") + self.assertEqual(inst.entry[0].resource.id, "3123") + self.assertEqual(inst.entry[0].search.mode, "match") + self.assertEqual(inst.entry[0].search.score, 1) + self.assertEqual(inst.entry[1].fullUrl, "https://example.com/base/Medication/example") + self.assertEqual(inst.entry[1].resource.id, "example") + self.assertEqual(inst.entry[1].search.mode, "include") + self.assertEqual(inst.id, "bundle-example") + self.assertEqual(inst.link[0].relation, "self") + self.assertEqual(inst.link[0].url, "https://example.com/base/MedicationRequest?patient=347&_include=MedicationRequest.medication&_count=2") + self.assertEqual(inst.link[1].relation, "next") + self.assertEqual(inst.link[1].url, "https://example.com/base/MedicationRequest?patient=347&searchId=ff15fd40-ff71-4b48-b366-09c706bed9d0&page=2") + self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2014-08-18T01:43:30Z").date) + self.assertEqual(inst.meta.lastUpdated.as_json(), "2014-08-18T01:43:30Z") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.type, "collection") + self.assertEqual(inst.total, 3) + self.assertEqual(inst.type, "searchset") def testBundle9(self): - inst = self.instantiate_from("document-example-dischargesummary.json") + inst = self.instantiate_from("diagnosticreport-examples-general.json") self.assertIsNotNone(inst, "Must have instantiated a Bundle instance") self.implBundle9(inst) @@ -330,48 +326,36 @@ def testBundle9(self): self.implBundle9(inst2) def implBundle9(self, inst): - self.assertEqual(inst.entry[0].fullUrl, "http://fhir.healthintersections.com.au/open/Composition/180f219f-97a8-486d-99d9-ed631fe4fc57") - self.assertEqual(inst.entry[0].resource.id, "180f219f-97a8-486d-99d9-ed631fe4fc57") - self.assertEqual(inst.entry[0].resource.meta.lastUpdated.date, FHIRDate("2013-05-28T22:12:21Z").date) - self.assertEqual(inst.entry[0].resource.meta.lastUpdated.as_json(), "2013-05-28T22:12:21Z") - self.assertEqual(inst.entry[1].fullUrl, "http://fhir.healthintersections.com.au/open/Practitioner/example") - self.assertEqual(inst.entry[1].resource.id, "example") - self.assertEqual(inst.entry[1].resource.meta.lastUpdated.date, FHIRDate("2013-05-05T16:13:03Z").date) - self.assertEqual(inst.entry[1].resource.meta.lastUpdated.as_json(), "2013-05-05T16:13:03Z") - self.assertEqual(inst.entry[2].fullUrl, "http://fhir.healthintersections.com.au/open/Patient/d1") - self.assertEqual(inst.entry[2].resource.id, "d1") - self.assertEqual(inst.entry[3].fullUrl, "http://fhir.healthintersections.com.au/open/Encounter/doc-example") - self.assertEqual(inst.entry[3].resource.id, "doc-example") - self.assertEqual(inst.entry[3].resource.meta.lastUpdated.date, FHIRDate("2013-05-05T16:13:03Z").date) - self.assertEqual(inst.entry[3].resource.meta.lastUpdated.as_json(), "2013-05-05T16:13:03Z") - self.assertEqual(inst.entry[4].fullUrl, "urn:uuid:541a72a8-df75-4484-ac89-ac4923f03b81") - self.assertEqual(inst.entry[4].resource.meta.lastUpdated.date, FHIRDate("2013-05-05T16:13:03Z").date) - self.assertEqual(inst.entry[4].resource.meta.lastUpdated.as_json(), "2013-05-05T16:13:03Z") - self.assertEqual(inst.entry[5].fullUrl, "urn:uuid:124a6916-5d84-4b8c-b250-10cefb8e6e86") - self.assertEqual(inst.entry[5].resource.meta.lastUpdated.date, FHIRDate("2013-05-05T16:13:03Z").date) - self.assertEqual(inst.entry[5].resource.meta.lastUpdated.as_json(), "2013-05-05T16:13:03Z") - self.assertEqual(inst.entry[6].fullUrl, "urn:uuid:673f8db5-0ffd-4395-9657-6da00420bbc1") - self.assertEqual(inst.entry[7].fullUrl, "urn:uuid:47600e0f-b6b5-4308-84b5-5dec157f7637") - self.assertEqual(inst.entry[7].resource.meta.lastUpdated.date, FHIRDate("2013-05-05T16:13:03Z").date) - self.assertEqual(inst.entry[7].resource.meta.lastUpdated.as_json(), "2013-05-05T16:13:03Z") - self.assertEqual(inst.id, "father") - self.assertEqual(inst.identifier.system, "urn:ietf:rfc:3986") - self.assertEqual(inst.identifier.value, "urn:uuid:0c3151bd-1cbf-4d64-b04d-cd9187a4c6e0") - self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2013-05-28T22:12:21Z").date) - self.assertEqual(inst.meta.lastUpdated.as_json(), "2013-05-28T22:12:21Z") + self.assertEqual(inst.entry[0].fullUrl, "http://hl7.org/fhir/Bundle/3") + self.assertEqual(inst.entry[0].resource.id, "3") + self.assertEqual(inst.entry[1].fullUrl, "http://hl7.org/fhir/Bundle/4") + self.assertEqual(inst.entry[1].resource.id, "4") + self.assertEqual(inst.entry[2].fullUrl, "http://hl7.org/fhir/Bundle/5") + self.assertEqual(inst.entry[2].resource.id, "5") + self.assertEqual(inst.entry[3].fullUrl, "http://hl7.org/fhir/Bundle/6") + self.assertEqual(inst.entry[3].resource.id, "6") + self.assertEqual(inst.entry[4].fullUrl, "http://hl7.org/fhir/Bundle/7") + self.assertEqual(inst.entry[4].resource.id, "7") + self.assertEqual(inst.entry[5].fullUrl, "http://hl7.org/fhir/Bundle/8") + self.assertEqual(inst.entry[5].resource.id, "8") + self.assertEqual(inst.entry[6].fullUrl, "http://hl7.org/fhir/Bundle/9") + self.assertEqual(inst.entry[6].resource.id, "9") + self.assertEqual(inst.entry[7].fullUrl, "http://hl7.org/fhir/Bundle/15") + self.assertEqual(inst.entry[7].resource.id, "15") + self.assertEqual(inst.entry[8].fullUrl, "http://hl7.org/fhir/Bundle/16") + self.assertEqual(inst.entry[8].resource.id, "16") + self.assertEqual(inst.entry[9].fullUrl, "http://hl7.org/fhir/Bundle/17") + self.assertEqual(inst.entry[9].resource.id, "17") + self.assertEqual(inst.id, "72ac8493-52ac-41bd-8d5d-7258c289b5ea") + self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2012-04-14T10:35:23Z").date) + self.assertEqual(inst.meta.lastUpdated.as_json(), "2012-04-14T10:35:23Z") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.signature.sigFormat, "image/jpg") - self.assertEqual(inst.signature.type[0].code, "1.2.840.10065.1.12.1.1") - self.assertEqual(inst.signature.type[0].display, "Author's Signature") - self.assertEqual(inst.signature.type[0].system, "urn:iso-astm:E1762-95:2013") - self.assertEqual(inst.signature.when.date, FHIRDate("2015-08-31T07:42:33+10:00").date) - self.assertEqual(inst.signature.when.as_json(), "2015-08-31T07:42:33+10:00") - self.assertEqual(inst.type, "document") + self.assertEqual(inst.type, "collection") def testBundle10(self): - inst = self.instantiate_from("location-examples-general.json") + inst = self.instantiate_from("practitioner-examples-general.json") self.assertIsNotNone(inst, "Must have instantiated a Bundle instance") self.implBundle10(inst) @@ -381,11 +365,47 @@ def testBundle10(self): self.implBundle10(inst2) def implBundle10(self, inst): - self.assertEqual(inst.entry[0].fullUrl, "http://hl7.org/fhir/Location/2") - self.assertEqual(inst.entry[0].resource.id, "2") - self.assertEqual(inst.entry[1].fullUrl, "http://hl7.org/fhir/Location/3") - self.assertEqual(inst.entry[1].resource.id, "3") - self.assertEqual(inst.id, "3ad0687e-f477-468c-afd5-fcc2bf897819") + self.assertEqual(inst.entry[0].fullUrl, "http://hl7.org/fhir/Practitioner/1") + self.assertEqual(inst.entry[0].resource.id, "1") + self.assertEqual(inst.entry[1].fullUrl, "http://hl7.org/fhir/Practitioner/13") + self.assertEqual(inst.entry[1].resource.id, "13") + self.assertEqual(inst.entry[1].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) + self.assertEqual(inst.entry[1].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") + self.assertEqual(inst.entry[2].fullUrl, "http://hl7.org/fhir/Practitioner/14") + self.assertEqual(inst.entry[2].resource.id, "14") + self.assertEqual(inst.entry[2].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) + self.assertEqual(inst.entry[2].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") + self.assertEqual(inst.entry[3].fullUrl, "http://hl7.org/fhir/Practitioner/15") + self.assertEqual(inst.entry[3].resource.id, "15") + self.assertEqual(inst.entry[3].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) + self.assertEqual(inst.entry[3].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") + self.assertEqual(inst.entry[4].fullUrl, "http://hl7.org/fhir/Practitioner/16") + self.assertEqual(inst.entry[4].resource.id, "16") + self.assertEqual(inst.entry[4].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) + self.assertEqual(inst.entry[4].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") + self.assertEqual(inst.entry[5].fullUrl, "http://hl7.org/fhir/Practitioner/17") + self.assertEqual(inst.entry[5].resource.id, "17") + self.assertEqual(inst.entry[5].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) + self.assertEqual(inst.entry[5].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") + self.assertEqual(inst.entry[6].fullUrl, "http://hl7.org/fhir/Practitioner/18") + self.assertEqual(inst.entry[6].resource.id, "18") + self.assertEqual(inst.entry[6].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) + self.assertEqual(inst.entry[6].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") + self.assertEqual(inst.entry[7].fullUrl, "http://hl7.org/fhir/Practitioner/19") + self.assertEqual(inst.entry[7].resource.id, "19") + self.assertEqual(inst.entry[7].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) + self.assertEqual(inst.entry[7].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") + self.assertEqual(inst.entry[8].fullUrl, "http://hl7.org/fhir/Practitioner/20") + self.assertEqual(inst.entry[8].resource.id, "20") + self.assertEqual(inst.entry[8].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) + self.assertEqual(inst.entry[8].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") + self.assertEqual(inst.entry[9].fullUrl, "http://hl7.org/fhir/Practitioner/21") + self.assertEqual(inst.entry[9].resource.id, "21") + self.assertEqual(inst.entry[9].resource.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) + self.assertEqual(inst.entry[9].resource.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") + self.assertEqual(inst.id, "3ad0687e-f477-468c-afd5-fcc2bf897809") + self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) + self.assertEqual(inst.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") diff --git a/fhirclient/models/capabilitystatement.py b/fhirclient/models/capabilitystatement.py index 8d73c5496..2553484c1 100644 --- a/fhirclient/models/capabilitystatement.py +++ b/fhirclient/models/capabilitystatement.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/CapabilityStatement) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CapabilityStatement) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/capabilitystatement_tests.py b/fhirclient/models/capabilitystatement_tests.py index 4cfc329c0..06d3ca6c7 100644 --- a/fhirclient/models/capabilitystatement_tests.py +++ b/fhirclient/models/capabilitystatement_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -43,7 +43,7 @@ def implCapabilityStatement1(self, inst): self.assertEqual(inst.document[0].mode, "consumer") self.assertEqual(inst.document[0].profile, "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796") self.assertTrue(inst.experimental) - self.assertEqual(inst.fhirVersion, "4.0.0") + self.assertEqual(inst.fhirVersion, "4.0.1") self.assertEqual(inst.format[0], "xml") self.assertEqual(inst.format[1], "json") self.assertEqual(inst.id, "example") @@ -133,7 +133,7 @@ def implCapabilityStatement2(self, inst): self.assertEqual(inst.date.date, FHIRDate("2013-06-18").date) self.assertEqual(inst.date.as_json(), "2013-06-18") self.assertEqual(inst.description, "Prototype Capability Statement for September 2013 Connectathon") - self.assertEqual(inst.fhirVersion, "4.0.0") + self.assertEqual(inst.fhirVersion, "4.0.1") self.assertEqual(inst.format[0], "json") self.assertEqual(inst.format[1], "xml") self.assertEqual(inst.id, "phr") diff --git a/fhirclient/models/careplan.py b/fhirclient/models/careplan.py index a240d801d..c8718426d 100644 --- a/fhirclient/models/careplan.py +++ b/fhirclient/models/careplan.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/CarePlan) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CarePlan) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -102,8 +102,8 @@ def __init__(self, jsondict=None, strict=True): List of `FHIRReference` items (represented as `dict` in JSON). """ self.status = None - """ draft | active | suspended | completed | entered-in-error | - cancelled | unknown. + """ draft | active | on-hold | revoked | completed | entered-in-error | + unknown. Type `str`. """ self.subject = None @@ -251,7 +251,9 @@ def __init__(self, jsondict=None, strict=True): List of `str` items. """ self.kind = None - """ Kind of resource. + """ Appointment | CommunicationRequest | DeviceRequest | + MedicationRequest | NutritionOrder | Task | ServiceRequest | + VisionPrescription. Type `str`. """ self.location = None diff --git a/fhirclient/models/careplan_tests.py b/fhirclient/models/careplan_tests.py index 53e03c136..2b62e935c 100644 --- a/fhirclient/models/careplan_tests.py +++ b/fhirclient/models/careplan_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return careplan.CarePlan(js) def testCarePlan1(self): - inst = self.instantiate_from("careplan-example-f002-lung.json") + inst = self.instantiate_from("careplan-example-f203-sepsis.json") self.assertIsNotNone(inst, "Must have instantiated a CarePlan instance") self.implCarePlan1(inst) @@ -32,32 +32,28 @@ def testCarePlan1(self): self.implCarePlan1(inst2) def implCarePlan1(self, inst): - self.assertEqual(inst.activity[0].detail.code.coding[0].code, "359615001") - self.assertEqual(inst.activity[0].detail.code.coding[0].display, "Partial lobectomy of lung") + self.assertEqual(inst.activity[0].detail.code.coding[0].code, "241541005") + self.assertEqual(inst.activity[0].detail.code.coding[0].display, "High resolution computed tomography of lungs") self.assertEqual(inst.activity[0].detail.code.coding[0].system, "http://snomed.info/sct") - self.assertTrue(inst.activity[0].detail.doNotPerform) + self.assertFalse(inst.activity[0].detail.doNotPerform) self.assertEqual(inst.activity[0].detail.kind, "ServiceRequest") - self.assertEqual(inst.activity[0].detail.scheduledString, "2011-07-07T09:30:10+01:00") - self.assertEqual(inst.activity[0].detail.status, "completed") + self.assertEqual(inst.activity[0].detail.status, "not-started") self.assertEqual(inst.contained[0].id, "careteam") self.assertEqual(inst.contained[1].id, "goal") - self.assertEqual(inst.id, "f002") - self.assertEqual(inst.identifier[0].system, "http://www.bmc.nl/zorgportal/identifiers/careplans") - self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "CP2934") + self.assertEqual(inst.id, "f203") self.assertEqual(inst.intent, "plan") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.period.end.date, FHIRDate("2013-07-07").date) - self.assertEqual(inst.period.end.as_json(), "2013-07-07") - self.assertEqual(inst.period.start.date, FHIRDate("2011-07-06").date) - self.assertEqual(inst.period.start.as_json(), "2011-07-06") + self.assertEqual(inst.period.end.date, FHIRDate("2013-04-21").date) + self.assertEqual(inst.period.end.as_json(), "2013-04-21") + self.assertEqual(inst.period.start.date, FHIRDate("2013-04-14").date) + self.assertEqual(inst.period.start.as_json(), "2013-04-14") self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.status, "generated") def testCarePlan2(self): - inst = self.instantiate_from("careplan-example-f202-malignancy.json") + inst = self.instantiate_from("careplan-example-obesity-narrative.json") self.assertIsNotNone(inst, "Must have instantiated a CarePlan instance") self.implCarePlan2(inst) @@ -67,28 +63,16 @@ def testCarePlan2(self): self.implCarePlan2(inst2) def implCarePlan2(self, inst): - self.assertEqual(inst.activity[0].detail.code.coding[0].code, "367336001") - self.assertEqual(inst.activity[0].detail.code.coding[0].display, "Chemotherapy") - self.assertEqual(inst.activity[0].detail.code.coding[0].system, "http://snomed.info/sct") - self.assertFalse(inst.activity[0].detail.doNotPerform) - self.assertEqual(inst.activity[0].detail.kind, "ServiceRequest") - self.assertEqual(inst.activity[0].detail.status, "in-progress") - self.assertEqual(inst.contained[0].id, "doce") - self.assertEqual(inst.contained[1].id, "cisp") - self.assertEqual(inst.contained[2].id, "fluo") - self.assertEqual(inst.contained[3].id, "tpf") - self.assertEqual(inst.contained[4].id, "careteam") - self.assertEqual(inst.contained[5].id, "goal") - self.assertEqual(inst.id, "f202") + self.assertEqual(inst.id, "obesity-narrative") self.assertEqual(inst.intent, "plan") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.text.status, "additional") def testCarePlan3(self): - inst = self.instantiate_from("careplan-example-obesity-narrative.json") + inst = self.instantiate_from("careplan-example-GPVisit.json") self.assertIsNotNone(inst, "Must have instantiated a CarePlan instance") self.implCarePlan3(inst) @@ -98,110 +82,6 @@ def testCarePlan3(self): self.implCarePlan3(inst2) def implCarePlan3(self, inst): - self.assertEqual(inst.id, "obesity-narrative") - self.assertEqual(inst.intent, "plan") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "additional") - - def testCarePlan4(self): - inst = self.instantiate_from("careplan-example.json") - self.assertIsNotNone(inst, "Must have instantiated a CarePlan instance") - self.implCarePlan4(inst) - - js = inst.as_json() - self.assertEqual("CarePlan", js["resourceType"]) - inst2 = careplan.CarePlan(js) - self.implCarePlan4(inst2) - - def implCarePlan4(self, inst): - self.assertEqual(inst.activity[0].detail.code.coding[0].code, "3141-9") - self.assertEqual(inst.activity[0].detail.code.coding[0].display, "Weight Measured") - self.assertEqual(inst.activity[0].detail.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.activity[0].detail.code.coding[1].code, "27113001") - self.assertEqual(inst.activity[0].detail.code.coding[1].display, "Body weight") - self.assertEqual(inst.activity[0].detail.code.coding[1].system, "http://snomed.info/sct") - self.assertFalse(inst.activity[0].detail.doNotPerform) - self.assertEqual(inst.activity[0].detail.scheduledTiming.repeat.frequency, 1) - self.assertEqual(inst.activity[0].detail.scheduledTiming.repeat.period, 1) - self.assertEqual(inst.activity[0].detail.scheduledTiming.repeat.periodUnit, "d") - self.assertEqual(inst.activity[0].detail.status, "completed") - self.assertEqual(inst.activity[0].detail.statusReason.text, "Achieved weight loss to mitigate diabetes risk.") - self.assertEqual(inst.activity[0].outcomeCodeableConcept[0].coding[0].code, "161832001") - self.assertEqual(inst.activity[0].outcomeCodeableConcept[0].coding[0].display, "Progressive weight loss") - self.assertEqual(inst.activity[0].outcomeCodeableConcept[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.category[0].text, "Weight management plan") - self.assertEqual(inst.contained[0].id, "p1") - self.assertEqual(inst.created.date, FHIRDate("2016-01-01").date) - self.assertEqual(inst.created.as_json(), "2016-01-01") - self.assertEqual(inst.description, "Manage obesity and weight loss") - self.assertEqual(inst.id, "example") - self.assertEqual(inst.identifier[0].value, "12345") - self.assertEqual(inst.instantiatesUri[0], "http://example.org/protocol-for-obesity") - self.assertEqual(inst.intent, "plan") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.period.end.date, FHIRDate("2017-06-01").date) - self.assertEqual(inst.period.end.as_json(), "2017-06-01") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "additional") - - def testCarePlan5(self): - inst = self.instantiate_from("careplan-example-f201-renal.json") - self.assertIsNotNone(inst, "Must have instantiated a CarePlan instance") - self.implCarePlan5(inst) - - js = inst.as_json() - self.assertEqual("CarePlan", js["resourceType"]) - inst2 = careplan.CarePlan(js) - self.implCarePlan5(inst2) - - def implCarePlan5(self, inst): - self.assertEqual(inst.activity[0].detail.code.coding[0].code, "284093001") - self.assertEqual(inst.activity[0].detail.code.coding[0].display, "Potassium supplementation") - self.assertEqual(inst.activity[0].detail.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.activity[0].detail.dailyAmount.code, "258718000") - self.assertEqual(inst.activity[0].detail.dailyAmount.system, "http://snomed.info/sct") - self.assertEqual(inst.activity[0].detail.dailyAmount.unit, "mmol") - self.assertEqual(inst.activity[0].detail.dailyAmount.value, 80) - self.assertFalse(inst.activity[0].detail.doNotPerform) - self.assertEqual(inst.activity[0].detail.kind, "NutritionOrder") - self.assertEqual(inst.activity[0].detail.scheduledString, "daily") - self.assertEqual(inst.activity[0].detail.status, "completed") - self.assertEqual(inst.activity[1].detail.code.coding[0].code, "306005") - self.assertEqual(inst.activity[1].detail.code.coding[0].display, "Echography of kidney") - self.assertEqual(inst.activity[1].detail.code.coding[0].system, "http://snomed.info/sct") - self.assertFalse(inst.activity[1].detail.doNotPerform) - self.assertEqual(inst.activity[1].detail.kind, "ServiceRequest") - self.assertEqual(inst.activity[1].detail.status, "completed") - self.assertEqual(inst.contained[0].id, "careteam") - self.assertEqual(inst.contained[1].id, "goal") - self.assertEqual(inst.id, "f201") - self.assertEqual(inst.intent, "proposal") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.period.end.date, FHIRDate("2013-03-13").date) - self.assertEqual(inst.period.end.as_json(), "2013-03-13") - self.assertEqual(inst.period.start.date, FHIRDate("2013-03-11").date) - self.assertEqual(inst.period.start.as_json(), "2013-03-11") - self.assertEqual(inst.status, "draft") - self.assertEqual(inst.text.status, "generated") - - def testCarePlan6(self): - inst = self.instantiate_from("careplan-example-GPVisit.json") - self.assertIsNotNone(inst, "Must have instantiated a CarePlan instance") - self.implCarePlan6(inst) - - js = inst.as_json() - self.assertEqual("CarePlan", js["resourceType"]) - inst2 = careplan.CarePlan(js) - self.implCarePlan6(inst2) - - def implCarePlan6(self, inst): self.assertEqual(inst.activity[0].detail.code.coding[0].code, "nursecon") self.assertEqual(inst.activity[0].detail.code.coding[0].system, "http://example.org/local") self.assertEqual(inst.activity[0].detail.code.text, "Nurse Consultation") @@ -231,17 +111,52 @@ def implCarePlan6(self, inst): self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "additional") - def testCarePlan7(self): + def testCarePlan4(self): + inst = self.instantiate_from("careplan-example-f002-lung.json") + self.assertIsNotNone(inst, "Must have instantiated a CarePlan instance") + self.implCarePlan4(inst) + + js = inst.as_json() + self.assertEqual("CarePlan", js["resourceType"]) + inst2 = careplan.CarePlan(js) + self.implCarePlan4(inst2) + + def implCarePlan4(self, inst): + self.assertEqual(inst.activity[0].detail.code.coding[0].code, "359615001") + self.assertEqual(inst.activity[0].detail.code.coding[0].display, "Partial lobectomy of lung") + self.assertEqual(inst.activity[0].detail.code.coding[0].system, "http://snomed.info/sct") + self.assertTrue(inst.activity[0].detail.doNotPerform) + self.assertEqual(inst.activity[0].detail.kind, "ServiceRequest") + self.assertEqual(inst.activity[0].detail.scheduledString, "2011-07-07T09:30:10+01:00") + self.assertEqual(inst.activity[0].detail.status, "completed") + self.assertEqual(inst.contained[0].id, "careteam") + self.assertEqual(inst.contained[1].id, "goal") + self.assertEqual(inst.id, "f002") + self.assertEqual(inst.identifier[0].system, "http://www.bmc.nl/zorgportal/identifiers/careplans") + self.assertEqual(inst.identifier[0].use, "official") + self.assertEqual(inst.identifier[0].value, "CP2934") + self.assertEqual(inst.intent, "plan") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.period.end.date, FHIRDate("2013-07-07").date) + self.assertEqual(inst.period.end.as_json(), "2013-07-07") + self.assertEqual(inst.period.start.date, FHIRDate("2011-07-06").date) + self.assertEqual(inst.period.start.as_json(), "2011-07-06") + self.assertEqual(inst.status, "completed") + self.assertEqual(inst.text.status, "generated") + + def testCarePlan5(self): inst = self.instantiate_from("careplan-example-integrated.json") self.assertIsNotNone(inst, "Must have instantiated a CarePlan instance") - self.implCarePlan7(inst) + self.implCarePlan5(inst) js = inst.as_json() self.assertEqual("CarePlan", js["resourceType"]) inst2 = careplan.CarePlan(js) - self.implCarePlan7(inst2) + self.implCarePlan5(inst2) - def implCarePlan7(self, inst): + def implCarePlan5(self, inst): self.assertEqual(inst.activity[0].detail.description, "Eve will review photos of high and low density foods and share with her parents") self.assertFalse(inst.activity[0].detail.doNotPerform) self.assertEqual(inst.activity[0].detail.extension[0].url, "http://example.org/fhir/StructureDefinition/RevisionDate") @@ -373,6 +288,114 @@ def implCarePlan7(self, inst): self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") + def testCarePlan6(self): + inst = self.instantiate_from("careplan-example-pregnancy.json") + self.assertIsNotNone(inst, "Must have instantiated a CarePlan instance") + self.implCarePlan6(inst) + + js = inst.as_json() + self.assertEqual("CarePlan", js["resourceType"]) + inst2 = careplan.CarePlan(js) + self.implCarePlan6(inst2) + + def implCarePlan6(self, inst): + self.assertEqual(inst.activity[1].detail.code.coding[0].code, "1an") + self.assertEqual(inst.activity[1].detail.code.coding[0].system, "http://example.org/mySystem") + self.assertEqual(inst.activity[1].detail.code.text, "First Antenatal encounter") + self.assertEqual(inst.activity[1].detail.description, "The first antenatal encounter. This is where a detailed physical examination is performed. and the pregnanacy discussed with the mother-to-be.") + self.assertFalse(inst.activity[1].detail.doNotPerform) + self.assertEqual(inst.activity[1].detail.kind, "Appointment") + self.assertEqual(inst.activity[1].detail.scheduledTiming.repeat.boundsPeriod.end.date, FHIRDate("2013-02-28").date) + self.assertEqual(inst.activity[1].detail.scheduledTiming.repeat.boundsPeriod.end.as_json(), "2013-02-28") + self.assertEqual(inst.activity[1].detail.scheduledTiming.repeat.boundsPeriod.start.date, FHIRDate("2013-02-14").date) + self.assertEqual(inst.activity[1].detail.scheduledTiming.repeat.boundsPeriod.start.as_json(), "2013-02-14") + self.assertEqual(inst.activity[1].detail.status, "scheduled") + self.assertEqual(inst.activity[1].extension[0].url, "http://example.org/fhir/StructureDefinition/careplan#andetails") + self.assertEqual(inst.activity[1].extension[0].valueUri, "http://orionhealth.com/fhir/careplan/1andetails") + self.assertEqual(inst.activity[2].detail.code.coding[0].code, "an") + self.assertEqual(inst.activity[2].detail.code.coding[0].system, "http://example.org/mySystem") + self.assertEqual(inst.activity[2].detail.code.text, "Follow-up Antenatal encounter") + self.assertEqual(inst.activity[2].detail.description, "The second antenatal encounter. Discuss any issues that arose from the first antenatal encounter") + self.assertFalse(inst.activity[2].detail.doNotPerform) + self.assertEqual(inst.activity[2].detail.kind, "Appointment") + self.assertEqual(inst.activity[2].detail.scheduledTiming.repeat.boundsPeriod.end.date, FHIRDate("2013-03-14").date) + self.assertEqual(inst.activity[2].detail.scheduledTiming.repeat.boundsPeriod.end.as_json(), "2013-03-14") + self.assertEqual(inst.activity[2].detail.scheduledTiming.repeat.boundsPeriod.start.date, FHIRDate("2013-03-01").date) + self.assertEqual(inst.activity[2].detail.scheduledTiming.repeat.boundsPeriod.start.as_json(), "2013-03-01") + self.assertEqual(inst.activity[2].detail.status, "not-started") + self.assertEqual(inst.activity[3].detail.code.coding[0].code, "del") + self.assertEqual(inst.activity[3].detail.code.coding[0].system, "http://example.org/mySystem") + self.assertEqual(inst.activity[3].detail.code.text, "Delivery") + self.assertEqual(inst.activity[3].detail.description, "The delivery.") + self.assertFalse(inst.activity[3].detail.doNotPerform) + self.assertEqual(inst.activity[3].detail.kind, "Appointment") + self.assertEqual(inst.activity[3].detail.scheduledTiming.repeat.boundsPeriod.end.date, FHIRDate("2013-09-14").date) + self.assertEqual(inst.activity[3].detail.scheduledTiming.repeat.boundsPeriod.end.as_json(), "2013-09-14") + self.assertEqual(inst.activity[3].detail.scheduledTiming.repeat.boundsPeriod.start.date, FHIRDate("2013-09-01").date) + self.assertEqual(inst.activity[3].detail.scheduledTiming.repeat.boundsPeriod.start.as_json(), "2013-09-01") + self.assertEqual(inst.activity[3].detail.status, "not-started") + self.assertEqual(inst.contained[0].id, "p1") + self.assertEqual(inst.contained[1].id, "pr1") + self.assertEqual(inst.contained[2].id, "pr2") + self.assertEqual(inst.contained[3].id, "careteam") + self.assertEqual(inst.contained[4].id, "goal") + self.assertEqual(inst.extension[0].url, "http://example.org/fhir/StructureDefinition/careplan#lmp") + self.assertEqual(inst.extension[0].valueDateTime.date, FHIRDate("2013-01-01").date) + self.assertEqual(inst.extension[0].valueDateTime.as_json(), "2013-01-01") + self.assertEqual(inst.id, "preg") + self.assertEqual(inst.intent, "plan") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.period.end.date, FHIRDate("2013-10-01").date) + self.assertEqual(inst.period.end.as_json(), "2013-10-01") + self.assertEqual(inst.period.start.date, FHIRDate("2013-01-01").date) + self.assertEqual(inst.period.start.as_json(), "2013-01-01") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.status, "additional") + + def testCarePlan7(self): + inst = self.instantiate_from("careplan-example-f201-renal.json") + self.assertIsNotNone(inst, "Must have instantiated a CarePlan instance") + self.implCarePlan7(inst) + + js = inst.as_json() + self.assertEqual("CarePlan", js["resourceType"]) + inst2 = careplan.CarePlan(js) + self.implCarePlan7(inst2) + + def implCarePlan7(self, inst): + self.assertEqual(inst.activity[0].detail.code.coding[0].code, "284093001") + self.assertEqual(inst.activity[0].detail.code.coding[0].display, "Potassium supplementation") + self.assertEqual(inst.activity[0].detail.code.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.activity[0].detail.dailyAmount.code, "258718000") + self.assertEqual(inst.activity[0].detail.dailyAmount.system, "http://snomed.info/sct") + self.assertEqual(inst.activity[0].detail.dailyAmount.unit, "mmol") + self.assertEqual(inst.activity[0].detail.dailyAmount.value, 80) + self.assertFalse(inst.activity[0].detail.doNotPerform) + self.assertEqual(inst.activity[0].detail.kind, "NutritionOrder") + self.assertEqual(inst.activity[0].detail.scheduledString, "daily") + self.assertEqual(inst.activity[0].detail.status, "completed") + self.assertEqual(inst.activity[1].detail.code.coding[0].code, "306005") + self.assertEqual(inst.activity[1].detail.code.coding[0].display, "Echography of kidney") + self.assertEqual(inst.activity[1].detail.code.coding[0].system, "http://snomed.info/sct") + self.assertFalse(inst.activity[1].detail.doNotPerform) + self.assertEqual(inst.activity[1].detail.kind, "ServiceRequest") + self.assertEqual(inst.activity[1].detail.status, "completed") + self.assertEqual(inst.contained[0].id, "careteam") + self.assertEqual(inst.contained[1].id, "goal") + self.assertEqual(inst.id, "f201") + self.assertEqual(inst.intent, "proposal") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.period.end.date, FHIRDate("2013-03-13").date) + self.assertEqual(inst.period.end.as_json(), "2013-03-13") + self.assertEqual(inst.period.start.date, FHIRDate("2013-03-11").date) + self.assertEqual(inst.period.start.as_json(), "2013-03-11") + self.assertEqual(inst.status, "draft") + self.assertEqual(inst.text.status, "generated") + def testCarePlan8(self): inst = self.instantiate_from("careplan-example-f003-pharynx.json") self.assertIsNotNone(inst, "Must have instantiated a CarePlan instance") @@ -409,7 +432,7 @@ def implCarePlan8(self, inst): self.assertEqual(inst.text.status, "generated") def testCarePlan9(self): - inst = self.instantiate_from("careplan-example-f001-heart.json") + inst = self.instantiate_from("careplan-example.json") self.assertIsNotNone(inst, "Must have instantiated a CarePlan instance") self.implCarePlan9(inst) @@ -419,6 +442,49 @@ def testCarePlan9(self): self.implCarePlan9(inst2) def implCarePlan9(self, inst): + self.assertEqual(inst.activity[0].detail.code.coding[0].code, "3141-9") + self.assertEqual(inst.activity[0].detail.code.coding[0].display, "Weight Measured") + self.assertEqual(inst.activity[0].detail.code.coding[0].system, "http://loinc.org") + self.assertEqual(inst.activity[0].detail.code.coding[1].code, "27113001") + self.assertEqual(inst.activity[0].detail.code.coding[1].display, "Body weight") + self.assertEqual(inst.activity[0].detail.code.coding[1].system, "http://snomed.info/sct") + self.assertFalse(inst.activity[0].detail.doNotPerform) + self.assertEqual(inst.activity[0].detail.scheduledTiming.repeat.frequency, 1) + self.assertEqual(inst.activity[0].detail.scheduledTiming.repeat.period, 1) + self.assertEqual(inst.activity[0].detail.scheduledTiming.repeat.periodUnit, "d") + self.assertEqual(inst.activity[0].detail.status, "completed") + self.assertEqual(inst.activity[0].detail.statusReason.text, "Achieved weight loss to mitigate diabetes risk.") + self.assertEqual(inst.activity[0].outcomeCodeableConcept[0].coding[0].code, "161832001") + self.assertEqual(inst.activity[0].outcomeCodeableConcept[0].coding[0].display, "Progressive weight loss") + self.assertEqual(inst.activity[0].outcomeCodeableConcept[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.category[0].text, "Weight management plan") + self.assertEqual(inst.contained[0].id, "p1") + self.assertEqual(inst.created.date, FHIRDate("2016-01-01").date) + self.assertEqual(inst.created.as_json(), "2016-01-01") + self.assertEqual(inst.description, "Manage obesity and weight loss") + self.assertEqual(inst.id, "example") + self.assertEqual(inst.identifier[0].value, "12345") + self.assertEqual(inst.instantiatesUri[0], "http://example.org/protocol-for-obesity") + self.assertEqual(inst.intent, "plan") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.period.end.date, FHIRDate("2017-06-01").date) + self.assertEqual(inst.period.end.as_json(), "2017-06-01") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.status, "additional") + + def testCarePlan10(self): + inst = self.instantiate_from("careplan-example-f001-heart.json") + self.assertIsNotNone(inst, "Must have instantiated a CarePlan instance") + self.implCarePlan10(inst) + + js = inst.as_json() + self.assertEqual("CarePlan", js["resourceType"]) + inst2 = careplan.CarePlan(js) + self.implCarePlan10(inst2) + + def implCarePlan10(self, inst): self.assertEqual(inst.activity[0].detail.code.coding[0].code, "64915003") self.assertEqual(inst.activity[0].detail.code.coding[0].display, "Operation on heart") self.assertEqual(inst.activity[0].detail.code.coding[0].system, "http://snomed.info/sct") @@ -442,70 +508,4 @@ def implCarePlan9(self, inst): self.assertEqual(inst.period.start.as_json(), "2011-06-26") self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.status, "generated") - - def testCarePlan10(self): - inst = self.instantiate_from("careplan-example-pregnancy.json") - self.assertIsNotNone(inst, "Must have instantiated a CarePlan instance") - self.implCarePlan10(inst) - - js = inst.as_json() - self.assertEqual("CarePlan", js["resourceType"]) - inst2 = careplan.CarePlan(js) - self.implCarePlan10(inst2) - - def implCarePlan10(self, inst): - self.assertEqual(inst.activity[1].detail.code.coding[0].code, "1an") - self.assertEqual(inst.activity[1].detail.code.coding[0].system, "http://example.org/mySystem") - self.assertEqual(inst.activity[1].detail.code.text, "First Antenatal encounter") - self.assertEqual(inst.activity[1].detail.description, "The first antenatal encounter. This is where a detailed physical examination is performed. and the pregnanacy discussed with the mother-to-be.") - self.assertFalse(inst.activity[1].detail.doNotPerform) - self.assertEqual(inst.activity[1].detail.kind, "Appointment") - self.assertEqual(inst.activity[1].detail.scheduledTiming.repeat.boundsPeriod.end.date, FHIRDate("2013-02-28").date) - self.assertEqual(inst.activity[1].detail.scheduledTiming.repeat.boundsPeriod.end.as_json(), "2013-02-28") - self.assertEqual(inst.activity[1].detail.scheduledTiming.repeat.boundsPeriod.start.date, FHIRDate("2013-02-14").date) - self.assertEqual(inst.activity[1].detail.scheduledTiming.repeat.boundsPeriod.start.as_json(), "2013-02-14") - self.assertEqual(inst.activity[1].detail.status, "scheduled") - self.assertEqual(inst.activity[1].extension[0].url, "http://example.org/fhir/StructureDefinition/careplan#andetails") - self.assertEqual(inst.activity[1].extension[0].valueUri, "http://orionhealth.com/fhir/careplan/1andetails") - self.assertEqual(inst.activity[2].detail.code.coding[0].code, "an") - self.assertEqual(inst.activity[2].detail.code.coding[0].system, "http://example.org/mySystem") - self.assertEqual(inst.activity[2].detail.code.text, "Follow-up Antenatal encounter") - self.assertEqual(inst.activity[2].detail.description, "The second antenatal encounter. Discuss any issues that arose from the first antenatal encounter") - self.assertFalse(inst.activity[2].detail.doNotPerform) - self.assertEqual(inst.activity[2].detail.kind, "Appointment") - self.assertEqual(inst.activity[2].detail.scheduledTiming.repeat.boundsPeriod.end.date, FHIRDate("2013-03-14").date) - self.assertEqual(inst.activity[2].detail.scheduledTiming.repeat.boundsPeriod.end.as_json(), "2013-03-14") - self.assertEqual(inst.activity[2].detail.scheduledTiming.repeat.boundsPeriod.start.date, FHIRDate("2013-03-01").date) - self.assertEqual(inst.activity[2].detail.scheduledTiming.repeat.boundsPeriod.start.as_json(), "2013-03-01") - self.assertEqual(inst.activity[2].detail.status, "not-started") - self.assertEqual(inst.activity[3].detail.code.coding[0].code, "del") - self.assertEqual(inst.activity[3].detail.code.coding[0].system, "http://example.org/mySystem") - self.assertEqual(inst.activity[3].detail.code.text, "Delivery") - self.assertEqual(inst.activity[3].detail.description, "The delivery.") - self.assertFalse(inst.activity[3].detail.doNotPerform) - self.assertEqual(inst.activity[3].detail.kind, "Appointment") - self.assertEqual(inst.activity[3].detail.scheduledTiming.repeat.boundsPeriod.end.date, FHIRDate("2013-09-14").date) - self.assertEqual(inst.activity[3].detail.scheduledTiming.repeat.boundsPeriod.end.as_json(), "2013-09-14") - self.assertEqual(inst.activity[3].detail.scheduledTiming.repeat.boundsPeriod.start.date, FHIRDate("2013-09-01").date) - self.assertEqual(inst.activity[3].detail.scheduledTiming.repeat.boundsPeriod.start.as_json(), "2013-09-01") - self.assertEqual(inst.activity[3].detail.status, "not-started") - self.assertEqual(inst.contained[0].id, "p1") - self.assertEqual(inst.contained[1].id, "pr1") - self.assertEqual(inst.contained[2].id, "pr2") - self.assertEqual(inst.contained[3].id, "careteam") - self.assertEqual(inst.contained[4].id, "goal") - self.assertEqual(inst.extension[0].url, "http://example.org/fhir/StructureDefinition/careplan#lmp") - self.assertEqual(inst.extension[0].valueDateTime.date, FHIRDate("2013-01-01").date) - self.assertEqual(inst.extension[0].valueDateTime.as_json(), "2013-01-01") - self.assertEqual(inst.id, "preg") - self.assertEqual(inst.intent, "plan") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.period.end.date, FHIRDate("2013-10-01").date) - self.assertEqual(inst.period.end.as_json(), "2013-10-01") - self.assertEqual(inst.period.start.date, FHIRDate("2013-01-01").date) - self.assertEqual(inst.period.start.as_json(), "2013-01-01") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "additional") diff --git a/fhirclient/models/careteam.py b/fhirclient/models/careteam.py index 43bb8b9a4..985be2a5f 100644 --- a/fhirclient/models/careteam.py +++ b/fhirclient/models/careteam.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/CareTeam) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CareTeam) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/careteam_tests.py b/fhirclient/models/careteam_tests.py index 7a1aa33d2..8ef33017c 100644 --- a/fhirclient/models/careteam_tests.py +++ b/fhirclient/models/careteam_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/catalogentry.py b/fhirclient/models/catalogentry.py index 78e7d56bd..1cb529469 100644 --- a/fhirclient/models/catalogentry.py +++ b/fhirclient/models/catalogentry.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/CatalogEntry) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CatalogEntry) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/catalogentry_tests.py b/fhirclient/models/catalogentry_tests.py index dc949504f..b3e13c223 100644 --- a/fhirclient/models/catalogentry_tests.py +++ b/fhirclient/models/catalogentry_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/chargeitem.py b/fhirclient/models/chargeitem.py index 0c0181b65..25ba48f37 100644 --- a/fhirclient/models/chargeitem.py +++ b/fhirclient/models/chargeitem.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ChargeItem) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ChargeItem) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/chargeitem_tests.py b/fhirclient/models/chargeitem_tests.py index d9c794fc3..c9b5ee1f2 100644 --- a/fhirclient/models/chargeitem_tests.py +++ b/fhirclient/models/chargeitem_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/chargeitemdefinition.py b/fhirclient/models/chargeitemdefinition.py index 9385db328..a7361c2d9 100644 --- a/fhirclient/models/chargeitemdefinition.py +++ b/fhirclient/models/chargeitemdefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/chargeitemdefinition_tests.py b/fhirclient/models/chargeitemdefinition_tests.py index 79ef9a423..ab0da228f 100644 --- a/fhirclient/models/chargeitemdefinition_tests.py +++ b/fhirclient/models/chargeitemdefinition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return chargeitemdefinition.ChargeItemDefinition(js) def testChargeItemDefinition1(self): - inst = self.instantiate_from("chargeitemdefinition-device-example.json") + inst = self.instantiate_from("chargeitemdefinition-ebm-example.json") self.assertIsNotNone(inst, "Must have instantiated a ChargeItemDefinition instance") self.implChargeItemDefinition1(inst) @@ -32,48 +32,6 @@ def testChargeItemDefinition1(self): self.implChargeItemDefinition1(inst2) def implChargeItemDefinition1(self, inst): - self.assertEqual(inst.applicability[0].description, "Verify ChargeItem pertains to Device 12345") - self.assertEqual(inst.applicability[0].expression, "%context.service.suppliedItem='Device/12345'") - self.assertEqual(inst.applicability[0].language, "text/fhirpath") - self.assertEqual(inst.description, "Financial details for custom made device") - self.assertEqual(inst.id, "device") - self.assertEqual(inst.propertyGroup[0].priceComponent[0].amount.currency, "EUR") - self.assertEqual(inst.propertyGroup[0].priceComponent[0].amount.value, 67.44) - self.assertEqual(inst.propertyGroup[0].priceComponent[0].code.coding[0].code, "VK") - self.assertEqual(inst.propertyGroup[0].priceComponent[0].code.coding[0].display, "Verkaufspreis (netto)") - self.assertEqual(inst.propertyGroup[0].priceComponent[0].code.coding[0].system, "http://fhir.de/CodeSystem/billing-attributes") - self.assertEqual(inst.propertyGroup[0].priceComponent[0].type, "base") - self.assertEqual(inst.propertyGroup[1].applicability[0].description, "Gültigkeit Steuersatz") - self.assertEqual(inst.propertyGroup[1].applicability[0].expression, "%context.occurenceDateTime > '2018-04-01'") - self.assertEqual(inst.propertyGroup[1].applicability[0].language, "text/fhirpath") - self.assertEqual(inst.propertyGroup[1].priceComponent[0].code.coding[0].code, "MWST") - self.assertEqual(inst.propertyGroup[1].priceComponent[0].code.coding[0].display, "Mehrwersteuersatz") - self.assertEqual(inst.propertyGroup[1].priceComponent[0].code.coding[0].system, "http://fhir.de/CodeSystem/billing-attributes") - self.assertEqual(inst.propertyGroup[1].priceComponent[0].factor, 1.19) - self.assertEqual(inst.propertyGroup[1].priceComponent[0].type, "tax") - self.assertEqual(inst.propertyGroup[2].applicability[0].description, "Gültigkeit Steuersatz") - self.assertEqual(inst.propertyGroup[2].applicability[0].expression, "%context.occurenceDateTime <= '2018-04-01'") - self.assertEqual(inst.propertyGroup[2].applicability[0].language, "text/fhirpath") - self.assertEqual(inst.propertyGroup[2].priceComponent[0].code.coding[0].code, "MWST") - self.assertEqual(inst.propertyGroup[2].priceComponent[0].code.coding[0].display, "Mehrwersteuersatz") - self.assertEqual(inst.propertyGroup[2].priceComponent[0].code.coding[0].system, "http://fhir.de/CodeSystem/billing-attributes") - self.assertEqual(inst.propertyGroup[2].priceComponent[0].factor, 1.07) - self.assertEqual(inst.propertyGroup[2].priceComponent[0].type, "tax") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.url, "http://sap.org/ChargeItemDefinition/device-123") - - def testChargeItemDefinition2(self): - inst = self.instantiate_from("chargeitemdefinition-ebm-example.json") - self.assertIsNotNone(inst, "Must have instantiated a ChargeItemDefinition instance") - self.implChargeItemDefinition2(inst) - - js = inst.as_json() - self.assertEqual("ChargeItemDefinition", js["resourceType"]) - inst2 = chargeitemdefinition.ChargeItemDefinition(js) - self.implChargeItemDefinition2(inst2) - - def implChargeItemDefinition2(self, inst): self.assertEqual(inst.applicability[0].description, "Excludes billing code 13250 for same Encounter") self.assertEqual(inst.applicability[0].expression, "[some CQL expression]") self.assertEqual(inst.applicability[0].language, "text/cql") @@ -104,4 +62,46 @@ def implChargeItemDefinition2(self, inst): self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.url, "http://fhir.de/ChargeItemDefinition/kbv/ebm-30110") self.assertEqual(inst.version, "2-2018") + + def testChargeItemDefinition2(self): + inst = self.instantiate_from("chargeitemdefinition-device-example.json") + self.assertIsNotNone(inst, "Must have instantiated a ChargeItemDefinition instance") + self.implChargeItemDefinition2(inst) + + js = inst.as_json() + self.assertEqual("ChargeItemDefinition", js["resourceType"]) + inst2 = chargeitemdefinition.ChargeItemDefinition(js) + self.implChargeItemDefinition2(inst2) + + def implChargeItemDefinition2(self, inst): + self.assertEqual(inst.applicability[0].description, "Verify ChargeItem pertains to Device 12345") + self.assertEqual(inst.applicability[0].expression, "%context.service.suppliedItem='Device/12345'") + self.assertEqual(inst.applicability[0].language, "text/fhirpath") + self.assertEqual(inst.description, "Financial details for custom made device") + self.assertEqual(inst.id, "device") + self.assertEqual(inst.propertyGroup[0].priceComponent[0].amount.currency, "EUR") + self.assertEqual(inst.propertyGroup[0].priceComponent[0].amount.value, 67.44) + self.assertEqual(inst.propertyGroup[0].priceComponent[0].code.coding[0].code, "VK") + self.assertEqual(inst.propertyGroup[0].priceComponent[0].code.coding[0].display, "Verkaufspreis (netto)") + self.assertEqual(inst.propertyGroup[0].priceComponent[0].code.coding[0].system, "http://fhir.de/CodeSystem/billing-attributes") + self.assertEqual(inst.propertyGroup[0].priceComponent[0].type, "base") + self.assertEqual(inst.propertyGroup[1].applicability[0].description, "Gültigkeit Steuersatz") + self.assertEqual(inst.propertyGroup[1].applicability[0].expression, "%context.occurenceDateTime > '2018-04-01'") + self.assertEqual(inst.propertyGroup[1].applicability[0].language, "text/fhirpath") + self.assertEqual(inst.propertyGroup[1].priceComponent[0].code.coding[0].code, "MWST") + self.assertEqual(inst.propertyGroup[1].priceComponent[0].code.coding[0].display, "Mehrwersteuersatz") + self.assertEqual(inst.propertyGroup[1].priceComponent[0].code.coding[0].system, "http://fhir.de/CodeSystem/billing-attributes") + self.assertEqual(inst.propertyGroup[1].priceComponent[0].factor, 1.19) + self.assertEqual(inst.propertyGroup[1].priceComponent[0].type, "tax") + self.assertEqual(inst.propertyGroup[2].applicability[0].description, "Gültigkeit Steuersatz") + self.assertEqual(inst.propertyGroup[2].applicability[0].expression, "%context.occurenceDateTime <= '2018-04-01'") + self.assertEqual(inst.propertyGroup[2].applicability[0].language, "text/fhirpath") + self.assertEqual(inst.propertyGroup[2].priceComponent[0].code.coding[0].code, "MWST") + self.assertEqual(inst.propertyGroup[2].priceComponent[0].code.coding[0].display, "Mehrwersteuersatz") + self.assertEqual(inst.propertyGroup[2].priceComponent[0].code.coding[0].system, "http://fhir.de/CodeSystem/billing-attributes") + self.assertEqual(inst.propertyGroup[2].priceComponent[0].factor, 1.07) + self.assertEqual(inst.propertyGroup[2].priceComponent[0].type, "tax") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.url, "http://sap.org/ChargeItemDefinition/device-123") diff --git a/fhirclient/models/claim.py b/fhirclient/models/claim.py index 8746641ee..592f0b0f0 100644 --- a/fhirclient/models/claim.py +++ b/fhirclient/models/claim.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Claim) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Claim) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/claim_tests.py b/fhirclient/models/claim_tests.py index 7fe79f78c..730d8c2ca 100644 --- a/fhirclient/models/claim_tests.py +++ b/fhirclient/models/claim_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return claim.Claim(js) def testClaim1(self): - inst = self.instantiate_from("claim-example-institutional-rich.json") + inst = self.instantiate_from("claim-example-professional.json") self.assertIsNotNone(inst, "Must have instantiated a Claim instance") self.implClaim1(inst) @@ -32,78 +32,40 @@ def testClaim1(self): self.implClaim1(inst2) def implClaim1(self, inst): - self.assertEqual(inst.accident.date.date, FHIRDate("2014-07-09").date) - self.assertEqual(inst.accident.date.as_json(), "2014-07-09") - self.assertEqual(inst.accident.locationAddress.text, "Grouse Mountain Ski Hill") - self.assertEqual(inst.accident.type.coding[0].code, "SPT") - self.assertEqual(inst.accident.type.coding[0].display, "Sporting Accident") - self.assertEqual(inst.accident.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActIncidentCode") - self.assertEqual(inst.billablePeriod.end.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.billablePeriod.end.as_json(), "2014-08-16") - self.assertEqual(inst.billablePeriod.start.date, FHIRDate("2014-08-15").date) - self.assertEqual(inst.billablePeriod.start.as_json(), "2014-08-15") - self.assertEqual(inst.careTeam[0].qualification.coding[0].code, "physician") - self.assertEqual(inst.careTeam[0].qualification.coding[0].system, "http://example.org/fhir/CodeSystem/provider-qualification") - self.assertTrue(inst.careTeam[0].responsible) - self.assertEqual(inst.careTeam[0].role.coding[0].code, "primary") - self.assertEqual(inst.careTeam[0].role.coding[0].system, "http://example.org/fhir/CodeSystem/claim-careteamrole") self.assertEqual(inst.careTeam[0].sequence, 1) self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) self.assertEqual(inst.created.as_json(), "2014-08-16") self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code, "654456") - self.assertEqual(inst.diagnosis[0].packageCode.coding[0].code, "400") - self.assertEqual(inst.diagnosis[0].packageCode.coding[0].display, "Head trauma - concussion") - self.assertEqual(inst.diagnosis[0].packageCode.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-diagnosisrelatedgroup") self.assertEqual(inst.diagnosis[0].sequence, 1) - self.assertEqual(inst.diagnosis[0].type[0].coding[0].code, "admitting") - self.assertEqual(inst.diagnosis[0].type[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-diagnosistype") - self.assertEqual(inst.id, "960151") - self.assertEqual(inst.identifier[0].system, "http://happyhospital.com/claim") - self.assertEqual(inst.identifier[0].value, "96123451") - self.assertEqual(inst.insurance[0].businessArrangement, "BA987123") + self.assertEqual(inst.id, "860150") + self.assertEqual(inst.identifier[0].system, "http://happypdocs.com/claim") + self.assertEqual(inst.identifier[0].value, "8612345") self.assertTrue(inst.insurance[0].focal) - self.assertEqual(inst.insurance[0].preAuthRef[0], "PA2014G56473") self.assertEqual(inst.insurance[0].sequence, 1) self.assertEqual(inst.item[0].careTeamSequence[0], 1) self.assertEqual(inst.item[0].net.currency, "USD") - self.assertEqual(inst.item[0].net.value, 125.0) + self.assertEqual(inst.item[0].net.value, 75.0) self.assertEqual(inst.item[0].productOrService.coding[0].code, "exam") self.assertEqual(inst.item[0].productOrService.coding[0].system, "http://hl7.org/fhir/ex-serviceproduct") self.assertEqual(inst.item[0].sequence, 1) self.assertEqual(inst.item[0].servicedDate.date, FHIRDate("2014-08-16").date) self.assertEqual(inst.item[0].servicedDate.as_json(), "2014-08-16") self.assertEqual(inst.item[0].unitPrice.currency, "USD") - self.assertEqual(inst.item[0].unitPrice.value, 125.0) + self.assertEqual(inst.item[0].unitPrice.value, 75.0) self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.payee.type.coding[0].code, "provider") self.assertEqual(inst.priority.coding[0].code, "normal") self.assertEqual(inst.status, "active") - self.assertEqual(inst.supportingInfo[0].category.coding[0].code, "employmentimpacted") - self.assertEqual(inst.supportingInfo[0].category.coding[0].system, "http://terminology.hl7.org/CodeSystem/claiminformationcategory") - self.assertEqual(inst.supportingInfo[0].sequence, 1) - self.assertEqual(inst.supportingInfo[0].timingPeriod.end.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.supportingInfo[0].timingPeriod.end.as_json(), "2014-08-16") - self.assertEqual(inst.supportingInfo[0].timingPeriod.start.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.supportingInfo[0].timingPeriod.start.as_json(), "2014-08-16") - self.assertEqual(inst.supportingInfo[1].category.coding[0].code, "hospitalized") - self.assertEqual(inst.supportingInfo[1].category.coding[0].system, "http://terminology.hl7.org/CodeSystem/claiminformationcategory") - self.assertEqual(inst.supportingInfo[1].sequence, 2) - self.assertEqual(inst.supportingInfo[1].timingPeriod.end.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.supportingInfo[1].timingPeriod.end.as_json(), "2014-08-16") - self.assertEqual(inst.supportingInfo[1].timingPeriod.start.date, FHIRDate("2014-08-15").date) - self.assertEqual(inst.supportingInfo[1].timingPeriod.start.as_json(), "2014-08-15") self.assertEqual(inst.text.div, "
A human-readable rendering of the Claim
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.total.currency, "USD") - self.assertEqual(inst.total.value, 125.0) - self.assertEqual(inst.type.coding[0].code, "institutional") + self.assertEqual(inst.type.coding[0].code, "professional") self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") self.assertEqual(inst.use, "claim") def testClaim2(self): - inst = self.instantiate_from("claim-example-professional.json") + inst = self.instantiate_from("claim-example-pharmacy-medication.json") self.assertIsNotNone(inst, "Must have instantiated a Claim instance") self.implClaim2(inst) @@ -118,35 +80,72 @@ def implClaim2(self, inst): self.assertEqual(inst.created.as_json(), "2014-08-16") self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code, "654456") self.assertEqual(inst.diagnosis[0].sequence, 1) - self.assertEqual(inst.id, "860150") - self.assertEqual(inst.identifier[0].system, "http://happypdocs.com/claim") - self.assertEqual(inst.identifier[0].value, "8612345") + self.assertEqual(inst.id, "760151") + self.assertEqual(inst.identifier[0].system, "http://happypharma.com/claim") + self.assertEqual(inst.identifier[0].value, "7612345") self.assertTrue(inst.insurance[0].focal) self.assertEqual(inst.insurance[0].sequence, 1) self.assertEqual(inst.item[0].careTeamSequence[0], 1) + self.assertEqual(inst.item[0].detail[0].net.currency, "USD") + self.assertEqual(inst.item[0].detail[0].net.value, 45.0) + self.assertEqual(inst.item[0].detail[0].productOrService.coding[0].code, "drugcost") + self.assertEqual(inst.item[0].detail[0].productOrService.coding[0].system, "http://hl7.org/fhir/ex-pharmaservice") + self.assertEqual(inst.item[0].detail[0].sequence, 1) + self.assertEqual(inst.item[0].detail[1].net.currency, "USD") + self.assertEqual(inst.item[0].detail[1].net.value, 9.0) + self.assertEqual(inst.item[0].detail[1].productOrService.coding[0].code, "markup") + self.assertEqual(inst.item[0].detail[1].productOrService.coding[0].system, "http://hl7.org/fhir/ex-pharmaservice") + self.assertEqual(inst.item[0].detail[1].sequence, 2) + self.assertEqual(inst.item[0].detail[2].net.currency, "USD") + self.assertEqual(inst.item[0].detail[2].net.value, 36.0) + self.assertEqual(inst.item[0].detail[2].productOrService.coding[0].code, "dispensefee") + self.assertEqual(inst.item[0].detail[2].productOrService.coding[0].system, "http://hl7.org/fhir/ex-pharmaservice") + self.assertEqual(inst.item[0].detail[2].sequence, 3) + self.assertEqual(inst.item[0].informationSequence[0], 1) + self.assertEqual(inst.item[0].informationSequence[1], 2) + self.assertEqual(inst.item[0].informationSequence[2], 3) self.assertEqual(inst.item[0].net.currency, "USD") - self.assertEqual(inst.item[0].net.value, 75.0) - self.assertEqual(inst.item[0].productOrService.coding[0].code, "exam") - self.assertEqual(inst.item[0].productOrService.coding[0].system, "http://hl7.org/fhir/ex-serviceproduct") + self.assertEqual(inst.item[0].net.value, 90.0) + self.assertEqual(inst.item[0].productOrService.coding[0].code, "562721") + self.assertEqual(inst.item[0].productOrService.coding[0].display, "Alprazolam 0.25mg (Xanax)") + self.assertEqual(inst.item[0].productOrService.coding[0].system, "http://www.nlm.nih.gov/research/umls/rxnorm") + self.assertEqual(inst.item[0].quantity.code, "TAB") + self.assertEqual(inst.item[0].quantity.system, "http://unitsofmeasure.org") + self.assertEqual(inst.item[0].quantity.unit, "TAB") + self.assertEqual(inst.item[0].quantity.value, 90) self.assertEqual(inst.item[0].sequence, 1) self.assertEqual(inst.item[0].servicedDate.date, FHIRDate("2014-08-16").date) self.assertEqual(inst.item[0].servicedDate.as_json(), "2014-08-16") - self.assertEqual(inst.item[0].unitPrice.currency, "USD") - self.assertEqual(inst.item[0].unitPrice.value, 75.0) self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.payee.type.coding[0].code, "provider") - self.assertEqual(inst.priority.coding[0].code, "normal") + self.assertEqual(inst.priority.coding[0].code, "stat") self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.div, "
A human-readable rendering of the Claim
") + self.assertEqual(inst.supportingInfo[0].category.coding[0].code, "pharmacyrefill") + self.assertEqual(inst.supportingInfo[0].code.coding[0].code, "new") + self.assertEqual(inst.supportingInfo[0].code.coding[0].system, "http://example.org/fhir/CodeSystem/pharmacy-refill") + self.assertEqual(inst.supportingInfo[0].sequence, 1) + self.assertEqual(inst.supportingInfo[1].category.coding[0].code, "pharmacyinformation") + self.assertEqual(inst.supportingInfo[1].code.coding[0].code, "refillsremaining") + self.assertEqual(inst.supportingInfo[1].code.coding[0].system, "http://example.org/fhir/CodeSystem/pharmacy-information") + self.assertEqual(inst.supportingInfo[1].sequence, 2) + self.assertEqual(inst.supportingInfo[1].valueQuantity.value, 2) + self.assertEqual(inst.supportingInfo[2].category.coding[0].code, "pharmacyinformation") + self.assertEqual(inst.supportingInfo[2].code.coding[0].code, "dayssupply") + self.assertEqual(inst.supportingInfo[2].code.coding[0].system, "http://example.org/fhir/CodeSystem/pharmacy-information") + self.assertEqual(inst.supportingInfo[2].sequence, 3) + self.assertEqual(inst.supportingInfo[2].valueQuantity.value, 90) + self.assertEqual(inst.text.div, "
A human-readable rendering of the Pharmacy Claim
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.coding[0].code, "professional") + self.assertEqual(inst.total.currency, "USD") + self.assertEqual(inst.total.value, 90.0) + self.assertEqual(inst.type.coding[0].code, "pharmacy") self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") self.assertEqual(inst.use, "claim") def testClaim3(self): - inst = self.instantiate_from("claim-example.json") + inst = self.instantiate_from("claim-example-vision-glasses-3tier.json") self.assertIsNotNone(inst, "Must have instantiated a Claim instance") self.implClaim3(inst) @@ -156,93 +155,6 @@ def testClaim3(self): self.implClaim3(inst2) def implClaim3(self, inst): - self.assertEqual(inst.careTeam[0].sequence, 1) - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.created.as_json(), "2014-08-16") - self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code, "123456") - self.assertEqual(inst.diagnosis[0].sequence, 1) - self.assertEqual(inst.id, "100150") - self.assertEqual(inst.identifier[0].system, "http://happyvalley.com/claim") - self.assertEqual(inst.identifier[0].value, "12345") - self.assertTrue(inst.insurance[0].focal) - self.assertEqual(inst.insurance[0].identifier.system, "http://happyvalley.com/claim") - self.assertEqual(inst.insurance[0].identifier.value, "12345") - self.assertEqual(inst.insurance[0].sequence, 1) - self.assertEqual(inst.item[0].careTeamSequence[0], 1) - self.assertEqual(inst.item[0].net.currency, "USD") - self.assertEqual(inst.item[0].net.value, 135.57) - self.assertEqual(inst.item[0].productOrService.coding[0].code, "1200") - self.assertEqual(inst.item[0].sequence, 1) - self.assertEqual(inst.item[0].servicedDate.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.item[0].servicedDate.as_json(), "2014-08-16") - self.assertEqual(inst.item[0].unitPrice.currency, "USD") - self.assertEqual(inst.item[0].unitPrice.value, 135.57) - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.payee.type.coding[0].code, "provider") - self.assertEqual(inst.priority.coding[0].code, "normal") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.div, "
A human-readable rendering of the Oral Health Claim
") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.coding[0].code, "oral") - self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") - self.assertEqual(inst.use, "claim") - - def testClaim4(self): - inst = self.instantiate_from("claim-example-vision.json") - self.assertIsNotNone(inst, "Must have instantiated a Claim instance") - self.implClaim4(inst) - - js = inst.as_json() - self.assertEqual("Claim", js["resourceType"]) - inst2 = claim.Claim(js) - self.implClaim4(inst2) - - def implClaim4(self, inst): - self.assertEqual(inst.careTeam[0].sequence, 1) - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.created.as_json(), "2014-08-16") - self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code, "654321") - self.assertEqual(inst.diagnosis[0].sequence, 1) - self.assertEqual(inst.id, "660150") - self.assertEqual(inst.identifier[0].system, "http://happysight.com/claim") - self.assertEqual(inst.identifier[0].value, "6612345") - self.assertTrue(inst.insurance[0].focal) - self.assertEqual(inst.insurance[0].sequence, 1) - self.assertEqual(inst.item[0].careTeamSequence[0], 1) - self.assertEqual(inst.item[0].net.currency, "USD") - self.assertEqual(inst.item[0].net.value, 80.0) - self.assertEqual(inst.item[0].productOrService.coding[0].code, "exam") - self.assertEqual(inst.item[0].productOrService.coding[0].system, "http://example.org/fhir/CodeSystem/ex-visionservice") - self.assertEqual(inst.item[0].sequence, 1) - self.assertEqual(inst.item[0].servicedDate.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.item[0].servicedDate.as_json(), "2014-08-16") - self.assertEqual(inst.item[0].unitPrice.currency, "USD") - self.assertEqual(inst.item[0].unitPrice.value, 80.0) - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.payee.type.coding[0].code, "provider") - self.assertEqual(inst.priority.coding[0].code, "normal") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.div, "
A human-readable rendering of the Vision Claim
") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.coding[0].code, "vision") - self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") - self.assertEqual(inst.use, "claim") - - def testClaim5(self): - inst = self.instantiate_from("claim-example-vision-glasses-3tier.json") - self.assertIsNotNone(inst, "Must have instantiated a Claim instance") - self.implClaim5(inst) - - js = inst.as_json() - self.assertEqual("Claim", js["resourceType"]) - inst2 = claim.Claim(js) - self.implClaim5(inst2) - - def implClaim5(self, inst): self.assertEqual(inst.careTeam[0].sequence, 1) self.assertEqual(inst.contained[0].id, "device-frame") self.assertEqual(inst.contained[1].id, "device-lens") @@ -390,84 +302,147 @@ def implClaim5(self, inst): self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") self.assertEqual(inst.use, "claim") - def testClaim6(self): - inst = self.instantiate_from("claim-example-institutional.json") + def testClaim4(self): + inst = self.instantiate_from("claim-example-oral-orthoplan.json") self.assertIsNotNone(inst, "Must have instantiated a Claim instance") - self.implClaim6(inst) + self.implClaim4(inst) js = inst.as_json() self.assertEqual("Claim", js["resourceType"]) inst2 = claim.Claim(js) - self.implClaim6(inst2) + self.implClaim4(inst2) - def implClaim6(self, inst): + def implClaim4(self, inst): self.assertEqual(inst.careTeam[0].sequence, 1) - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.created.as_json(), "2014-08-16") - self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code, "654456") + self.assertEqual(inst.created.date, FHIRDate("2015-03-16").date) + self.assertEqual(inst.created.as_json(), "2015-03-16") + self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code, "123457") + self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].system, "http://hl7.org/fhir/sid/icd-10") self.assertEqual(inst.diagnosis[0].sequence, 1) - self.assertEqual(inst.id, "960150") - self.assertEqual(inst.identifier[0].system, "http://happyhospital.com/claim") - self.assertEqual(inst.identifier[0].value, "9612345") + self.assertEqual(inst.fundsReserve.coding[0].code, "provider") + self.assertEqual(inst.id, "100153") + self.assertEqual(inst.identifier[0].system, "http://happyvalley.com/claim") + self.assertEqual(inst.identifier[0].value, "12355") self.assertTrue(inst.insurance[0].focal) self.assertEqual(inst.insurance[0].sequence, 1) self.assertEqual(inst.item[0].careTeamSequence[0], 1) + self.assertEqual(inst.item[0].detail[0].net.currency, "USD") + self.assertEqual(inst.item[0].detail[0].net.value, 1000.0) + self.assertEqual(inst.item[0].detail[0].productOrService.coding[0].code, "ORTHOEXAM") + self.assertEqual(inst.item[0].detail[0].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") + self.assertEqual(inst.item[0].detail[0].sequence, 1) + self.assertEqual(inst.item[0].detail[0].unitPrice.currency, "USD") + self.assertEqual(inst.item[0].detail[0].unitPrice.value, 1000.0) + self.assertEqual(inst.item[0].detail[1].net.currency, "USD") + self.assertEqual(inst.item[0].detail[1].net.value, 1500.0) + self.assertEqual(inst.item[0].detail[1].productOrService.coding[0].code, "ORTHODIAG") + self.assertEqual(inst.item[0].detail[1].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") + self.assertEqual(inst.item[0].detail[1].sequence, 2) + self.assertEqual(inst.item[0].detail[1].unitPrice.currency, "USD") + self.assertEqual(inst.item[0].detail[1].unitPrice.value, 1500.0) + self.assertEqual(inst.item[0].detail[2].net.currency, "USD") + self.assertEqual(inst.item[0].detail[2].net.value, 500.0) + self.assertEqual(inst.item[0].detail[2].productOrService.coding[0].code, "ORTHOINITIAL") + self.assertEqual(inst.item[0].detail[2].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") + self.assertEqual(inst.item[0].detail[2].sequence, 3) + self.assertEqual(inst.item[0].detail[2].unitPrice.currency, "USD") + self.assertEqual(inst.item[0].detail[2].unitPrice.value, 500.0) + self.assertEqual(inst.item[0].detail[3].productOrService.coding[0].code, "ORTHOMONTHS") + self.assertEqual(inst.item[0].detail[3].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") + self.assertEqual(inst.item[0].detail[3].quantity.value, 24) + self.assertEqual(inst.item[0].detail[3].sequence, 4) + self.assertEqual(inst.item[0].detail[4].net.currency, "USD") + self.assertEqual(inst.item[0].detail[4].net.value, 250.0) + self.assertEqual(inst.item[0].detail[4].productOrService.coding[0].code, "ORTHOPERIODIC") + self.assertEqual(inst.item[0].detail[4].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") + self.assertEqual(inst.item[0].detail[4].quantity.value, 24) + self.assertEqual(inst.item[0].detail[4].sequence, 5) + self.assertEqual(inst.item[0].detail[4].unitPrice.currency, "USD") + self.assertEqual(inst.item[0].detail[4].unitPrice.value, 250.0) + self.assertEqual(inst.item[0].diagnosisSequence[0], 1) self.assertEqual(inst.item[0].net.currency, "USD") - self.assertEqual(inst.item[0].net.value, 125.0) - self.assertEqual(inst.item[0].productOrService.coding[0].code, "exam") - self.assertEqual(inst.item[0].productOrService.coding[0].system, "http://hl7.org/fhir/ex-serviceproduct") + self.assertEqual(inst.item[0].net.value, 9000.0) + self.assertEqual(inst.item[0].productOrService.coding[0].code, "ORTHPLAN") + self.assertEqual(inst.item[0].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") self.assertEqual(inst.item[0].sequence, 1) - self.assertEqual(inst.item[0].servicedDate.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.item[0].servicedDate.as_json(), "2014-08-16") + self.assertEqual(inst.item[0].servicedDate.date, FHIRDate("2015-05-16").date) + self.assertEqual(inst.item[0].servicedDate.as_json(), "2015-05-16") self.assertEqual(inst.item[0].unitPrice.currency, "USD") - self.assertEqual(inst.item[0].unitPrice.value, 125.0) - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.payee.type.coding[0].code, "provider") - self.assertEqual(inst.priority.coding[0].code, "normal") - self.assertEqual(inst.procedure[0].date.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.procedure[0].date.as_json(), "2014-08-16") - self.assertEqual(inst.procedure[0].procedureCodeableConcept.coding[0].code, "SDI9901") - self.assertEqual(inst.procedure[0].procedureCodeableConcept.text, "Subcutaneous diagnostic implant") - self.assertEqual(inst.procedure[0].sequence, 1) - self.assertEqual(inst.procedure[0].type[0].coding[0].code, "primary") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.subType.coding[0].code, "emergency") - self.assertEqual(inst.subType.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-claimsubtype") - self.assertEqual(inst.text.div, "
A human-readable rendering of the Claim
") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.total.currency, "USD") - self.assertEqual(inst.total.value, 125.0) - self.assertEqual(inst.type.coding[0].code, "institutional") - self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") - self.assertEqual(inst.use, "claim") - - def testClaim7(self): - inst = self.instantiate_from("claim-example-oral-contained.json") + self.assertEqual(inst.item[0].unitPrice.value, 9000.0) + self.assertEqual(inst.item[1].bodySite.coding[0].code, "21") + self.assertEqual(inst.item[1].bodySite.coding[0].system, "http://fdi.org/fhir/oraltoothcodes") + self.assertEqual(inst.item[1].careTeamSequence[0], 1) + self.assertEqual(inst.item[1].net.currency, "USD") + self.assertEqual(inst.item[1].net.value, 105.0) + self.assertEqual(inst.item[1].productOrService.coding[0].code, "21211") + self.assertEqual(inst.item[1].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") + self.assertEqual(inst.item[1].sequence, 2) + self.assertEqual(inst.item[1].servicedDate.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.item[1].servicedDate.as_json(), "2014-08-16") + self.assertEqual(inst.item[1].subSite[0].coding[0].code, "L") + self.assertEqual(inst.item[1].subSite[0].coding[0].system, "http://fdi.org/fhir/oralsurfacecodes") + self.assertEqual(inst.item[1].unitPrice.currency, "USD") + self.assertEqual(inst.item[1].unitPrice.value, 105.0) + self.assertEqual(inst.item[2].bodySite.coding[0].code, "36") + self.assertEqual(inst.item[2].bodySite.coding[0].system, "http://fdi.org/fhir/oraltoothcodes") + self.assertEqual(inst.item[2].careTeamSequence[0], 1) + self.assertEqual(inst.item[2].detail[0].net.currency, "USD") + self.assertEqual(inst.item[2].detail[0].net.value, 750.0) + self.assertEqual(inst.item[2].detail[0].productOrService.coding[0].code, "27211") + self.assertEqual(inst.item[2].detail[0].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") + self.assertEqual(inst.item[2].detail[0].sequence, 1) + self.assertEqual(inst.item[2].detail[0].unitPrice.currency, "USD") + self.assertEqual(inst.item[2].detail[0].unitPrice.value, 750.0) + self.assertEqual(inst.item[2].detail[1].net.currency, "USD") + self.assertEqual(inst.item[2].detail[1].net.value, 350.0) + self.assertEqual(inst.item[2].detail[1].productOrService.coding[0].code, "lab") + self.assertEqual(inst.item[2].detail[1].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") + self.assertEqual(inst.item[2].detail[1].sequence, 2) + self.assertEqual(inst.item[2].detail[1].unitPrice.currency, "USD") + self.assertEqual(inst.item[2].detail[1].unitPrice.value, 350.0) + self.assertEqual(inst.item[2].net.currency, "USD") + self.assertEqual(inst.item[2].net.value, 1100.0) + self.assertEqual(inst.item[2].productOrService.coding[0].code, "27211") + self.assertEqual(inst.item[2].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") + self.assertEqual(inst.item[2].sequence, 3) + self.assertEqual(inst.item[2].servicedDate.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.item[2].servicedDate.as_json(), "2014-08-16") + self.assertEqual(inst.item[2].unitPrice.currency, "USD") + self.assertEqual(inst.item[2].unitPrice.value, 1100.0) + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.payee.type.coding[0].code, "provider") + self.assertEqual(inst.priority.coding[0].code, "normal") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.div, "
A human-readable rendering of the Oral Health Claim
") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.type.coding[0].code, "oral") + self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") + self.assertEqual(inst.use, "preauthorization") + + def testClaim5(self): + inst = self.instantiate_from("claim-example.json") self.assertIsNotNone(inst, "Must have instantiated a Claim instance") - self.implClaim7(inst) + self.implClaim5(inst) js = inst.as_json() self.assertEqual("Claim", js["resourceType"]) inst2 = claim.Claim(js) - self.implClaim7(inst2) + self.implClaim5(inst2) - def implClaim7(self, inst): + def implClaim5(self, inst): self.assertEqual(inst.careTeam[0].sequence, 1) - self.assertEqual(inst.contained[0].id, "org-insurer") - self.assertEqual(inst.contained[1].id, "org-org") - self.assertEqual(inst.contained[2].id, "provider-1") - self.assertEqual(inst.contained[3].id, "patient-1") - self.assertEqual(inst.contained[4].id, "coverage-1") self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) self.assertEqual(inst.created.as_json(), "2014-08-16") self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code, "123456") self.assertEqual(inst.diagnosis[0].sequence, 1) - self.assertEqual(inst.id, "100152") + self.assertEqual(inst.id, "100150") self.assertEqual(inst.identifier[0].system, "http://happyvalley.com/claim") - self.assertEqual(inst.identifier[0].value, "12347") + self.assertEqual(inst.identifier[0].value, "12345") self.assertTrue(inst.insurance[0].focal) + self.assertEqual(inst.insurance[0].identifier.system, "http://happyvalley.com/claim") + self.assertEqual(inst.insurance[0].identifier.value, "12345") self.assertEqual(inst.insurance[0].sequence, 1) self.assertEqual(inst.item[0].careTeamSequence[0], 1) self.assertEqual(inst.item[0].net.currency, "USD") @@ -490,88 +465,174 @@ def implClaim7(self, inst): self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") self.assertEqual(inst.use, "claim") - def testClaim8(self): - inst = self.instantiate_from("claim-example-pharmacy-medication.json") + def testClaim6(self): + inst = self.instantiate_from("claim-example-vision-glasses.json") self.assertIsNotNone(inst, "Must have instantiated a Claim instance") - self.implClaim8(inst) + self.implClaim6(inst) js = inst.as_json() self.assertEqual("Claim", js["resourceType"]) inst2 = claim.Claim(js) - self.implClaim8(inst2) + self.implClaim6(inst2) - def implClaim8(self, inst): + def implClaim6(self, inst): self.assertEqual(inst.careTeam[0].sequence, 1) self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) self.assertEqual(inst.created.as_json(), "2014-08-16") - self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code, "654456") + self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code, "654321") self.assertEqual(inst.diagnosis[0].sequence, 1) - self.assertEqual(inst.id, "760151") - self.assertEqual(inst.identifier[0].system, "http://happypharma.com/claim") - self.assertEqual(inst.identifier[0].value, "7612345") + self.assertEqual(inst.id, "660151") + self.assertEqual(inst.identifier[0].system, "http://happysight.com/claim") + self.assertEqual(inst.identifier[0].value, "6612346") self.assertTrue(inst.insurance[0].focal) self.assertEqual(inst.insurance[0].sequence, 1) self.assertEqual(inst.item[0].careTeamSequence[0], 1) self.assertEqual(inst.item[0].detail[0].net.currency, "USD") - self.assertEqual(inst.item[0].detail[0].net.value, 45.0) - self.assertEqual(inst.item[0].detail[0].productOrService.coding[0].code, "drugcost") - self.assertEqual(inst.item[0].detail[0].productOrService.coding[0].system, "http://hl7.org/fhir/ex-pharmaservice") + self.assertEqual(inst.item[0].detail[0].net.value, 100.0) + self.assertEqual(inst.item[0].detail[0].productOrService.coding[0].code, "frame") + self.assertEqual(inst.item[0].detail[0].productOrService.coding[0].system, "http://example.org/fhir/CodeSystem/ex-visionservice") self.assertEqual(inst.item[0].detail[0].sequence, 1) + self.assertEqual(inst.item[0].detail[0].unitPrice.currency, "USD") + self.assertEqual(inst.item[0].detail[0].unitPrice.value, 100.0) self.assertEqual(inst.item[0].detail[1].net.currency, "USD") - self.assertEqual(inst.item[0].detail[1].net.value, 9.0) - self.assertEqual(inst.item[0].detail[1].productOrService.coding[0].code, "markup") - self.assertEqual(inst.item[0].detail[1].productOrService.coding[0].system, "http://hl7.org/fhir/ex-pharmaservice") + self.assertEqual(inst.item[0].detail[1].net.value, 100.0) + self.assertEqual(inst.item[0].detail[1].productOrService.coding[0].code, "lens") + self.assertEqual(inst.item[0].detail[1].productOrService.coding[0].system, "http://example.org/fhir/CodeSystem/ex-visionservice") + self.assertEqual(inst.item[0].detail[1].quantity.value, 2) self.assertEqual(inst.item[0].detail[1].sequence, 2) + self.assertEqual(inst.item[0].detail[1].unitPrice.currency, "USD") + self.assertEqual(inst.item[0].detail[1].unitPrice.value, 50.0) + self.assertEqual(inst.item[0].detail[2].factor, 0.07) self.assertEqual(inst.item[0].detail[2].net.currency, "USD") - self.assertEqual(inst.item[0].detail[2].net.value, 36.0) - self.assertEqual(inst.item[0].detail[2].productOrService.coding[0].code, "dispensefee") - self.assertEqual(inst.item[0].detail[2].productOrService.coding[0].system, "http://hl7.org/fhir/ex-pharmaservice") + self.assertEqual(inst.item[0].detail[2].net.value, 14.0) + self.assertEqual(inst.item[0].detail[2].productOrService.coding[0].code, "fst") + self.assertEqual(inst.item[0].detail[2].productOrService.coding[0].system, "http://example.org/fhir/CodeSystem/ex-visionservice") self.assertEqual(inst.item[0].detail[2].sequence, 3) - self.assertEqual(inst.item[0].informationSequence[0], 1) - self.assertEqual(inst.item[0].informationSequence[1], 2) - self.assertEqual(inst.item[0].informationSequence[2], 3) + self.assertEqual(inst.item[0].detail[2].unitPrice.currency, "USD") + self.assertEqual(inst.item[0].detail[2].unitPrice.value, 200.0) self.assertEqual(inst.item[0].net.currency, "USD") - self.assertEqual(inst.item[0].net.value, 90.0) - self.assertEqual(inst.item[0].productOrService.coding[0].code, "562721") - self.assertEqual(inst.item[0].productOrService.coding[0].display, "Alprazolam 0.25mg (Xanax)") - self.assertEqual(inst.item[0].productOrService.coding[0].system, "http://www.nlm.nih.gov/research/umls/rxnorm") - self.assertEqual(inst.item[0].quantity.code, "TAB") - self.assertEqual(inst.item[0].quantity.system, "http://unitsofmeasure.org") - self.assertEqual(inst.item[0].quantity.unit, "TAB") - self.assertEqual(inst.item[0].quantity.value, 90) + self.assertEqual(inst.item[0].net.value, 214.0) + self.assertEqual(inst.item[0].productOrService.coding[0].code, "glasses") + self.assertEqual(inst.item[0].productOrService.coding[0].system, "http://example.org/fhir/CodeSystem/ex-visionservice") self.assertEqual(inst.item[0].sequence, 1) self.assertEqual(inst.item[0].servicedDate.date, FHIRDate("2014-08-16").date) self.assertEqual(inst.item[0].servicedDate.as_json(), "2014-08-16") + self.assertEqual(inst.item[0].unitPrice.currency, "USD") + self.assertEqual(inst.item[0].unitPrice.value, 214.0) self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.payee.type.coding[0].code, "provider") - self.assertEqual(inst.priority.coding[0].code, "stat") + self.assertEqual(inst.priority.coding[0].code, "normal") self.assertEqual(inst.status, "active") - self.assertEqual(inst.supportingInfo[0].category.coding[0].code, "pharmacyrefill") - self.assertEqual(inst.supportingInfo[0].code.coding[0].code, "new") - self.assertEqual(inst.supportingInfo[0].code.coding[0].system, "http://example.org/fhir/CodeSystem/pharmacy-refill") - self.assertEqual(inst.supportingInfo[0].sequence, 1) - self.assertEqual(inst.supportingInfo[1].category.coding[0].code, "pharmacyinformation") - self.assertEqual(inst.supportingInfo[1].code.coding[0].code, "refillsremaining") - self.assertEqual(inst.supportingInfo[1].code.coding[0].system, "http://example.org/fhir/CodeSystem/pharmacy-information") - self.assertEqual(inst.supportingInfo[1].sequence, 2) - self.assertEqual(inst.supportingInfo[1].valueQuantity.value, 2) - self.assertEqual(inst.supportingInfo[2].category.coding[0].code, "pharmacyinformation") - self.assertEqual(inst.supportingInfo[2].code.coding[0].code, "dayssupply") - self.assertEqual(inst.supportingInfo[2].code.coding[0].system, "http://example.org/fhir/CodeSystem/pharmacy-information") - self.assertEqual(inst.supportingInfo[2].sequence, 3) - self.assertEqual(inst.supportingInfo[2].valueQuantity.value, 90) - self.assertEqual(inst.text.div, "
A human-readable rendering of the Pharmacy Claim
") + self.assertEqual(inst.text.div, "
A human-readable rendering of the Vision Claim for Glasses
") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.type.coding[0].code, "vision") + self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") + self.assertEqual(inst.use, "claim") + + def testClaim7(self): + inst = self.instantiate_from("claim-example-institutional.json") + self.assertIsNotNone(inst, "Must have instantiated a Claim instance") + self.implClaim7(inst) + + js = inst.as_json() + self.assertEqual("Claim", js["resourceType"]) + inst2 = claim.Claim(js) + self.implClaim7(inst2) + + def implClaim7(self, inst): + self.assertEqual(inst.careTeam[0].sequence, 1) + self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.as_json(), "2014-08-16") + self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code, "654456") + self.assertEqual(inst.diagnosis[0].sequence, 1) + self.assertEqual(inst.id, "960150") + self.assertEqual(inst.identifier[0].system, "http://happyhospital.com/claim") + self.assertEqual(inst.identifier[0].value, "9612345") + self.assertTrue(inst.insurance[0].focal) + self.assertEqual(inst.insurance[0].sequence, 1) + self.assertEqual(inst.item[0].careTeamSequence[0], 1) + self.assertEqual(inst.item[0].net.currency, "USD") + self.assertEqual(inst.item[0].net.value, 125.0) + self.assertEqual(inst.item[0].productOrService.coding[0].code, "exam") + self.assertEqual(inst.item[0].productOrService.coding[0].system, "http://hl7.org/fhir/ex-serviceproduct") + self.assertEqual(inst.item[0].sequence, 1) + self.assertEqual(inst.item[0].servicedDate.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.item[0].servicedDate.as_json(), "2014-08-16") + self.assertEqual(inst.item[0].unitPrice.currency, "USD") + self.assertEqual(inst.item[0].unitPrice.value, 125.0) + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.payee.type.coding[0].code, "provider") + self.assertEqual(inst.priority.coding[0].code, "normal") + self.assertEqual(inst.procedure[0].date.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.procedure[0].date.as_json(), "2014-08-16") + self.assertEqual(inst.procedure[0].procedureCodeableConcept.coding[0].code, "SDI9901") + self.assertEqual(inst.procedure[0].procedureCodeableConcept.text, "Subcutaneous diagnostic implant") + self.assertEqual(inst.procedure[0].sequence, 1) + self.assertEqual(inst.procedure[0].type[0].coding[0].code, "primary") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.subType.coding[0].code, "emergency") + self.assertEqual(inst.subType.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-claimsubtype") + self.assertEqual(inst.text.div, "
A human-readable rendering of the Claim
") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.total.currency, "USD") - self.assertEqual(inst.total.value, 90.0) - self.assertEqual(inst.type.coding[0].code, "pharmacy") + self.assertEqual(inst.total.value, 125.0) + self.assertEqual(inst.type.coding[0].code, "institutional") + self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") + self.assertEqual(inst.use, "claim") + + def testClaim8(self): + inst = self.instantiate_from("claim-example-oral-contained.json") + self.assertIsNotNone(inst, "Must have instantiated a Claim instance") + self.implClaim8(inst) + + js = inst.as_json() + self.assertEqual("Claim", js["resourceType"]) + inst2 = claim.Claim(js) + self.implClaim8(inst2) + + def implClaim8(self, inst): + self.assertEqual(inst.careTeam[0].sequence, 1) + self.assertEqual(inst.contained[0].id, "org-insurer") + self.assertEqual(inst.contained[1].id, "org-org") + self.assertEqual(inst.contained[2].id, "provider-1") + self.assertEqual(inst.contained[3].id, "patient-1") + self.assertEqual(inst.contained[4].id, "coverage-1") + self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.as_json(), "2014-08-16") + self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code, "123456") + self.assertEqual(inst.diagnosis[0].sequence, 1) + self.assertEqual(inst.id, "100152") + self.assertEqual(inst.identifier[0].system, "http://happyvalley.com/claim") + self.assertEqual(inst.identifier[0].value, "12347") + self.assertTrue(inst.insurance[0].focal) + self.assertEqual(inst.insurance[0].sequence, 1) + self.assertEqual(inst.item[0].careTeamSequence[0], 1) + self.assertEqual(inst.item[0].net.currency, "USD") + self.assertEqual(inst.item[0].net.value, 135.57) + self.assertEqual(inst.item[0].productOrService.coding[0].code, "1200") + self.assertEqual(inst.item[0].sequence, 1) + self.assertEqual(inst.item[0].servicedDate.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.item[0].servicedDate.as_json(), "2014-08-16") + self.assertEqual(inst.item[0].unitPrice.currency, "USD") + self.assertEqual(inst.item[0].unitPrice.value, 135.57) + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.payee.type.coding[0].code, "provider") + self.assertEqual(inst.priority.coding[0].code, "normal") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.div, "
A human-readable rendering of the Oral Health Claim
") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.type.coding[0].code, "oral") self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") self.assertEqual(inst.use, "claim") def testClaim9(self): - inst = self.instantiate_from("claim-example-oral-orthoplan.json") + inst = self.instantiate_from("claim-example-vision.json") self.assertIsNotNone(inst, "Must have instantiated a Claim instance") self.implClaim9(inst) @@ -582,115 +643,39 @@ def testClaim9(self): def implClaim9(self, inst): self.assertEqual(inst.careTeam[0].sequence, 1) - self.assertEqual(inst.created.date, FHIRDate("2015-03-16").date) - self.assertEqual(inst.created.as_json(), "2015-03-16") - self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code, "123457") - self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].system, "http://hl7.org/fhir/sid/icd-10") + self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.as_json(), "2014-08-16") + self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code, "654321") self.assertEqual(inst.diagnosis[0].sequence, 1) - self.assertEqual(inst.fundsReserve.coding[0].code, "provider") - self.assertEqual(inst.id, "100153") - self.assertEqual(inst.identifier[0].system, "http://happyvalley.com/claim") - self.assertEqual(inst.identifier[0].value, "12355") + self.assertEqual(inst.id, "660150") + self.assertEqual(inst.identifier[0].system, "http://happysight.com/claim") + self.assertEqual(inst.identifier[0].value, "6612345") self.assertTrue(inst.insurance[0].focal) self.assertEqual(inst.insurance[0].sequence, 1) self.assertEqual(inst.item[0].careTeamSequence[0], 1) - self.assertEqual(inst.item[0].detail[0].net.currency, "USD") - self.assertEqual(inst.item[0].detail[0].net.value, 1000.0) - self.assertEqual(inst.item[0].detail[0].productOrService.coding[0].code, "ORTHOEXAM") - self.assertEqual(inst.item[0].detail[0].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") - self.assertEqual(inst.item[0].detail[0].sequence, 1) - self.assertEqual(inst.item[0].detail[0].unitPrice.currency, "USD") - self.assertEqual(inst.item[0].detail[0].unitPrice.value, 1000.0) - self.assertEqual(inst.item[0].detail[1].net.currency, "USD") - self.assertEqual(inst.item[0].detail[1].net.value, 1500.0) - self.assertEqual(inst.item[0].detail[1].productOrService.coding[0].code, "ORTHODIAG") - self.assertEqual(inst.item[0].detail[1].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") - self.assertEqual(inst.item[0].detail[1].sequence, 2) - self.assertEqual(inst.item[0].detail[1].unitPrice.currency, "USD") - self.assertEqual(inst.item[0].detail[1].unitPrice.value, 1500.0) - self.assertEqual(inst.item[0].detail[2].net.currency, "USD") - self.assertEqual(inst.item[0].detail[2].net.value, 500.0) - self.assertEqual(inst.item[0].detail[2].productOrService.coding[0].code, "ORTHOINITIAL") - self.assertEqual(inst.item[0].detail[2].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") - self.assertEqual(inst.item[0].detail[2].sequence, 3) - self.assertEqual(inst.item[0].detail[2].unitPrice.currency, "USD") - self.assertEqual(inst.item[0].detail[2].unitPrice.value, 500.0) - self.assertEqual(inst.item[0].detail[3].productOrService.coding[0].code, "ORTHOMONTHS") - self.assertEqual(inst.item[0].detail[3].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") - self.assertEqual(inst.item[0].detail[3].quantity.value, 24) - self.assertEqual(inst.item[0].detail[3].sequence, 4) - self.assertEqual(inst.item[0].detail[4].net.currency, "USD") - self.assertEqual(inst.item[0].detail[4].net.value, 250.0) - self.assertEqual(inst.item[0].detail[4].productOrService.coding[0].code, "ORTHOPERIODIC") - self.assertEqual(inst.item[0].detail[4].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") - self.assertEqual(inst.item[0].detail[4].quantity.value, 24) - self.assertEqual(inst.item[0].detail[4].sequence, 5) - self.assertEqual(inst.item[0].detail[4].unitPrice.currency, "USD") - self.assertEqual(inst.item[0].detail[4].unitPrice.value, 250.0) - self.assertEqual(inst.item[0].diagnosisSequence[0], 1) self.assertEqual(inst.item[0].net.currency, "USD") - self.assertEqual(inst.item[0].net.value, 9000.0) - self.assertEqual(inst.item[0].productOrService.coding[0].code, "ORTHPLAN") - self.assertEqual(inst.item[0].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") + self.assertEqual(inst.item[0].net.value, 80.0) + self.assertEqual(inst.item[0].productOrService.coding[0].code, "exam") + self.assertEqual(inst.item[0].productOrService.coding[0].system, "http://example.org/fhir/CodeSystem/ex-visionservice") self.assertEqual(inst.item[0].sequence, 1) - self.assertEqual(inst.item[0].servicedDate.date, FHIRDate("2015-05-16").date) - self.assertEqual(inst.item[0].servicedDate.as_json(), "2015-05-16") + self.assertEqual(inst.item[0].servicedDate.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.item[0].servicedDate.as_json(), "2014-08-16") self.assertEqual(inst.item[0].unitPrice.currency, "USD") - self.assertEqual(inst.item[0].unitPrice.value, 9000.0) - self.assertEqual(inst.item[1].bodySite.coding[0].code, "21") - self.assertEqual(inst.item[1].bodySite.coding[0].system, "http://fdi.org/fhir/oraltoothcodes") - self.assertEqual(inst.item[1].careTeamSequence[0], 1) - self.assertEqual(inst.item[1].net.currency, "USD") - self.assertEqual(inst.item[1].net.value, 105.0) - self.assertEqual(inst.item[1].productOrService.coding[0].code, "21211") - self.assertEqual(inst.item[1].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") - self.assertEqual(inst.item[1].sequence, 2) - self.assertEqual(inst.item[1].servicedDate.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.item[1].servicedDate.as_json(), "2014-08-16") - self.assertEqual(inst.item[1].subSite[0].coding[0].code, "L") - self.assertEqual(inst.item[1].subSite[0].coding[0].system, "http://fdi.org/fhir/oralsurfacecodes") - self.assertEqual(inst.item[1].unitPrice.currency, "USD") - self.assertEqual(inst.item[1].unitPrice.value, 105.0) - self.assertEqual(inst.item[2].bodySite.coding[0].code, "36") - self.assertEqual(inst.item[2].bodySite.coding[0].system, "http://fdi.org/fhir/oraltoothcodes") - self.assertEqual(inst.item[2].careTeamSequence[0], 1) - self.assertEqual(inst.item[2].detail[0].net.currency, "USD") - self.assertEqual(inst.item[2].detail[0].net.value, 750.0) - self.assertEqual(inst.item[2].detail[0].productOrService.coding[0].code, "27211") - self.assertEqual(inst.item[2].detail[0].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") - self.assertEqual(inst.item[2].detail[0].sequence, 1) - self.assertEqual(inst.item[2].detail[0].unitPrice.currency, "USD") - self.assertEqual(inst.item[2].detail[0].unitPrice.value, 750.0) - self.assertEqual(inst.item[2].detail[1].net.currency, "USD") - self.assertEqual(inst.item[2].detail[1].net.value, 350.0) - self.assertEqual(inst.item[2].detail[1].productOrService.coding[0].code, "lab") - self.assertEqual(inst.item[2].detail[1].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") - self.assertEqual(inst.item[2].detail[1].sequence, 2) - self.assertEqual(inst.item[2].detail[1].unitPrice.currency, "USD") - self.assertEqual(inst.item[2].detail[1].unitPrice.value, 350.0) - self.assertEqual(inst.item[2].net.currency, "USD") - self.assertEqual(inst.item[2].net.value, 1100.0) - self.assertEqual(inst.item[2].productOrService.coding[0].code, "27211") - self.assertEqual(inst.item[2].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") - self.assertEqual(inst.item[2].sequence, 3) - self.assertEqual(inst.item[2].servicedDate.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.item[2].servicedDate.as_json(), "2014-08-16") - self.assertEqual(inst.item[2].unitPrice.currency, "USD") - self.assertEqual(inst.item[2].unitPrice.value, 1100.0) + self.assertEqual(inst.item[0].unitPrice.value, 80.0) self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.payee.type.coding[0].code, "provider") self.assertEqual(inst.priority.coding[0].code, "normal") self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.div, "
A human-readable rendering of the Oral Health Claim
") + self.assertEqual(inst.text.div, "
A human-readable rendering of the Vision Claim
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.coding[0].code, "oral") + self.assertEqual(inst.type.coding[0].code, "vision") self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") - self.assertEqual(inst.use, "preauthorization") + self.assertEqual(inst.use, "claim") def testClaim10(self): - inst = self.instantiate_from("claim-example-cms1500-medical.json") + inst = self.instantiate_from("claim-example-oral-identifier.json") self.assertIsNotNone(inst, "Must have instantiated a Claim instance") self.implClaim10(inst) @@ -701,77 +686,33 @@ def testClaim10(self): def implClaim10(self, inst): self.assertEqual(inst.careTeam[0].sequence, 1) - self.assertEqual(inst.contained[0].id, "patient-1") - self.assertEqual(inst.contained[1].id, "coverage-1") - self.assertEqual(inst.created.date, FHIRDate("2015-10-16T00:00:00-07:00").date) - self.assertEqual(inst.created.as_json(), "2015-10-16T00:00:00-07:00") - self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code, "M96.1") - self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].display, "Postlaminectomy syndrome") - self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].system, "http://hl7.org/fhir/sid/icd-10") + self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.as_json(), "2014-08-16") + self.assertEqual(inst.diagnosis[0].diagnosisCodeableConcept.coding[0].code, "123456") self.assertEqual(inst.diagnosis[0].sequence, 1) - self.assertEqual(inst.diagnosis[1].diagnosisCodeableConcept.coding[0].code, "G89.4") - self.assertEqual(inst.diagnosis[1].diagnosisCodeableConcept.coding[0].display, "Chronic pain syndrome") - self.assertEqual(inst.diagnosis[1].diagnosisCodeableConcept.coding[0].system, "http://hl7.org/fhir/sid/icd-10") - self.assertEqual(inst.diagnosis[1].sequence, 2) - self.assertEqual(inst.diagnosis[2].diagnosisCodeableConcept.coding[0].code, "M53.88") - self.assertEqual(inst.diagnosis[2].diagnosisCodeableConcept.coding[0].display, "Other specified dorsopathies, sacral and sacrococcygeal region") - self.assertEqual(inst.diagnosis[2].diagnosisCodeableConcept.coding[0].system, "http://hl7.org/fhir/sid/icd-10") - self.assertEqual(inst.diagnosis[2].sequence, 3) - self.assertEqual(inst.diagnosis[3].diagnosisCodeableConcept.coding[0].code, "M47.816") - self.assertEqual(inst.diagnosis[3].diagnosisCodeableConcept.coding[0].display, "Spondylosis without myelopathy or radiculopathy, lumbar region") - self.assertEqual(inst.diagnosis[3].diagnosisCodeableConcept.coding[0].system, "http://hl7.org/fhir/sid/icd-10") - self.assertEqual(inst.diagnosis[3].sequence, 4) - self.assertEqual(inst.id, "MED-00050") - self.assertEqual(inst.identifier[0].system, "http://CedarArmsMedicalCenter.com/claim") - self.assertEqual(inst.identifier[0].value, "MED-00050") + self.assertEqual(inst.id, "100154") + self.assertEqual(inst.identifier[0].system, "http://happyvalley.com/claim") + self.assertEqual(inst.identifier[0].value, "12347") self.assertTrue(inst.insurance[0].focal) - self.assertEqual(inst.insurance[0].identifier.system, "http://CedarArmsMedicalCenter.com/claim") - self.assertEqual(inst.insurance[0].identifier.value, "MED-00050") self.assertEqual(inst.insurance[0].sequence, 1) self.assertEqual(inst.item[0].careTeamSequence[0], 1) - self.assertEqual(inst.item[0].diagnosisSequence[0], 2) - self.assertEqual(inst.item[0].diagnosisSequence[1], 4) - self.assertEqual(inst.item[0].informationSequence[0], 1) - self.assertEqual(inst.item[0].locationCodeableConcept.coding[0].code, "24") - self.assertEqual(inst.item[0].locationCodeableConcept.coding[0].display, "Ambulatory Surgical Center") - self.assertEqual(inst.item[0].locationCodeableConcept.coding[0].system, "https://www.cms.gov/medicare/coding/place-of-service-codes/place_of_service_code_set.html") self.assertEqual(inst.item[0].net.currency, "USD") - self.assertEqual(inst.item[0].net.value, 12500.0) - self.assertEqual(inst.item[0].productOrService.coding[0].code, "62264") - self.assertEqual(inst.item[0].productOrService.coding[0].display, "Surgical Procedures on the Spine and Spinal Cord") - self.assertEqual(inst.item[0].productOrService.coding[0].system, "http://www.ama-assn.org/go/cpt") + self.assertEqual(inst.item[0].net.value, 135.57) + self.assertEqual(inst.item[0].productOrService.coding[0].code, "1200") self.assertEqual(inst.item[0].sequence, 1) - self.assertEqual(inst.item[0].servicedDate.date, FHIRDate("2015-10-13").date) - self.assertEqual(inst.item[0].servicedDate.as_json(), "2015-10-13") + self.assertEqual(inst.item[0].servicedDate.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.item[0].servicedDate.as_json(), "2014-08-16") self.assertEqual(inst.item[0].unitPrice.currency, "USD") - self.assertEqual(inst.item[0].unitPrice.value, 12500.0) + self.assertEqual(inst.item[0].unitPrice.value, 135.57) self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.payee.type.coding[0].code, "provider") - self.assertEqual(inst.payee.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/payeetype") self.assertEqual(inst.priority.coding[0].code, "normal") self.assertEqual(inst.status, "active") - self.assertEqual(inst.subType.coding[0].code, "831") - self.assertEqual(inst.subType.coding[0].system, "https://www.cms.gov/codes/billtype") - self.assertEqual(inst.supportingInfo[0].category.coding[0].code, "hospitalized") - self.assertEqual(inst.supportingInfo[0].category.coding[0].system, "http://terminology.hl7.org/CodeSystem/claiminformationcategory") - self.assertEqual(inst.supportingInfo[0].sequence, 1) - self.assertEqual(inst.supportingInfo[0].timingPeriod.end.date, FHIRDate("2015-10-05T00:00:00-07:00").date) - self.assertEqual(inst.supportingInfo[0].timingPeriod.end.as_json(), "2015-10-05T00:00:00-07:00") - self.assertEqual(inst.supportingInfo[0].timingPeriod.start.date, FHIRDate("2015-10-01T00:00:00-07:00").date) - self.assertEqual(inst.supportingInfo[0].timingPeriod.start.as_json(), "2015-10-01T00:00:00-07:00") - self.assertEqual(inst.supportingInfo[1].category.coding[0].code, "discharge") - self.assertEqual(inst.supportingInfo[1].category.coding[0].system, "http://terminology.hl7.org/CodeSystem/claiminformationcategory") - self.assertEqual(inst.supportingInfo[1].code.coding[0].code, "01") - self.assertEqual(inst.supportingInfo[1].code.coding[0].display, "Discharge to Home or Self Care") - self.assertEqual(inst.supportingInfo[1].code.coding[0].system, "https://www.cms.gov/Outreach-and-Education/Medicare-Learning-Network-MLN/MLNMattersArticles/downloads/SE0801.pdf") - self.assertEqual(inst.supportingInfo[1].sequence, 2) - self.assertEqual(inst.text.div, "
A human-readable rendering of a CMS 1500 Claim
") + self.assertEqual(inst.text.div, "
This example assumes a national health care scheme where patients, providers and organizations have known business identifiers.
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.total.currency, "USD") - self.assertEqual(inst.total.value, 12500.0) - self.assertEqual(inst.type.coding[0].code, "institutional") + self.assertEqual(inst.type.coding[0].code, "oral") self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") self.assertEqual(inst.use, "claim") diff --git a/fhirclient/models/claimresponse.py b/fhirclient/models/claimresponse.py index f19d2db4d..f93df14b2 100644 --- a/fhirclient/models/claimresponse.py +++ b/fhirclient/models/claimresponse.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ClaimResponse) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ClaimResponse) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/claimresponse_tests.py b/fhirclient/models/claimresponse_tests.py index 35501e543..aabdeb5a8 100644 --- a/fhirclient/models/claimresponse_tests.py +++ b/fhirclient/models/claimresponse_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -100,7 +100,7 @@ def implClaimResponse1(self, inst): self.assertEqual(inst.use, "preauthorization") def testClaimResponse2(self): - inst = self.instantiate_from("claimresponse-example-additem.json") + inst = self.instantiate_from("claimresponse-example.json") self.assertIsNotNone(inst, "Must have instantiated a ClaimResponse instance") self.implClaimResponse2(inst) @@ -110,6 +110,67 @@ def testClaimResponse2(self): self.implClaimResponse2(inst2) def implClaimResponse2(self, inst): + self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.as_json(), "2014-08-16") + self.assertEqual(inst.disposition, "Claim settled as per contract.") + self.assertEqual(inst.id, "R3500") + self.assertEqual(inst.identifier[0].system, "http://www.BenefitsInc.com/fhir/remittance") + self.assertEqual(inst.identifier[0].value, "R3500") + self.assertEqual(inst.item[0].adjudication[0].amount.currency, "USD") + self.assertEqual(inst.item[0].adjudication[0].amount.value, 135.57) + self.assertEqual(inst.item[0].adjudication[0].category.coding[0].code, "eligible") + self.assertEqual(inst.item[0].adjudication[1].amount.currency, "USD") + self.assertEqual(inst.item[0].adjudication[1].amount.value, 10.0) + self.assertEqual(inst.item[0].adjudication[1].category.coding[0].code, "copay") + self.assertEqual(inst.item[0].adjudication[2].category.coding[0].code, "eligpercent") + self.assertEqual(inst.item[0].adjudication[2].value, 80.0) + self.assertEqual(inst.item[0].adjudication[3].amount.currency, "USD") + self.assertEqual(inst.item[0].adjudication[3].amount.value, 90.47) + self.assertEqual(inst.item[0].adjudication[3].category.coding[0].code, "benefit") + self.assertEqual(inst.item[0].adjudication[3].reason.coding[0].code, "ar002") + self.assertEqual(inst.item[0].adjudication[3].reason.coding[0].display, "Plan Limit Reached") + self.assertEqual(inst.item[0].adjudication[3].reason.coding[0].system, "http://terminology.hl7.org/CodeSystem/adjudication-reason") + self.assertEqual(inst.item[0].itemSequence, 1) + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.outcome, "complete") + self.assertEqual(inst.payeeType.coding[0].code, "provider") + self.assertEqual(inst.payeeType.coding[0].system, "http://terminology.hl7.org/CodeSystem/payeetype") + self.assertEqual(inst.payment.amount.currency, "USD") + self.assertEqual(inst.payment.amount.value, 100.47) + self.assertEqual(inst.payment.date.date, FHIRDate("2014-08-31").date) + self.assertEqual(inst.payment.date.as_json(), "2014-08-31") + self.assertEqual(inst.payment.identifier.system, "http://www.BenefitsInc.com/fhir/paymentidentifier") + self.assertEqual(inst.payment.identifier.value, "201408-2-1569478") + self.assertEqual(inst.payment.type.coding[0].code, "complete") + self.assertEqual(inst.payment.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-paymenttype") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.subType.coding[0].code, "emergency") + self.assertEqual(inst.subType.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-claimsubtype") + self.assertEqual(inst.text.div, "
A human-readable rendering of the ClaimResponse
") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.total[0].amount.currency, "USD") + self.assertEqual(inst.total[0].amount.value, 135.57) + self.assertEqual(inst.total[0].category.coding[0].code, "submitted") + self.assertEqual(inst.total[1].amount.currency, "USD") + self.assertEqual(inst.total[1].amount.value, 90.47) + self.assertEqual(inst.total[1].category.coding[0].code, "benefit") + self.assertEqual(inst.type.coding[0].code, "oral") + self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") + self.assertEqual(inst.use, "claim") + + def testClaimResponse3(self): + inst = self.instantiate_from("claimresponse-example-additem.json") + self.assertIsNotNone(inst, "Must have instantiated a ClaimResponse instance") + self.implClaimResponse3(inst) + + js = inst.as_json() + self.assertEqual("ClaimResponse", js["resourceType"]) + inst2 = claimresponse.ClaimResponse(js) + self.implClaimResponse3(inst2) + + def implClaimResponse3(self, inst): self.assertEqual(inst.addItem[0].adjudication[0].amount.currency, "USD") self.assertEqual(inst.addItem[0].adjudication[0].amount.value, 100.0) self.assertEqual(inst.addItem[0].adjudication[0].category.coding[0].code, "eligible") @@ -244,78 +305,56 @@ def implClaimResponse2(self, inst): self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") self.assertEqual(inst.use, "claim") - def testClaimResponse3(self): - inst = self.instantiate_from("claimresponse-example.json") + def testClaimResponse4(self): + inst = self.instantiate_from("claimresponse-example-2.json") self.assertIsNotNone(inst, "Must have instantiated a ClaimResponse instance") - self.implClaimResponse3(inst) + self.implClaimResponse4(inst) js = inst.as_json() self.assertEqual("ClaimResponse", js["resourceType"]) inst2 = claimresponse.ClaimResponse(js) - self.implClaimResponse3(inst2) + self.implClaimResponse4(inst2) - def implClaimResponse3(self, inst): + def implClaimResponse4(self, inst): self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) self.assertEqual(inst.created.as_json(), "2014-08-16") - self.assertEqual(inst.disposition, "Claim settled as per contract.") - self.assertEqual(inst.id, "R3500") + self.assertEqual(inst.disposition, "Claim could not be processed") + self.assertEqual(inst.error[0].code.coding[0].code, "a002") + self.assertEqual(inst.error[0].code.coding[0].system, "http://terminology.hl7.org/CodeSystem/adjudication-error") + self.assertEqual(inst.error[0].detailSequence, 2) + self.assertEqual(inst.error[0].itemSequence, 3) + self.assertEqual(inst.formCode.coding[0].code, "2") + self.assertEqual(inst.formCode.coding[0].system, "http://terminology.hl7.org/CodeSystem/forms-codes") + self.assertEqual(inst.id, "R3501") self.assertEqual(inst.identifier[0].system, "http://www.BenefitsInc.com/fhir/remittance") - self.assertEqual(inst.identifier[0].value, "R3500") - self.assertEqual(inst.item[0].adjudication[0].amount.currency, "USD") - self.assertEqual(inst.item[0].adjudication[0].amount.value, 135.57) - self.assertEqual(inst.item[0].adjudication[0].category.coding[0].code, "eligible") - self.assertEqual(inst.item[0].adjudication[1].amount.currency, "USD") - self.assertEqual(inst.item[0].adjudication[1].amount.value, 10.0) - self.assertEqual(inst.item[0].adjudication[1].category.coding[0].code, "copay") - self.assertEqual(inst.item[0].adjudication[2].category.coding[0].code, "eligpercent") - self.assertEqual(inst.item[0].adjudication[2].value, 80.0) - self.assertEqual(inst.item[0].adjudication[3].amount.currency, "USD") - self.assertEqual(inst.item[0].adjudication[3].amount.value, 90.47) - self.assertEqual(inst.item[0].adjudication[3].category.coding[0].code, "benefit") - self.assertEqual(inst.item[0].adjudication[3].reason.coding[0].code, "ar002") - self.assertEqual(inst.item[0].adjudication[3].reason.coding[0].display, "Plan Limit Reached") - self.assertEqual(inst.item[0].adjudication[3].reason.coding[0].system, "http://terminology.hl7.org/CodeSystem/adjudication-reason") - self.assertEqual(inst.item[0].itemSequence, 1) + self.assertEqual(inst.identifier[0].value, "R3501") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.outcome, "complete") - self.assertEqual(inst.payeeType.coding[0].code, "provider") - self.assertEqual(inst.payeeType.coding[0].system, "http://terminology.hl7.org/CodeSystem/payeetype") - self.assertEqual(inst.payment.amount.currency, "USD") - self.assertEqual(inst.payment.amount.value, 100.47) - self.assertEqual(inst.payment.date.date, FHIRDate("2014-08-31").date) - self.assertEqual(inst.payment.date.as_json(), "2014-08-31") - self.assertEqual(inst.payment.identifier.system, "http://www.BenefitsInc.com/fhir/paymentidentifier") - self.assertEqual(inst.payment.identifier.value, "201408-2-1569478") - self.assertEqual(inst.payment.type.coding[0].code, "complete") - self.assertEqual(inst.payment.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-paymenttype") + self.assertEqual(inst.outcome, "error") + self.assertEqual(inst.processNote[0].language.coding[0].code, "en-CA") + self.assertEqual(inst.processNote[0].language.coding[0].system, "urn:ietf:bcp:47") + self.assertEqual(inst.processNote[0].number, 1) + self.assertEqual(inst.processNote[0].text, "Invalid claim") + self.assertEqual(inst.processNote[0].type, "display") self.assertEqual(inst.status, "active") - self.assertEqual(inst.subType.coding[0].code, "emergency") - self.assertEqual(inst.subType.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-claimsubtype") - self.assertEqual(inst.text.div, "
A human-readable rendering of the ClaimResponse
") + self.assertEqual(inst.text.div, "
A human-readable rendering of the ClaimResponse that demonstrates returning errors
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.total[0].amount.currency, "USD") - self.assertEqual(inst.total[0].amount.value, 135.57) - self.assertEqual(inst.total[0].category.coding[0].code, "submitted") - self.assertEqual(inst.total[1].amount.currency, "USD") - self.assertEqual(inst.total[1].amount.value, 90.47) - self.assertEqual(inst.total[1].category.coding[0].code, "benefit") self.assertEqual(inst.type.coding[0].code, "oral") self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") self.assertEqual(inst.use, "claim") - def testClaimResponse4(self): + def testClaimResponse5(self): inst = self.instantiate_from("claimresponse-example-vision-3tier.json") self.assertIsNotNone(inst, "Must have instantiated a ClaimResponse instance") - self.implClaimResponse4(inst) + self.implClaimResponse5(inst) js = inst.as_json() self.assertEqual("ClaimResponse", js["resourceType"]) inst2 = claimresponse.ClaimResponse(js) - self.implClaimResponse4(inst2) + self.implClaimResponse5(inst2) - def implClaimResponse4(self, inst): + def implClaimResponse5(self, inst): self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) self.assertEqual(inst.created.as_json(), "2014-08-16") self.assertEqual(inst.disposition, "Claim settled as per contract.") @@ -432,43 +471,4 @@ def implClaimResponse4(self, inst): self.assertEqual(inst.type.coding[0].code, "vision") self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") self.assertEqual(inst.use, "claim") - - def testClaimResponse5(self): - inst = self.instantiate_from("claimresponse-example-2.json") - self.assertIsNotNone(inst, "Must have instantiated a ClaimResponse instance") - self.implClaimResponse5(inst) - - js = inst.as_json() - self.assertEqual("ClaimResponse", js["resourceType"]) - inst2 = claimresponse.ClaimResponse(js) - self.implClaimResponse5(inst2) - - def implClaimResponse5(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.created.as_json(), "2014-08-16") - self.assertEqual(inst.disposition, "Claim could not be processed") - self.assertEqual(inst.error[0].code.coding[0].code, "a002") - self.assertEqual(inst.error[0].code.coding[0].system, "http://terminology.hl7.org/CodeSystem/adjudication-error") - self.assertEqual(inst.error[0].detailSequence, 2) - self.assertEqual(inst.error[0].itemSequence, 3) - self.assertEqual(inst.formCode.coding[0].code, "2") - self.assertEqual(inst.formCode.coding[0].system, "http://terminology.hl7.org/CodeSystem/forms-codes") - self.assertEqual(inst.id, "R3501") - self.assertEqual(inst.identifier[0].system, "http://www.BenefitsInc.com/fhir/remittance") - self.assertEqual(inst.identifier[0].value, "R3501") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.outcome, "error") - self.assertEqual(inst.processNote[0].language.coding[0].code, "en-CA") - self.assertEqual(inst.processNote[0].language.coding[0].system, "urn:ietf:bcp:47") - self.assertEqual(inst.processNote[0].number, 1) - self.assertEqual(inst.processNote[0].text, "Invalid claim") - self.assertEqual(inst.processNote[0].type, "display") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.div, "
A human-readable rendering of the ClaimResponse that demonstrates returning errors
") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.coding[0].code, "oral") - self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") - self.assertEqual(inst.use, "claim") diff --git a/fhirclient/models/clinicalimpression.py b/fhirclient/models/clinicalimpression.py index dbd825c4f..69e71d2ef 100644 --- a/fhirclient/models/clinicalimpression.py +++ b/fhirclient/models/clinicalimpression.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ClinicalImpression) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ClinicalImpression) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -95,7 +95,7 @@ def __init__(self, jsondict=None, strict=True): List of `str` items. """ self.status = None - """ draft | completed | entered-in-error. + """ in-progress | completed | entered-in-error. Type `str`. """ self.statusReason = None diff --git a/fhirclient/models/clinicalimpression_tests.py b/fhirclient/models/clinicalimpression_tests.py index dc097f927..69de64541 100644 --- a/fhirclient/models/clinicalimpression_tests.py +++ b/fhirclient/models/clinicalimpression_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/codeableconcept.py b/fhirclient/models/codeableconcept.py index 62b9d6207..3f912dc4c 100644 --- a/fhirclient/models/codeableconcept.py +++ b/fhirclient/models/codeableconcept.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/CodeableConcept) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CodeableConcept) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/codesystem.py b/fhirclient/models/codesystem.py index 7f2a8dc11..9e566ca56 100644 --- a/fhirclient/models/codesystem.py +++ b/fhirclient/models/codesystem.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/CodeSystem) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CodeSystem) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -358,7 +358,8 @@ def __init__(self, jsondict=None, strict=True): Type `str`. """ self.operator = None - """ Operators that can be used with filter. + """ = | is-a | descendent-of | is-not-a | regex | in | not-in | + generalizes | exists. List of `str` items. """ self.value = None diff --git a/fhirclient/models/codesystem_tests.py b/fhirclient/models/codesystem_tests.py index 523f28ab9..47da6c1db 100644 --- a/fhirclient/models/codesystem_tests.py +++ b/fhirclient/models/codesystem_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return codesystem.CodeSystem(js) def testCodeSystem1(self): - inst = self.instantiate_from("codesystem-example-supplement.json") + inst = self.instantiate_from("codesystem-example-summary.json") self.assertIsNotNone(inst, "Must have instantiated a CodeSystem instance") self.implCodeSystem1(inst) @@ -32,33 +32,28 @@ def testCodeSystem1(self): self.implCodeSystem1(inst2) def implCodeSystem1(self, inst): - self.assertEqual(inst.concept[0].code, "chol-mmol") - self.assertEqual(inst.concept[0].property[0].code, "legacy") - self.assertFalse(inst.concept[0].property[0].valueBoolean) - self.assertEqual(inst.concept[1].code, "chol-mass") - self.assertEqual(inst.concept[1].property[0].code, "legacy") - self.assertTrue(inst.concept[1].property[0].valueBoolean) - self.assertEqual(inst.concept[2].code, "chol") - self.assertEqual(inst.concept[2].property[0].code, "legacy") - self.assertTrue(inst.concept[2].property[0].valueBoolean) + self.assertTrue(inst.caseSensitive) self.assertEqual(inst.contact[0].name, "FHIR project team") self.assertEqual(inst.contact[0].telecom[0].system, "url") self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org/fhir") - self.assertEqual(inst.content, "supplement") - self.assertEqual(inst.date.date, FHIRDate("2016-01-28").date) - self.assertEqual(inst.date.as_json(), "2016-01-28") + self.assertEqual(inst.content, "not-present") + self.assertEqual(inst.count, 92) + self.assertEqual(inst.description, "This is an example code system summary for the ACME codes for body site.") self.assertTrue(inst.experimental) - self.assertEqual(inst.id, "example-supplement") - self.assertEqual(inst.name, "CholCodeLegacyStatus") - self.assertEqual(inst.property[0].code, "legacy") - self.assertEqual(inst.property[0].description, "hether the test is currently performed") - self.assertEqual(inst.property[0].type, "boolean") - self.assertEqual(inst.publisher, "ACME Co") + self.assertEqual(inst.id, "summary") + self.assertEqual(inst.jurisdiction[0].coding[0].code, "CA") + self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") + self.assertEqual(inst.name, "Code system summary example for ACME body sites") + self.assertEqual(inst.publisher, "HL7 International") self.assertEqual(inst.status, "draft") - self.assertEqual(inst.supplements, "http://hl7.org/fhir/CodeSystem/example") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.url, "http://hl7.org/fhir/CodeSystem/example-supplement") - self.assertEqual(inst.version, "201801103") + self.assertEqual(inst.url, "http://hl7.org/fhir/CodeSystem/summary") + self.assertEqual(inst.useContext[0].code.code, "species") + self.assertEqual(inst.useContext[0].code.system, "http://example.org/CodeSystem/contexttype") + self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].code, "337915000") + self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].display, "Homo sapiens (organism)") + self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.version, "4.0.1") def testCodeSystem2(self): inst = self.instantiate_from("codesystem-list-example-codes.json") @@ -112,9 +107,9 @@ def implCodeSystem2(self, inst): self.assertEqual(inst.extension[2].valueInteger, 1) self.assertEqual(inst.id, "list-example-codes") self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") - self.assertEqual(inst.identifier[0].value, "urn:oid:2.16.840.1.113883.4.642.1.1105") - self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2018-12-27T22:37:54.724+11:00").date) - self.assertEqual(inst.meta.lastUpdated.as_json(), "2018-12-27T22:37:54.724+11:00") + self.assertEqual(inst.identifier[0].value, "urn:oid:2.16.840.1.113883.4.642.4.1105") + self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2019-11-01T09:29:23.356+11:00").date) + self.assertEqual(inst.meta.lastUpdated.as_json(), "2019-11-01T09:29:23.356+11:00") self.assertEqual(inst.meta.profile[0], "http://hl7.org/fhir/StructureDefinition/shareablecodesystem") self.assertEqual(inst.name, "ExampleUseCodesForList") self.assertEqual(inst.publisher, "FHIR Project") @@ -123,7 +118,7 @@ def implCodeSystem2(self, inst): self.assertEqual(inst.title, "Example Use Codes for List") self.assertEqual(inst.url, "http://terminology.hl7.org/CodeSystem/list-example-use-codes") self.assertEqual(inst.valueSet, "http://hl7.org/fhir/ValueSet/list-example-codes") - self.assertEqual(inst.version, "4.0.0") + self.assertEqual(inst.version, "4.0.1") def testCodeSystem3(self): inst = self.instantiate_from("codesystem-examplescenario-actor-type.json") @@ -148,8 +143,8 @@ def implCodeSystem3(self, inst): self.assertEqual(inst.contact[0].telecom[1].system, "email") self.assertEqual(inst.contact[0].telecom[1].value, "fhir@lists.hl7.org") self.assertEqual(inst.content, "complete") - self.assertEqual(inst.date.date, FHIRDate("2018-12-27T22:37:54+11:00").date) - self.assertEqual(inst.date.as_json(), "2018-12-27T22:37:54+11:00") + self.assertEqual(inst.date.date, FHIRDate("2019-11-01T09:29:23+11:00").date) + self.assertEqual(inst.date.as_json(), "2019-11-01T09:29:23+11:00") self.assertEqual(inst.description, "The type of actor - system or human.") self.assertFalse(inst.experimental) self.assertEqual(inst.extension[0].url, "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg") @@ -160,9 +155,9 @@ def implCodeSystem3(self, inst): self.assertEqual(inst.extension[2].valueInteger, 0) self.assertEqual(inst.id, "examplescenario-actor-type") self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") - self.assertEqual(inst.identifier[0].value, "urn:oid:2.16.840.1.113883.4.642.1.859") - self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2018-12-27T22:37:54.724+11:00").date) - self.assertEqual(inst.meta.lastUpdated.as_json(), "2018-12-27T22:37:54.724+11:00") + self.assertEqual(inst.identifier[0].value, "urn:oid:2.16.840.1.113883.4.642.4.859") + self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2019-11-01T09:29:23.356+11:00").date) + self.assertEqual(inst.meta.lastUpdated.as_json(), "2019-11-01T09:29:23.356+11:00") self.assertEqual(inst.name, "ExampleScenarioActorType") self.assertEqual(inst.publisher, "HL7 (FHIR Project)") self.assertEqual(inst.status, "draft") @@ -170,10 +165,10 @@ def implCodeSystem3(self, inst): self.assertEqual(inst.title, "ExampleScenarioActorType") self.assertEqual(inst.url, "http://hl7.org/fhir/examplescenario-actor-type") self.assertEqual(inst.valueSet, "http://hl7.org/fhir/ValueSet/examplescenario-actor-type") - self.assertEqual(inst.version, "4.0.0") + self.assertEqual(inst.version, "4.0.1") def testCodeSystem4(self): - inst = self.instantiate_from("codesystem-example-summary.json") + inst = self.instantiate_from("codesystem-example.json") self.assertIsNotNone(inst, "Must have instantiated a CodeSystem instance") self.implCodeSystem4(inst) @@ -183,40 +178,6 @@ def testCodeSystem4(self): self.implCodeSystem4(inst2) def implCodeSystem4(self, inst): - self.assertTrue(inst.caseSensitive) - self.assertEqual(inst.contact[0].name, "FHIR project team") - self.assertEqual(inst.contact[0].telecom[0].system, "url") - self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org/fhir") - self.assertEqual(inst.content, "not-present") - self.assertEqual(inst.count, 92) - self.assertEqual(inst.description, "This is an example code system summary for the ACME codes for body site.") - self.assertTrue(inst.experimental) - self.assertEqual(inst.id, "summary") - self.assertEqual(inst.jurisdiction[0].coding[0].code, "CA") - self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") - self.assertEqual(inst.name, "Code system summary example for ACME body sites") - self.assertEqual(inst.publisher, "HL7 International") - self.assertEqual(inst.status, "draft") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.url, "http://hl7.org/fhir/CodeSystem/summary") - self.assertEqual(inst.useContext[0].code.code, "species") - self.assertEqual(inst.useContext[0].code.system, "http://example.org/CodeSystem/contexttype") - self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].code, "337915000") - self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].display, "Homo sapiens (organism)") - self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.version, "4.0.0") - - def testCodeSystem5(self): - inst = self.instantiate_from("codesystem-example.json") - self.assertIsNotNone(inst, "Must have instantiated a CodeSystem instance") - self.implCodeSystem5(inst) - - js = inst.as_json() - self.assertEqual("CodeSystem", js["resourceType"]) - inst2 = codesystem.CodeSystem(js) - self.implCodeSystem5(inst2) - - def implCodeSystem5(self, inst): self.assertTrue(inst.caseSensitive) self.assertEqual(inst.concept[0].code, "chol-mmol") self.assertEqual(inst.concept[0].definition, "Serum Cholesterol, in mmol/L") @@ -259,4 +220,43 @@ def implCodeSystem5(self, inst): self.assertEqual(inst.title, "ACME Codes for Cholesterol in Serum/Plasma") self.assertEqual(inst.url, "http://hl7.org/fhir/CodeSystem/example") self.assertEqual(inst.version, "20160128") + + def testCodeSystem5(self): + inst = self.instantiate_from("codesystem-example-supplement.json") + self.assertIsNotNone(inst, "Must have instantiated a CodeSystem instance") + self.implCodeSystem5(inst) + + js = inst.as_json() + self.assertEqual("CodeSystem", js["resourceType"]) + inst2 = codesystem.CodeSystem(js) + self.implCodeSystem5(inst2) + + def implCodeSystem5(self, inst): + self.assertEqual(inst.concept[0].code, "chol-mmol") + self.assertEqual(inst.concept[0].property[0].code, "legacy") + self.assertFalse(inst.concept[0].property[0].valueBoolean) + self.assertEqual(inst.concept[1].code, "chol-mass") + self.assertEqual(inst.concept[1].property[0].code, "legacy") + self.assertTrue(inst.concept[1].property[0].valueBoolean) + self.assertEqual(inst.concept[2].code, "chol") + self.assertEqual(inst.concept[2].property[0].code, "legacy") + self.assertTrue(inst.concept[2].property[0].valueBoolean) + self.assertEqual(inst.contact[0].name, "FHIR project team") + self.assertEqual(inst.contact[0].telecom[0].system, "url") + self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org/fhir") + self.assertEqual(inst.content, "supplement") + self.assertEqual(inst.date.date, FHIRDate("2016-01-28").date) + self.assertEqual(inst.date.as_json(), "2016-01-28") + self.assertTrue(inst.experimental) + self.assertEqual(inst.id, "example-supplement") + self.assertEqual(inst.name, "CholCodeLegacyStatus") + self.assertEqual(inst.property[0].code, "legacy") + self.assertEqual(inst.property[0].description, "hether the test is currently performed") + self.assertEqual(inst.property[0].type, "boolean") + self.assertEqual(inst.publisher, "ACME Co") + self.assertEqual(inst.status, "draft") + self.assertEqual(inst.supplements, "http://hl7.org/fhir/CodeSystem/example") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.url, "http://hl7.org/fhir/CodeSystem/example-supplement") + self.assertEqual(inst.version, "201801103") diff --git a/fhirclient/models/coding.py b/fhirclient/models/coding.py index aca3bd376..f61177fa6 100644 --- a/fhirclient/models/coding.py +++ b/fhirclient/models/coding.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Coding) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Coding) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/communication.py b/fhirclient/models/communication.py index 45ab50d5d..2a225c9e7 100644 --- a/fhirclient/models/communication.py +++ b/fhirclient/models/communication.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Communication) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Communication) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -74,7 +74,7 @@ def __init__(self, jsondict=None, strict=True): List of `CommunicationPayload` items (represented as `dict` in JSON). """ self.priority = None - """ Message urgency. + """ routine | urgent | asap | stat. Type `str`. """ self.reasonCode = None @@ -102,8 +102,8 @@ def __init__(self, jsondict=None, strict=True): Type `FHIRDate` (represented as `str` in JSON). """ self.status = None - """ preparation | in-progress | not-done | suspended | aborted | - completed | entered-in-error. + """ preparation | in-progress | not-done | on-hold | stopped | + completed | entered-in-error | unknown. Type `str`. """ self.statusReason = None diff --git a/fhirclient/models/communication_tests.py b/fhirclient/models/communication_tests.py index 814ca2089..3abdb8211 100644 --- a/fhirclient/models/communication_tests.py +++ b/fhirclient/models/communication_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return communication.Communication(js) def testCommunication1(self): - inst = self.instantiate_from("communication-example-fm-attachment.json") + inst = self.instantiate_from("communication-example.json") self.assertIsNotNone(inst, "Must have instantiated a Communication instance") self.implCommunication1(inst) @@ -32,6 +32,41 @@ def testCommunication1(self): self.implCommunication1(inst2) def implCommunication1(self, inst): + self.assertEqual(inst.category[0].coding[0].code, "Alert") + self.assertEqual(inst.category[0].coding[0].system, "http://acme.org/messagetypes") + self.assertEqual(inst.category[0].text, "Alert") + self.assertEqual(inst.id, "example") + self.assertEqual(inst.identifier[0].system, "urn:oid:1.3.4.5.6.7") + self.assertEqual(inst.identifier[0].type.text, "Paging System") + self.assertEqual(inst.identifier[0].value, "2345678901") + self.assertEqual(inst.instantiatesUri[0], "http://example.org/hyperkalemia") + self.assertEqual(inst.medium[0].coding[0].code, "WRITTEN") + self.assertEqual(inst.medium[0].coding[0].display, "written") + self.assertEqual(inst.medium[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationMode") + self.assertEqual(inst.medium[0].text, "written") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.payload[0].contentString, "Patient 1 has a very high serum potassium value (7.2 mmol/L on 2014-Dec-12 at 5:55 pm)") + self.assertEqual(inst.received.date, FHIRDate("2014-12-12T18:01:11-08:00").date) + self.assertEqual(inst.received.as_json(), "2014-12-12T18:01:11-08:00") + self.assertEqual(inst.sent.date, FHIRDate("2014-12-12T18:01:10-08:00").date) + self.assertEqual(inst.sent.as_json(), "2014-12-12T18:01:10-08:00") + self.assertEqual(inst.status, "completed") + self.assertEqual(inst.text.div, "
Patient has very high serum potassium
") + self.assertEqual(inst.text.status, "generated") + + def testCommunication2(self): + inst = self.instantiate_from("communication-example-fm-attachment.json") + self.assertIsNotNone(inst, "Must have instantiated a Communication instance") + self.implCommunication2(inst) + + js = inst.as_json() + self.assertEqual("Communication", js["resourceType"]) + inst2 = communication.Communication(js) + self.implCommunication2(inst2) + + def implCommunication2(self, inst): self.assertEqual(inst.category[0].coding[0].code, "SolicitedAttachment") self.assertEqual(inst.category[0].coding[0].system, "http://acme.org/messagetypes") self.assertEqual(inst.id, "fm-attachment") @@ -57,17 +92,17 @@ def implCommunication1(self, inst): self.assertEqual(inst.text.div, "
Attachment which is unsolicited
") self.assertEqual(inst.text.status, "generated") - def testCommunication2(self): + def testCommunication3(self): inst = self.instantiate_from("communication-example-fm-solicited-attachment.json") self.assertIsNotNone(inst, "Must have instantiated a Communication instance") - self.implCommunication2(inst) + self.implCommunication3(inst) js = inst.as_json() self.assertEqual("Communication", js["resourceType"]) inst2 = communication.Communication(js) - self.implCommunication2(inst2) + self.implCommunication3(inst2) - def implCommunication2(self, inst): + def implCommunication3(self, inst): self.assertEqual(inst.category[0].coding[0].code, "SolicitedAttachment") self.assertEqual(inst.category[0].coding[0].system, "http://acme.org/messagetypes") self.assertEqual(inst.contained[0].id, "provider") @@ -95,39 +130,4 @@ def implCommunication2(self, inst): self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.div, "
Attachment in response to a Request
") self.assertEqual(inst.text.status, "generated") - - def testCommunication3(self): - inst = self.instantiate_from("communication-example.json") - self.assertIsNotNone(inst, "Must have instantiated a Communication instance") - self.implCommunication3(inst) - - js = inst.as_json() - self.assertEqual("Communication", js["resourceType"]) - inst2 = communication.Communication(js) - self.implCommunication3(inst2) - - def implCommunication3(self, inst): - self.assertEqual(inst.category[0].coding[0].code, "Alert") - self.assertEqual(inst.category[0].coding[0].system, "http://acme.org/messagetypes") - self.assertEqual(inst.category[0].text, "Alert") - self.assertEqual(inst.id, "example") - self.assertEqual(inst.identifier[0].system, "urn:oid:1.3.4.5.6.7") - self.assertEqual(inst.identifier[0].type.text, "Paging System") - self.assertEqual(inst.identifier[0].value, "2345678901") - self.assertEqual(inst.instantiatesUri[0], "http://example.org/hyperkalemia") - self.assertEqual(inst.medium[0].coding[0].code, "WRITTEN") - self.assertEqual(inst.medium[0].coding[0].display, "written") - self.assertEqual(inst.medium[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationMode") - self.assertEqual(inst.medium[0].text, "written") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.payload[0].contentString, "Patient 1 has a very high serum potassium value (7.2 mmol/L on 2014-Dec-12 at 5:55 pm)") - self.assertEqual(inst.received.date, FHIRDate("2014-12-12T18:01:11-08:00").date) - self.assertEqual(inst.received.as_json(), "2014-12-12T18:01:11-08:00") - self.assertEqual(inst.sent.date, FHIRDate("2014-12-12T18:01:10-08:00").date) - self.assertEqual(inst.sent.as_json(), "2014-12-12T18:01:10-08:00") - self.assertEqual(inst.status, "completed") - self.assertEqual(inst.text.div, "
Patient has very high serum potassium
") - self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/communicationrequest.py b/fhirclient/models/communicationrequest.py index 8a3920037..c3ead2c59 100644 --- a/fhirclient/models/communicationrequest.py +++ b/fhirclient/models/communicationrequest.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/CommunicationRequest) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CommunicationRequest) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -78,7 +78,7 @@ def __init__(self, jsondict=None, strict=True): List of `CommunicationRequestPayload` items (represented as `dict` in JSON). """ self.priority = None - """ Message urgency. + """ routine | urgent | asap | stat. Type `str`. """ self.reasonCode = None @@ -106,8 +106,8 @@ def __init__(self, jsondict=None, strict=True): Type `FHIRReference` (represented as `dict` in JSON). """ self.status = None - """ draft | active | suspended | cancelled | completed | entered-in- - error | unknown. + """ draft | active | on-hold | revoked | completed | entered-in-error | + unknown. Type `str`. """ self.statusReason = None diff --git a/fhirclient/models/communicationrequest_tests.py b/fhirclient/models/communicationrequest_tests.py index 0a1ab9495..0f86602fd 100644 --- a/fhirclient/models/communicationrequest_tests.py +++ b/fhirclient/models/communicationrequest_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/compartmentdefinition.py b/fhirclient/models/compartmentdefinition.py index b3f0f8a6b..dfc93d29e 100644 --- a/fhirclient/models/compartmentdefinition.py +++ b/fhirclient/models/compartmentdefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/CompartmentDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CompartmentDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/compartmentdefinition_tests.py b/fhirclient/models/compartmentdefinition_tests.py index 8914fb027..dab05dd34 100644 --- a/fhirclient/models/compartmentdefinition_tests.py +++ b/fhirclient/models/compartmentdefinition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/composition.py b/fhirclient/models/composition.py index 2b7eafba8..0148d7f9c 100644 --- a/fhirclient/models/composition.py +++ b/fhirclient/models/composition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Composition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Composition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/composition_tests.py b/fhirclient/models/composition_tests.py index f729eae91..d782557f8 100644 --- a/fhirclient/models/composition_tests.py +++ b/fhirclient/models/composition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/conceptmap.py b/fhirclient/models/conceptmap.py index 8446928c1..3637b6543 100644 --- a/fhirclient/models/conceptmap.py +++ b/fhirclient/models/conceptmap.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ConceptMap) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ConceptMap) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/conceptmap_tests.py b/fhirclient/models/conceptmap_tests.py index fb58e8078..8bc0c5548 100644 --- a/fhirclient/models/conceptmap_tests.py +++ b/fhirclient/models/conceptmap_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return conceptmap.ConceptMap(js) def testConceptMap1(self): - inst = self.instantiate_from("conceptmap-example.json") + inst = self.instantiate_from("conceptmap-example-specimen-type.json") self.assertIsNotNone(inst, "Must have instantiated a ConceptMap instance") self.implConceptMap1(inst) @@ -32,58 +32,69 @@ def testConceptMap1(self): self.implConceptMap1(inst2) def implConceptMap1(self, inst): - self.assertEqual(inst.contact[0].name, "FHIR project team (example)") self.assertEqual(inst.contact[0].telecom[0].system, "url") self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org/fhir") - self.assertEqual(inst.copyright, "Creative Commons 0") - self.assertEqual(inst.date.date, FHIRDate("2012-06-13").date) - self.assertEqual(inst.date.as_json(), "2012-06-13") - self.assertEqual(inst.description, "A mapping between the FHIR and HL7 v3 AddressUse Code systems") - self.assertTrue(inst.experimental) - self.assertEqual(inst.group[0].element[0].code, "home") - self.assertEqual(inst.group[0].element[0].display, "home") - self.assertEqual(inst.group[0].element[0].target[0].code, "H") - self.assertEqual(inst.group[0].element[0].target[0].display, "home") + self.assertEqual(inst.contact[1].telecom[0].system, "url") + self.assertEqual(inst.contact[1].telecom[0].value, "http://www.phconnect.org/group/laboratorymessagingcommunityofpractice/forum/attachment/download?id=3649725%3AUploadedFile%3A145786") + self.assertEqual(inst.date.date, FHIRDate("2013-07-25").date) + self.assertEqual(inst.date.as_json(), "2013-07-25") + self.assertFalse(inst.experimental) + self.assertEqual(inst.group[0].element[0].code, "ACNE") + self.assertEqual(inst.group[0].element[0].target[0].code, "309068002") self.assertEqual(inst.group[0].element[0].target[0].equivalence, "equivalent") - self.assertEqual(inst.group[0].element[1].code, "work") - self.assertEqual(inst.group[0].element[1].display, "work") - self.assertEqual(inst.group[0].element[1].target[0].code, "WP") - self.assertEqual(inst.group[0].element[1].target[0].display, "work place") + self.assertEqual(inst.group[0].element[1].code, "ACNFLD") + self.assertEqual(inst.group[0].element[1].target[0].code, "119323008") + self.assertEqual(inst.group[0].element[1].target[0].comment, "HL7 term is a historical term. mapped to Pus") self.assertEqual(inst.group[0].element[1].target[0].equivalence, "equivalent") - self.assertEqual(inst.group[0].element[2].code, "temp") - self.assertEqual(inst.group[0].element[2].display, "temp") - self.assertEqual(inst.group[0].element[2].target[0].code, "TMP") - self.assertEqual(inst.group[0].element[2].target[0].display, "temporary address") + self.assertEqual(inst.group[0].element[1].target[0].product[0].property, "TypeModifier") + self.assertEqual(inst.group[0].element[1].target[0].product[0].system, "http://snomed.info/sct") + self.assertEqual(inst.group[0].element[1].target[0].product[0].value, "47002008") + self.assertEqual(inst.group[0].element[2].code, "AIRS") + self.assertEqual(inst.group[0].element[2].target[0].code, "446302006") self.assertEqual(inst.group[0].element[2].target[0].equivalence, "equivalent") - self.assertEqual(inst.group[0].element[3].code, "old") - self.assertEqual(inst.group[0].element[3].display, "old") - self.assertEqual(inst.group[0].element[3].target[0].code, "BAD") - self.assertEqual(inst.group[0].element[3].target[0].comment, "In the HL7 v3 AD, old is handled by the usablePeriod element, but you have to provide a time, there's no simple equivalent of flagging an address as old") - self.assertEqual(inst.group[0].element[3].target[0].display, "bad address") - self.assertEqual(inst.group[0].element[3].target[0].equivalence, "disjoint") - self.assertEqual(inst.group[0].source, "http://hl7.org/fhir/address-use") - self.assertEqual(inst.group[0].target, "http://terminology.hl7.org/CodeSystem/v3-AddressUse") - self.assertEqual(inst.group[0].unmapped.code, "temp") - self.assertEqual(inst.group[0].unmapped.display, "temp") - self.assertEqual(inst.group[0].unmapped.mode, "fixed") - self.assertEqual(inst.id, "101") - self.assertEqual(inst.identifier.system, "urn:ietf:rfc:3986") - self.assertEqual(inst.identifier.value, "urn:uuid:53cd62ee-033e-414c-9f58-3ca97b5ffc3b") - self.assertEqual(inst.jurisdiction[0].coding[0].code, "US") - self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") - self.assertEqual(inst.name, "FHIR-v3-Address-Use") - self.assertEqual(inst.publisher, "HL7, Inc") - self.assertEqual(inst.purpose, "To help implementers map from HL7 v3/CDA to FHIR") - self.assertEqual(inst.sourceUri, "http://hl7.org/fhir/ValueSet/address-use") + self.assertEqual(inst.group[0].element[3].code, "ALL") + self.assertEqual(inst.group[0].element[3].target[0].code, "119376003") + self.assertEqual(inst.group[0].element[3].target[0].equivalence, "equivalent") + self.assertEqual(inst.group[0].element[3].target[0].product[0].property, "TypeModifier") + self.assertEqual(inst.group[0].element[3].target[0].product[0].system, "http://snomed.info/sct") + self.assertEqual(inst.group[0].element[3].target[0].product[0].value, "7970006") + self.assertEqual(inst.group[0].element[4].code, "AMP") + self.assertEqual(inst.group[0].element[4].target[0].code, "408654003") + self.assertEqual(inst.group[0].element[4].target[0].equivalence, "equivalent") + self.assertEqual(inst.group[0].element[4].target[0].product[0].property, "http://snomed.info/id/246380002") + self.assertEqual(inst.group[0].element[4].target[0].product[0].system, "http://snomed.info/sct") + self.assertEqual(inst.group[0].element[4].target[0].product[0].value, "81723002") + self.assertEqual(inst.group[0].element[5].code, "ANGI") + self.assertEqual(inst.group[0].element[5].target[0].code, "119312009") + self.assertEqual(inst.group[0].element[5].target[0].comment, "TBD in detail") + self.assertEqual(inst.group[0].element[5].target[0].equivalence, "equivalent") + self.assertEqual(inst.group[0].element[6].code, "ARTC") + self.assertEqual(inst.group[0].element[6].target[0].code, "119312009") + self.assertEqual(inst.group[0].element[6].target[0].comment, "TBD in detail") + self.assertEqual(inst.group[0].element[6].target[0].equivalence, "equivalent") + self.assertEqual(inst.group[0].element[7].code, "ASERU") + self.assertEqual(inst.group[0].element[7].target[0].comment, "pending") + self.assertEqual(inst.group[0].element[7].target[0].equivalence, "unmatched") + self.assertEqual(inst.group[0].element[8].code, "ASP") + self.assertEqual(inst.group[0].element[8].target[0].code, "119295008") + self.assertEqual(inst.group[0].element[8].target[0].equivalence, "equivalent") + self.assertEqual(inst.group[0].element[8].target[0].product[0].property, "http://snomed.info/id/246380002") + self.assertEqual(inst.group[0].element[8].target[0].product[0].system, "http://snomed.info/sct") + self.assertEqual(inst.group[0].element[8].target[0].product[0].value, "14766002") + self.assertEqual(inst.group[0].element[9].code, "ATTE") + self.assertEqual(inst.group[0].element[9].target[0].comment, "TBD") + self.assertEqual(inst.group[0].element[9].target[0].equivalence, "unmatched") + self.assertEqual(inst.group[0].source, "http://terminology.hl7.org/CodeSystem/v2-0487") + self.assertEqual(inst.group[0].target, "http://snomed.info/sct") + self.assertEqual(inst.id, "102") + self.assertEqual(inst.name, "Specimen mapping from v2 table 0487 to SNOMED CT") + self.assertEqual(inst.publisher, "FHIR project team (original source: LabMCoP)") + self.assertEqual(inst.sourceCanonical, "http://terminology.hl7.org/ValueSet/v2-0487") self.assertEqual(inst.status, "draft") - self.assertEqual(inst.targetUri, "http://terminology.hl7.org/ValueSet/v3-AddressUse") + self.assertEqual(inst.targetCanonical, "http://snomed.info/sct?fhir_vs") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.title, "FHIR/v3 Address Use Mapping") - self.assertEqual(inst.url, "http://hl7.org/fhir/ConceptMap/101") - self.assertEqual(inst.useContext[0].code.code, "venue") - self.assertEqual(inst.useContext[0].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") - self.assertEqual(inst.useContext[0].valueCodeableConcept.text, "for CCDA Usage") - self.assertEqual(inst.version, "4.0.0") + self.assertEqual(inst.url, "http://hl7.org/fhir/ConceptMap/102") + self.assertEqual(inst.version, "4.0.1") def testConceptMap2(self): inst = self.instantiate_from("conceptmap-example-2.json") @@ -126,10 +137,10 @@ def implConceptMap2(self, inst): self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.title, "FHIR Example 2") self.assertEqual(inst.url, "http://hl7.org/fhir/ConceptMap/example2") - self.assertEqual(inst.version, "4.0.0") + self.assertEqual(inst.version, "4.0.1") def testConceptMap3(self): - inst = self.instantiate_from("conceptmap-example-specimen-type.json") + inst = self.instantiate_from("conceptmap-example.json") self.assertIsNotNone(inst, "Must have instantiated a ConceptMap instance") self.implConceptMap3(inst) @@ -139,67 +150,56 @@ def testConceptMap3(self): self.implConceptMap3(inst2) def implConceptMap3(self, inst): + self.assertEqual(inst.contact[0].name, "FHIR project team (example)") self.assertEqual(inst.contact[0].telecom[0].system, "url") self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org/fhir") - self.assertEqual(inst.contact[1].telecom[0].system, "url") - self.assertEqual(inst.contact[1].telecom[0].value, "http://www.phconnect.org/group/laboratorymessagingcommunityofpractice/forum/attachment/download?id=3649725%3AUploadedFile%3A145786") - self.assertEqual(inst.date.date, FHIRDate("2013-07-25").date) - self.assertEqual(inst.date.as_json(), "2013-07-25") - self.assertFalse(inst.experimental) - self.assertEqual(inst.group[0].element[0].code, "ACNE") - self.assertEqual(inst.group[0].element[0].target[0].code, "309068002") + self.assertEqual(inst.copyright, "Creative Commons 0") + self.assertEqual(inst.date.date, FHIRDate("2012-06-13").date) + self.assertEqual(inst.date.as_json(), "2012-06-13") + self.assertEqual(inst.description, "A mapping between the FHIR and HL7 v3 AddressUse Code systems") + self.assertTrue(inst.experimental) + self.assertEqual(inst.group[0].element[0].code, "home") + self.assertEqual(inst.group[0].element[0].display, "home") + self.assertEqual(inst.group[0].element[0].target[0].code, "H") + self.assertEqual(inst.group[0].element[0].target[0].display, "home") self.assertEqual(inst.group[0].element[0].target[0].equivalence, "equivalent") - self.assertEqual(inst.group[0].element[1].code, "ACNFLD") - self.assertEqual(inst.group[0].element[1].target[0].code, "119323008") - self.assertEqual(inst.group[0].element[1].target[0].comment, "HL7 term is a historical term. mapped to Pus") + self.assertEqual(inst.group[0].element[1].code, "work") + self.assertEqual(inst.group[0].element[1].display, "work") + self.assertEqual(inst.group[0].element[1].target[0].code, "WP") + self.assertEqual(inst.group[0].element[1].target[0].display, "work place") self.assertEqual(inst.group[0].element[1].target[0].equivalence, "equivalent") - self.assertEqual(inst.group[0].element[1].target[0].product[0].property, "TypeModifier") - self.assertEqual(inst.group[0].element[1].target[0].product[0].system, "http://snomed.info/sct") - self.assertEqual(inst.group[0].element[1].target[0].product[0].value, "47002008") - self.assertEqual(inst.group[0].element[2].code, "AIRS") - self.assertEqual(inst.group[0].element[2].target[0].code, "446302006") + self.assertEqual(inst.group[0].element[2].code, "temp") + self.assertEqual(inst.group[0].element[2].display, "temp") + self.assertEqual(inst.group[0].element[2].target[0].code, "TMP") + self.assertEqual(inst.group[0].element[2].target[0].display, "temporary address") self.assertEqual(inst.group[0].element[2].target[0].equivalence, "equivalent") - self.assertEqual(inst.group[0].element[3].code, "ALL") - self.assertEqual(inst.group[0].element[3].target[0].code, "119376003") - self.assertEqual(inst.group[0].element[3].target[0].equivalence, "equivalent") - self.assertEqual(inst.group[0].element[3].target[0].product[0].property, "TypeModifier") - self.assertEqual(inst.group[0].element[3].target[0].product[0].system, "http://snomed.info/sct") - self.assertEqual(inst.group[0].element[3].target[0].product[0].value, "7970006") - self.assertEqual(inst.group[0].element[4].code, "AMP") - self.assertEqual(inst.group[0].element[4].target[0].code, "408654003") - self.assertEqual(inst.group[0].element[4].target[0].equivalence, "equivalent") - self.assertEqual(inst.group[0].element[4].target[0].product[0].property, "http://snomed.info/id/246380002") - self.assertEqual(inst.group[0].element[4].target[0].product[0].system, "http://snomed.info/sct") - self.assertEqual(inst.group[0].element[4].target[0].product[0].value, "81723002") - self.assertEqual(inst.group[0].element[5].code, "ANGI") - self.assertEqual(inst.group[0].element[5].target[0].code, "119312009") - self.assertEqual(inst.group[0].element[5].target[0].comment, "TBD in detail") - self.assertEqual(inst.group[0].element[5].target[0].equivalence, "equivalent") - self.assertEqual(inst.group[0].element[6].code, "ARTC") - self.assertEqual(inst.group[0].element[6].target[0].code, "119312009") - self.assertEqual(inst.group[0].element[6].target[0].comment, "TBD in detail") - self.assertEqual(inst.group[0].element[6].target[0].equivalence, "equivalent") - self.assertEqual(inst.group[0].element[7].code, "ASERU") - self.assertEqual(inst.group[0].element[7].target[0].comment, "pending") - self.assertEqual(inst.group[0].element[7].target[0].equivalence, "unmatched") - self.assertEqual(inst.group[0].element[8].code, "ASP") - self.assertEqual(inst.group[0].element[8].target[0].code, "119295008") - self.assertEqual(inst.group[0].element[8].target[0].equivalence, "equivalent") - self.assertEqual(inst.group[0].element[8].target[0].product[0].property, "http://snomed.info/id/246380002") - self.assertEqual(inst.group[0].element[8].target[0].product[0].system, "http://snomed.info/sct") - self.assertEqual(inst.group[0].element[8].target[0].product[0].value, "14766002") - self.assertEqual(inst.group[0].element[9].code, "ATTE") - self.assertEqual(inst.group[0].element[9].target[0].comment, "TBD") - self.assertEqual(inst.group[0].element[9].target[0].equivalence, "unmatched") - self.assertEqual(inst.group[0].source, "http://terminology.hl7.org/CodeSystem/v2-0487") - self.assertEqual(inst.group[0].target, "http://snomed.info/sct") - self.assertEqual(inst.id, "102") - self.assertEqual(inst.name, "Specimen mapping from v2 table 0487 to SNOMED CT") - self.assertEqual(inst.publisher, "FHIR project team (original source: LabMCoP)") - self.assertEqual(inst.sourceCanonical, "http://terminology.hl7.org/ValueSet/v2-0487") + self.assertEqual(inst.group[0].element[3].code, "old") + self.assertEqual(inst.group[0].element[3].display, "old") + self.assertEqual(inst.group[0].element[3].target[0].code, "BAD") + self.assertEqual(inst.group[0].element[3].target[0].comment, "In the HL7 v3 AD, old is handled by the usablePeriod element, but you have to provide a time, there's no simple equivalent of flagging an address as old") + self.assertEqual(inst.group[0].element[3].target[0].display, "bad address") + self.assertEqual(inst.group[0].element[3].target[0].equivalence, "disjoint") + self.assertEqual(inst.group[0].source, "http://hl7.org/fhir/address-use") + self.assertEqual(inst.group[0].target, "http://terminology.hl7.org/CodeSystem/v3-AddressUse") + self.assertEqual(inst.group[0].unmapped.code, "temp") + self.assertEqual(inst.group[0].unmapped.display, "temp") + self.assertEqual(inst.group[0].unmapped.mode, "fixed") + self.assertEqual(inst.id, "101") + self.assertEqual(inst.identifier.system, "urn:ietf:rfc:3986") + self.assertEqual(inst.identifier.value, "urn:uuid:53cd62ee-033e-414c-9f58-3ca97b5ffc3b") + self.assertEqual(inst.jurisdiction[0].coding[0].code, "US") + self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") + self.assertEqual(inst.name, "FHIR-v3-Address-Use") + self.assertEqual(inst.publisher, "HL7, Inc") + self.assertEqual(inst.purpose, "To help implementers map from HL7 v3/CDA to FHIR") + self.assertEqual(inst.sourceUri, "http://hl7.org/fhir/ValueSet/address-use") self.assertEqual(inst.status, "draft") - self.assertEqual(inst.targetCanonical, "http://snomed.info/id?fhir_vs") + self.assertEqual(inst.targetUri, "http://terminology.hl7.org/ValueSet/v3-AddressUse") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.url, "http://hl7.org/fhir/ConceptMap/102") - self.assertEqual(inst.version, "4.0.0") + self.assertEqual(inst.title, "FHIR/v3 Address Use Mapping") + self.assertEqual(inst.url, "http://hl7.org/fhir/ConceptMap/101") + self.assertEqual(inst.useContext[0].code.code, "venue") + self.assertEqual(inst.useContext[0].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") + self.assertEqual(inst.useContext[0].valueCodeableConcept.text, "for CCDA Usage") + self.assertEqual(inst.version, "4.0.1") diff --git a/fhirclient/models/condition.py b/fhirclient/models/condition.py index e83180207..be015fe61 100644 --- a/fhirclient/models/condition.py +++ b/fhirclient/models/condition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Condition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Condition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/condition_tests.py b/fhirclient/models/condition_tests.py index bf95c622f..9512112ed 100644 --- a/fhirclient/models/condition_tests.py +++ b/fhirclient/models/condition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return condition.Condition(js) def testCondition1(self): - inst = self.instantiate_from("condition-example-f003-abscess.json") + inst = self.instantiate_from("condition-example-f204-renal.json") self.assertIsNotNone(inst, "Must have instantiated a Condition instance") self.implCondition1(inst) @@ -32,37 +32,42 @@ def testCondition1(self): self.implCondition1(inst2) def implCondition1(self, inst): - self.assertEqual(inst.bodySite[0].coding[0].code, "280193007") - self.assertEqual(inst.bodySite[0].coding[0].display, "Entire retropharyngeal area") + self.assertEqual(inst.abatementDateTime.date, FHIRDate("2013-03-20").date) + self.assertEqual(inst.abatementDateTime.as_json(), "2013-03-20") + self.assertEqual(inst.bodySite[0].coding[0].code, "181414000") + self.assertEqual(inst.bodySite[0].coding[0].display, "Kidney") self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.category[0].coding[0].code, "439401001") - self.assertEqual(inst.category[0].coding[0].display, "diagnosis") + self.assertEqual(inst.category[0].coding[0].code, "55607006") + self.assertEqual(inst.category[0].coding[0].display, "Problem") self.assertEqual(inst.category[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.clinicalStatus.coding[0].code, "active") + self.assertEqual(inst.category[0].coding[1].code, "problem-list-item") + self.assertEqual(inst.category[0].coding[1].system, "http://terminology.hl7.org/CodeSystem/condition-category") + self.assertEqual(inst.clinicalStatus.coding[0].code, "inactive") self.assertEqual(inst.clinicalStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-clinical") - self.assertEqual(inst.code.coding[0].code, "18099001") - self.assertEqual(inst.code.coding[0].display, "Retropharyngeal abscess") + self.assertEqual(inst.code.coding[0].code, "36225005") + self.assertEqual(inst.code.coding[0].display, "Acute renal insufficiency specified as due to procedure") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.evidence[0].code[0].coding[0].code, "169068008") - self.assertEqual(inst.evidence[0].code[0].coding[0].display, "CT of neck") - self.assertEqual(inst.evidence[0].code[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.id, "f003") + self.assertEqual(inst.id, "f204") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.onsetDateTime.date, FHIRDate("2012-02-27").date) - self.assertEqual(inst.onsetDateTime.as_json(), "2012-02-27") - self.assertEqual(inst.recordedDate.date, FHIRDate("2012-02-20").date) - self.assertEqual(inst.recordedDate.as_json(), "2012-02-20") - self.assertEqual(inst.severity.coding[0].code, "371923003") - self.assertEqual(inst.severity.coding[0].display, "Mild to moderate") + self.assertEqual(inst.note[0].text, "The patient is anuric.") + self.assertEqual(inst.onsetDateTime.date, FHIRDate("2013-03-11").date) + self.assertEqual(inst.onsetDateTime.as_json(), "2013-03-11") + self.assertEqual(inst.recordedDate.date, FHIRDate("2013-03-11").date) + self.assertEqual(inst.recordedDate.as_json(), "2013-03-11") + self.assertEqual(inst.severity.coding[0].code, "24484000") + self.assertEqual(inst.severity.coding[0].display, "Severe") self.assertEqual(inst.severity.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.stage[0].summary.coding[0].code, "14803004") + self.assertEqual(inst.stage[0].summary.coding[0].display, "Temporary") + self.assertEqual(inst.stage[0].summary.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.verificationStatus.coding[0].code, "confirmed") + self.assertEqual(inst.verificationStatus.coding[0].code, "differential") self.assertEqual(inst.verificationStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-ver-status") def testCondition2(self): - inst = self.instantiate_from("condition-example-f203-sepsis.json") + inst = self.instantiate_from("condition-example2.json") self.assertIsNotNone(inst, "Must have instantiated a Condition instance") self.implCondition2(inst) @@ -72,30 +77,21 @@ def testCondition2(self): self.implCondition2(inst2) def implCondition2(self, inst): - self.assertEqual(inst.bodySite[0].coding[0].code, "281158006") - self.assertEqual(inst.bodySite[0].coding[0].display, "Pulmonary vascular structure") - self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.category[0].coding[0].code, "55607006") - self.assertEqual(inst.category[0].coding[0].display, "Problem") - self.assertEqual(inst.category[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.category[0].coding[1].code, "problem-list-item") - self.assertEqual(inst.category[0].coding[1].system, "http://terminology.hl7.org/CodeSystem/condition-category") + self.assertEqual(inst.category[0].coding[0].code, "problem-list-item") + self.assertEqual(inst.category[0].coding[0].display, "Problem List Item") + self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-category") self.assertEqual(inst.clinicalStatus.coding[0].code, "active") self.assertEqual(inst.clinicalStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-clinical") - self.assertEqual(inst.code.coding[0].code, "10001005") - self.assertEqual(inst.code.coding[0].display, "Bacterial sepsis") - self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.id, "f203") + self.assertEqual(inst.code.text, "Asthma") + self.assertEqual(inst.id, "example2") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.onsetDateTime.date, FHIRDate("2013-03-08").date) - self.assertEqual(inst.onsetDateTime.as_json(), "2013-03-08") - self.assertEqual(inst.recordedDate.date, FHIRDate("2013-03-11").date) - self.assertEqual(inst.recordedDate.as_json(), "2013-03-11") - self.assertEqual(inst.severity.coding[0].code, "371924009") - self.assertEqual(inst.severity.coding[0].display, "Moderate to severe") + self.assertEqual(inst.onsetString, "approximately November 2012") + self.assertEqual(inst.severity.coding[0].code, "255604002") + self.assertEqual(inst.severity.coding[0].display, "Mild") self.assertEqual(inst.severity.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.text.div, "
Mild Asthma (Date: 12-Nov 2012)
") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.verificationStatus.coding[0].code, "confirmed") self.assertEqual(inst.verificationStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-ver-status") @@ -132,7 +128,7 @@ def implCondition3(self, inst): self.assertEqual(inst.verificationStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-ver-status") def testCondition4(self): - inst = self.instantiate_from("condition-example-family-history.json") + inst = self.instantiate_from("condition-example-f002-lung.json") self.assertIsNotNone(inst, "Must have instantiated a Condition instance") self.implCondition4(inst) @@ -142,32 +138,6 @@ def testCondition4(self): self.implCondition4(inst2) def implCondition4(self, inst): - self.assertEqual(inst.category[0].coding[0].code, "problem-list-item") - self.assertEqual(inst.category[0].coding[0].display, "Problem List Item") - self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-category") - self.assertEqual(inst.clinicalStatus.coding[0].code, "active") - self.assertEqual(inst.clinicalStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-clinical") - self.assertEqual(inst.code.coding[0].code, "312824007") - self.assertEqual(inst.code.coding[0].display, "Family history of cancer of colon") - self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.id, "family-history") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.text.div, "
Family history of cancer of colon
") - self.assertEqual(inst.text.status, "generated") - - def testCondition5(self): - inst = self.instantiate_from("condition-example-f002-lung.json") - self.assertIsNotNone(inst, "Must have instantiated a Condition instance") - self.implCondition5(inst) - - js = inst.as_json() - self.assertEqual("Condition", js["resourceType"]) - inst2 = condition.Condition(js) - self.implCondition5(inst2) - - def implCondition5(self, inst): self.assertEqual(inst.bodySite[0].coding[0].code, "51185008") self.assertEqual(inst.bodySite[0].coding[0].display, "Thorax") self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") @@ -203,8 +173,47 @@ def implCondition5(self, inst): self.assertEqual(inst.verificationStatus.coding[0].code, "confirmed") self.assertEqual(inst.verificationStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-ver-status") + def testCondition5(self): + inst = self.instantiate_from("condition-example-f203-sepsis.json") + self.assertIsNotNone(inst, "Must have instantiated a Condition instance") + self.implCondition5(inst) + + js = inst.as_json() + self.assertEqual("Condition", js["resourceType"]) + inst2 = condition.Condition(js) + self.implCondition5(inst2) + + def implCondition5(self, inst): + self.assertEqual(inst.bodySite[0].coding[0].code, "281158006") + self.assertEqual(inst.bodySite[0].coding[0].display, "Pulmonary vascular structure") + self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.category[0].coding[0].code, "55607006") + self.assertEqual(inst.category[0].coding[0].display, "Problem") + self.assertEqual(inst.category[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.category[0].coding[1].code, "problem-list-item") + self.assertEqual(inst.category[0].coding[1].system, "http://terminology.hl7.org/CodeSystem/condition-category") + self.assertEqual(inst.clinicalStatus.coding[0].code, "active") + self.assertEqual(inst.clinicalStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-clinical") + self.assertEqual(inst.code.coding[0].code, "10001005") + self.assertEqual(inst.code.coding[0].display, "Bacterial sepsis") + self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.id, "f203") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.onsetDateTime.date, FHIRDate("2013-03-08").date) + self.assertEqual(inst.onsetDateTime.as_json(), "2013-03-08") + self.assertEqual(inst.recordedDate.date, FHIRDate("2013-03-11").date) + self.assertEqual(inst.recordedDate.as_json(), "2013-03-11") + self.assertEqual(inst.severity.coding[0].code, "371924009") + self.assertEqual(inst.severity.coding[0].display, "Moderate to severe") + self.assertEqual(inst.severity.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.verificationStatus.coding[0].code, "confirmed") + self.assertEqual(inst.verificationStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-ver-status") + def testCondition6(self): - inst = self.instantiate_from("condition-example-f205-infection.json") + inst = self.instantiate_from("condition-example.json") self.assertIsNotNone(inst, "Must have instantiated a Condition instance") self.implCondition6(inst) @@ -214,23 +223,38 @@ def testCondition6(self): self.implCondition6(inst2) def implCondition6(self, inst): + self.assertEqual(inst.bodySite[0].coding[0].code, "49521004") + self.assertEqual(inst.bodySite[0].coding[0].display, "Left external ear structure") + self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.bodySite[0].text, "Left Ear") + self.assertEqual(inst.category[0].coding[0].code, "encounter-diagnosis") + self.assertEqual(inst.category[0].coding[0].display, "Encounter Diagnosis") + self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-category") + self.assertEqual(inst.category[0].coding[1].code, "439401001") + self.assertEqual(inst.category[0].coding[1].display, "Diagnosis") + self.assertEqual(inst.category[0].coding[1].system, "http://snomed.info/sct") self.assertEqual(inst.clinicalStatus.coding[0].code, "active") self.assertEqual(inst.clinicalStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-clinical") - self.assertEqual(inst.code.coding[0].code, "87628006") - self.assertEqual(inst.code.coding[0].display, "Bacterial infectious disease") + self.assertEqual(inst.code.coding[0].code, "39065001") + self.assertEqual(inst.code.coding[0].display, "Burn of ear") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.id, "f205") + self.assertEqual(inst.code.text, "Burnt Ear") + self.assertEqual(inst.id, "example") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.recordedDate.date, FHIRDate("2013-04-04").date) - self.assertEqual(inst.recordedDate.as_json(), "2013-04-04") + self.assertEqual(inst.onsetDateTime.date, FHIRDate("2012-05-24").date) + self.assertEqual(inst.onsetDateTime.as_json(), "2012-05-24") + self.assertEqual(inst.severity.coding[0].code, "24484000") + self.assertEqual(inst.severity.coding[0].display, "Severe") + self.assertEqual(inst.severity.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.text.div, "
Severe burn of left ear (Date: 24-May 2012)
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.verificationStatus.coding[0].code, "differential") + self.assertEqual(inst.verificationStatus.coding[0].code, "confirmed") self.assertEqual(inst.verificationStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-ver-status") def testCondition7(self): - inst = self.instantiate_from("condition-example-f204-renal.json") + inst = self.instantiate_from("condition-example-family-history.json") self.assertIsNotNone(inst, "Must have instantiated a Condition instance") self.implCondition7(inst) @@ -240,42 +264,23 @@ def testCondition7(self): self.implCondition7(inst2) def implCondition7(self, inst): - self.assertEqual(inst.abatementDateTime.date, FHIRDate("2013-03-20").date) - self.assertEqual(inst.abatementDateTime.as_json(), "2013-03-20") - self.assertEqual(inst.bodySite[0].coding[0].code, "181414000") - self.assertEqual(inst.bodySite[0].coding[0].display, "Kidney") - self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.category[0].coding[0].code, "55607006") - self.assertEqual(inst.category[0].coding[0].display, "Problem") - self.assertEqual(inst.category[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.category[0].coding[1].code, "problem-list-item") - self.assertEqual(inst.category[0].coding[1].system, "http://terminology.hl7.org/CodeSystem/condition-category") - self.assertEqual(inst.clinicalStatus.coding[0].code, "inactive") + self.assertEqual(inst.category[0].coding[0].code, "problem-list-item") + self.assertEqual(inst.category[0].coding[0].display, "Problem List Item") + self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-category") + self.assertEqual(inst.clinicalStatus.coding[0].code, "active") self.assertEqual(inst.clinicalStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-clinical") - self.assertEqual(inst.code.coding[0].code, "36225005") - self.assertEqual(inst.code.coding[0].display, "Acute renal insufficiency specified as due to procedure") + self.assertEqual(inst.code.coding[0].code, "312824007") + self.assertEqual(inst.code.coding[0].display, "Family history of cancer of colon") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.id, "f204") + self.assertEqual(inst.id, "family-history") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.note[0].text, "The patient is anuric.") - self.assertEqual(inst.onsetDateTime.date, FHIRDate("2013-03-11").date) - self.assertEqual(inst.onsetDateTime.as_json(), "2013-03-11") - self.assertEqual(inst.recordedDate.date, FHIRDate("2013-03-11").date) - self.assertEqual(inst.recordedDate.as_json(), "2013-03-11") - self.assertEqual(inst.severity.coding[0].code, "24484000") - self.assertEqual(inst.severity.coding[0].display, "Severe") - self.assertEqual(inst.severity.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.stage[0].summary.coding[0].code, "14803004") - self.assertEqual(inst.stage[0].summary.coding[0].display, "Temporary") - self.assertEqual(inst.stage[0].summary.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.text.div, "
Family history of cancer of colon
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.verificationStatus.coding[0].code, "differential") - self.assertEqual(inst.verificationStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-ver-status") def testCondition8(self): - inst = self.instantiate_from("condition-example2.json") + inst = self.instantiate_from("condition-example-f003-abscess.json") self.assertIsNotNone(inst, "Must have instantiated a Condition instance") self.implCondition8(inst) @@ -285,27 +290,37 @@ def testCondition8(self): self.implCondition8(inst2) def implCondition8(self, inst): - self.assertEqual(inst.category[0].coding[0].code, "problem-list-item") - self.assertEqual(inst.category[0].coding[0].display, "Problem List Item") - self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-category") + self.assertEqual(inst.bodySite[0].coding[0].code, "280193007") + self.assertEqual(inst.bodySite[0].coding[0].display, "Entire retropharyngeal area") + self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.category[0].coding[0].code, "439401001") + self.assertEqual(inst.category[0].coding[0].display, "diagnosis") + self.assertEqual(inst.category[0].coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.clinicalStatus.coding[0].code, "active") self.assertEqual(inst.clinicalStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-clinical") - self.assertEqual(inst.code.text, "Asthma") - self.assertEqual(inst.id, "example2") + self.assertEqual(inst.code.coding[0].code, "18099001") + self.assertEqual(inst.code.coding[0].display, "Retropharyngeal abscess") + self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.evidence[0].code[0].coding[0].code, "169068008") + self.assertEqual(inst.evidence[0].code[0].coding[0].display, "CT of neck") + self.assertEqual(inst.evidence[0].code[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.id, "f003") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.onsetString, "approximately November 2012") - self.assertEqual(inst.severity.coding[0].code, "255604002") - self.assertEqual(inst.severity.coding[0].display, "Mild") + self.assertEqual(inst.onsetDateTime.date, FHIRDate("2012-02-27").date) + self.assertEqual(inst.onsetDateTime.as_json(), "2012-02-27") + self.assertEqual(inst.recordedDate.date, FHIRDate("2012-02-20").date) + self.assertEqual(inst.recordedDate.as_json(), "2012-02-20") + self.assertEqual(inst.severity.coding[0].code, "371923003") + self.assertEqual(inst.severity.coding[0].display, "Mild to moderate") self.assertEqual(inst.severity.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.text.div, "
Mild Asthma (Date: 12-Nov 2012)
") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.verificationStatus.coding[0].code, "confirmed") self.assertEqual(inst.verificationStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-ver-status") def testCondition9(self): - inst = self.instantiate_from("condition-example-f202-malignancy.json") + inst = self.instantiate_from("condition-example-f205-infection.json") self.assertIsNotNone(inst, "Must have instantiated a Condition instance") self.implCondition9(inst) @@ -315,42 +330,23 @@ def testCondition9(self): self.implCondition9(inst2) def implCondition9(self, inst): - self.assertEqual(inst.abatementAge.code, "a") - self.assertEqual(inst.abatementAge.system, "http://unitsofmeasure.org") - self.assertEqual(inst.abatementAge.unit, "years") - self.assertEqual(inst.abatementAge.value, 54) - self.assertEqual(inst.bodySite[0].coding[0].code, "361355005") - self.assertEqual(inst.bodySite[0].coding[0].display, "Entire head and neck") - self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.category[0].coding[0].code, "encounter-diagnosis") - self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-category") - self.assertEqual(inst.clinicalStatus.coding[0].code, "resolved") + self.assertEqual(inst.clinicalStatus.coding[0].code, "active") self.assertEqual(inst.clinicalStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-clinical") - self.assertEqual(inst.code.coding[0].code, "363346000") - self.assertEqual(inst.code.coding[0].display, "Malignant neoplastic disease") + self.assertEqual(inst.code.coding[0].code, "87628006") + self.assertEqual(inst.code.coding[0].display, "Bacterial infectious disease") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.id, "f202") - self.assertEqual(inst.meta.security[0].code, "TBOO") - self.assertEqual(inst.meta.security[0].display, "taboo") - self.assertEqual(inst.meta.security[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") + self.assertEqual(inst.id, "f205") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.onsetAge.code, "a") - self.assertEqual(inst.onsetAge.system, "http://unitsofmeasure.org") - self.assertEqual(inst.onsetAge.unit, "years") - self.assertEqual(inst.onsetAge.value, 52) - self.assertEqual(inst.recordedDate.date, FHIRDate("2012-12-01").date) - self.assertEqual(inst.recordedDate.as_json(), "2012-12-01") - self.assertEqual(inst.severity.coding[0].code, "24484000") - self.assertEqual(inst.severity.coding[0].display, "Severe") - self.assertEqual(inst.severity.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.recordedDate.date, FHIRDate("2013-04-04").date) + self.assertEqual(inst.recordedDate.as_json(), "2013-04-04") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.verificationStatus.coding[0].code, "confirmed") + self.assertEqual(inst.verificationStatus.coding[0].code, "differential") self.assertEqual(inst.verificationStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-ver-status") def testCondition10(self): - inst = self.instantiate_from("condition-example-f201-fever.json") + inst = self.instantiate_from("condition-example-f001-heart.json") self.assertIsNotNone(inst, "Must have instantiated a Condition instance") self.implCondition10(inst) @@ -360,34 +356,31 @@ def testCondition10(self): self.implCondition10(inst2) def implCondition10(self, inst): - self.assertEqual(inst.abatementString, "around April 9, 2013") - self.assertEqual(inst.bodySite[0].coding[0].code, "38266002") - self.assertEqual(inst.bodySite[0].coding[0].display, "Entire body as a whole") + self.assertEqual(inst.bodySite[0].coding[0].code, "40768004") + self.assertEqual(inst.bodySite[0].coding[0].display, "Left thorax") self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.category[0].coding[0].code, "55607006") - self.assertEqual(inst.category[0].coding[0].display, "Problem") + self.assertEqual(inst.bodySite[0].text, "heart structure") + self.assertEqual(inst.category[0].coding[0].code, "439401001") + self.assertEqual(inst.category[0].coding[0].display, "diagnosis") self.assertEqual(inst.category[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.category[0].coding[1].code, "problem-list-item") - self.assertEqual(inst.category[0].coding[1].system, "http://terminology.hl7.org/CodeSystem/condition-category") - self.assertEqual(inst.clinicalStatus.coding[0].code, "resolved") + self.assertEqual(inst.clinicalStatus.coding[0].code, "active") self.assertEqual(inst.clinicalStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/condition-clinical") - self.assertEqual(inst.code.coding[0].code, "386661006") - self.assertEqual(inst.code.coding[0].display, "Fever") + self.assertEqual(inst.code.coding[0].code, "368009") + self.assertEqual(inst.code.coding[0].display, "Heart valve disorder") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.evidence[0].code[0].coding[0].code, "258710007") - self.assertEqual(inst.evidence[0].code[0].coding[0].display, "degrees C") + self.assertEqual(inst.evidence[0].code[0].coding[0].code, "426396005") + self.assertEqual(inst.evidence[0].code[0].coding[0].display, "Cardiac chest pain") self.assertEqual(inst.evidence[0].code[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.id, "f201") - self.assertEqual(inst.identifier[0].value, "12345") + self.assertEqual(inst.id, "f001") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.onsetDateTime.date, FHIRDate("2013-04-02").date) - self.assertEqual(inst.onsetDateTime.as_json(), "2013-04-02") - self.assertEqual(inst.recordedDate.date, FHIRDate("2013-04-04").date) - self.assertEqual(inst.recordedDate.as_json(), "2013-04-04") - self.assertEqual(inst.severity.coding[0].code, "255604002") - self.assertEqual(inst.severity.coding[0].display, "Mild") + self.assertEqual(inst.onsetDateTime.date, FHIRDate("2011-08-05").date) + self.assertEqual(inst.onsetDateTime.as_json(), "2011-08-05") + self.assertEqual(inst.recordedDate.date, FHIRDate("2011-10-05").date) + self.assertEqual(inst.recordedDate.as_json(), "2011-10-05") + self.assertEqual(inst.severity.coding[0].code, "6736007") + self.assertEqual(inst.severity.coding[0].display, "Moderate") self.assertEqual(inst.severity.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.verificationStatus.coding[0].code, "confirmed") diff --git a/fhirclient/models/consent.py b/fhirclient/models/consent.py index 215ae6b28..431bdd85f 100644 --- a/fhirclient/models/consent.py +++ b/fhirclient/models/consent.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Consent) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Consent) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/consent_tests.py b/fhirclient/models/consent_tests.py index d8157f5b4..a6fa73e0b 100644 --- a/fhirclient/models/consent_tests.py +++ b/fhirclient/models/consent_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return consent.Consent(js) def testConsent1(self): - inst = self.instantiate_from("consent-example-notThis.json") + inst = self.instantiate_from("consent-example-Out.json") self.assertIsNotNone(inst, "Must have instantiated a Consent instance") self.implConsent1(inst) @@ -36,13 +36,14 @@ def implConsent1(self, inst): self.assertEqual(inst.category[0].coding[0].system, "http://loinc.org") self.assertEqual(inst.dateTime.date, FHIRDate("2015-11-18").date) self.assertEqual(inst.dateTime.as_json(), "2015-11-18") - self.assertEqual(inst.id, "consent-example-notThis") + self.assertEqual(inst.id, "consent-example-Out") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.policyRule.coding[0].code, "OPTIN") + self.assertEqual(inst.policyRule.coding[0].code, "OPTOUT") self.assertEqual(inst.policyRule.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.provision.data[0].meaning, "related") + self.assertEqual(inst.provision.actor[0].role.coding[0].code, "CST") + self.assertEqual(inst.provision.actor[0].role.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") self.assertEqual(inst.scope.coding[0].code, "patient-privacy") self.assertEqual(inst.scope.coding[0].system, "http://terminology.hl7.org/CodeSystem/consentscope") self.assertEqual(inst.sourceAttachment.title, "The terms of the consent in lawyer speak.") @@ -50,7 +51,7 @@ def implConsent1(self, inst): self.assertEqual(inst.text.status, "generated") def testConsent2(self): - inst = self.instantiate_from("consent-example-smartonfhir.json") + inst = self.instantiate_from("consent-example.json") self.assertIsNotNone(inst, "Must have instantiated a Consent instance") self.implConsent2(inst) @@ -62,30 +63,26 @@ def testConsent2(self): def implConsent2(self, inst): self.assertEqual(inst.category[0].coding[0].code, "59284-0") self.assertEqual(inst.category[0].coding[0].system, "http://loinc.org") - self.assertEqual(inst.dateTime.date, FHIRDate("2016-06-23T17:02:33+10:00").date) - self.assertEqual(inst.dateTime.as_json(), "2016-06-23T17:02:33+10:00") - self.assertEqual(inst.id, "consent-example-smartonfhir") + self.assertEqual(inst.dateTime.date, FHIRDate("2016-05-11").date) + self.assertEqual(inst.dateTime.as_json(), "2016-05-11") + self.assertEqual(inst.id, "consent-example-basic") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.policyRule.coding[0].code, "OPTIN") self.assertEqual(inst.policyRule.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.provision.period.end.date, FHIRDate("2016-06-23T17:32:33+10:00").date) - self.assertEqual(inst.provision.period.end.as_json(), "2016-06-23T17:32:33+10:00") - self.assertEqual(inst.provision.period.start.date, FHIRDate("2016-06-23T17:02:33+10:00").date) - self.assertEqual(inst.provision.period.start.as_json(), "2016-06-23T17:02:33+10:00") - self.assertEqual(inst.provision.provision[0].action[0].coding[0].code, "access") - self.assertEqual(inst.provision.provision[0].action[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/consentaction") - self.assertEqual(inst.provision.provision[0].class_fhir[0].code, "MedicationRequest") - self.assertEqual(inst.provision.provision[0].class_fhir[0].system, "http://hl7.org/fhir/resource-types") - self.assertEqual(inst.provision.provision[0].type, "permit") + self.assertEqual(inst.provision.period.end.date, FHIRDate("2016-01-01").date) + self.assertEqual(inst.provision.period.end.as_json(), "2016-01-01") + self.assertEqual(inst.provision.period.start.date, FHIRDate("1964-01-01").date) + self.assertEqual(inst.provision.period.start.as_json(), "1964-01-01") self.assertEqual(inst.scope.coding[0].code, "patient-privacy") self.assertEqual(inst.scope.coding[0].system, "http://terminology.hl7.org/CodeSystem/consentscope") + self.assertEqual(inst.sourceAttachment.title, "The terms of the consent in lawyer speak.") self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") def testConsent3(self): - inst = self.instantiate_from("consent-example-notAuthor.json") + inst = self.instantiate_from("consent-example-signature.json") self.assertIsNotNone(inst, "Must have instantiated a Consent instance") self.implConsent3(inst) @@ -95,66 +92,6 @@ def testConsent3(self): self.implConsent3(inst2) def implConsent3(self, inst): - self.assertEqual(inst.category[0].coding[0].code, "59284-0") - self.assertEqual(inst.category[0].coding[0].system, "http://loinc.org") - self.assertEqual(inst.dateTime.date, FHIRDate("2015-11-18").date) - self.assertEqual(inst.dateTime.as_json(), "2015-11-18") - self.assertEqual(inst.id, "consent-example-notAuthor") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.policyRule.coding[0].code, "OPTIN") - self.assertEqual(inst.policyRule.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.provision.actor[0].role.coding[0].code, "CST") - self.assertEqual(inst.provision.actor[0].role.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") - self.assertEqual(inst.scope.coding[0].code, "patient-privacy") - self.assertEqual(inst.scope.coding[0].system, "http://terminology.hl7.org/CodeSystem/consentscope") - self.assertEqual(inst.sourceAttachment.title, "The terms of the consent in lawyer speak.") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "generated") - - def testConsent4(self): - inst = self.instantiate_from("consent-example-notTime.json") - self.assertIsNotNone(inst, "Must have instantiated a Consent instance") - self.implConsent4(inst) - - js = inst.as_json() - self.assertEqual("Consent", js["resourceType"]) - inst2 = consent.Consent(js) - self.implConsent4(inst2) - - def implConsent4(self, inst): - self.assertEqual(inst.category[0].coding[0].code, "59284-0") - self.assertEqual(inst.category[0].coding[0].system, "http://loinc.org") - self.assertEqual(inst.dateTime.date, FHIRDate("2015-11-18").date) - self.assertEqual(inst.dateTime.as_json(), "2015-11-18") - self.assertEqual(inst.id, "consent-example-notTime") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.policyRule.coding[0].code, "OPTIN") - self.assertEqual(inst.policyRule.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.provision.period.end.date, FHIRDate("2015-02-01").date) - self.assertEqual(inst.provision.period.end.as_json(), "2015-02-01") - self.assertEqual(inst.provision.period.start.date, FHIRDate("2015-01-01").date) - self.assertEqual(inst.provision.period.start.as_json(), "2015-01-01") - self.assertEqual(inst.scope.coding[0].code, "patient-privacy") - self.assertEqual(inst.scope.coding[0].system, "http://terminology.hl7.org/CodeSystem/consentscope") - self.assertEqual(inst.sourceAttachment.title, "The terms of the consent in lawyer speak.") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "generated") - - def testConsent5(self): - inst = self.instantiate_from("consent-example-signature.json") - self.assertIsNotNone(inst, "Must have instantiated a Consent instance") - self.implConsent5(inst) - - js = inst.as_json() - self.assertEqual("Consent", js["resourceType"]) - inst2 = consent.Consent(js) - self.implConsent5(inst2) - - def implConsent5(self, inst): self.assertEqual(inst.category[0].coding[0].code, "npp") self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/consentcategorycodes") self.assertEqual(inst.dateTime.date, FHIRDate("2016-05-26T00:41:10-04:00").date) @@ -187,50 +124,17 @@ def implConsent5(self, inst): self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") - def testConsent6(self): - inst = self.instantiate_from("consent-example-notThem.json") - self.assertIsNotNone(inst, "Must have instantiated a Consent instance") - self.implConsent6(inst) - - js = inst.as_json() - self.assertEqual("Consent", js["resourceType"]) - inst2 = consent.Consent(js) - self.implConsent6(inst2) - - def implConsent6(self, inst): - self.assertEqual(inst.category[0].coding[0].code, "59284-0") - self.assertEqual(inst.category[0].coding[0].system, "http://loinc.org") - self.assertEqual(inst.dateTime.date, FHIRDate("2015-11-18").date) - self.assertEqual(inst.dateTime.as_json(), "2015-11-18") - self.assertEqual(inst.id, "consent-example-notThem") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.policyRule.coding[0].code, "OPTIN") - self.assertEqual(inst.policyRule.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.provision.action[0].coding[0].code, "access") - self.assertEqual(inst.provision.action[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/consentaction") - self.assertEqual(inst.provision.action[1].coding[0].code, "correct") - self.assertEqual(inst.provision.action[1].coding[0].system, "http://terminology.hl7.org/CodeSystem/consentaction") - self.assertEqual(inst.provision.actor[0].role.coding[0].code, "PRCP") - self.assertEqual(inst.provision.actor[0].role.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") - self.assertEqual(inst.scope.coding[0].code, "patient-privacy") - self.assertEqual(inst.scope.coding[0].system, "http://terminology.hl7.org/CodeSystem/consentscope") - self.assertEqual(inst.sourceAttachment.title, "The terms of the consent in lawyer speak.") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "generated") - - def testConsent7(self): + def testConsent4(self): inst = self.instantiate_from("consent-example-grantor.json") self.assertIsNotNone(inst, "Must have instantiated a Consent instance") - self.implConsent7(inst) + self.implConsent4(inst) js = inst.as_json() self.assertEqual("Consent", js["resourceType"]) inst2 = consent.Consent(js) - self.implConsent7(inst2) + self.implConsent4(inst2) - def implConsent7(self, inst): + def implConsent4(self, inst): self.assertEqual(inst.category[0].coding[0].code, "INFAO") self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") self.assertEqual(inst.dateTime.date, FHIRDate("2015-11-18").date) @@ -253,51 +157,52 @@ def implConsent7(self, inst): self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") - def testConsent8(self): - inst = self.instantiate_from("consent-example-notOrg.json") + def testConsent5(self): + inst = self.instantiate_from("consent-example-smartonfhir.json") self.assertIsNotNone(inst, "Must have instantiated a Consent instance") - self.implConsent8(inst) + self.implConsent5(inst) js = inst.as_json() self.assertEqual("Consent", js["resourceType"]) inst2 = consent.Consent(js) - self.implConsent8(inst2) + self.implConsent5(inst2) - def implConsent8(self, inst): + def implConsent5(self, inst): self.assertEqual(inst.category[0].coding[0].code, "59284-0") self.assertEqual(inst.category[0].coding[0].system, "http://loinc.org") - self.assertEqual(inst.dateTime.date, FHIRDate("2015-11-18").date) - self.assertEqual(inst.dateTime.as_json(), "2015-11-18") - self.assertEqual(inst.id, "consent-example-notOrg") + self.assertEqual(inst.dateTime.date, FHIRDate("2016-06-23T17:02:33+10:00").date) + self.assertEqual(inst.dateTime.as_json(), "2016-06-23T17:02:33+10:00") + self.assertEqual(inst.id, "consent-example-smartonfhir") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.policyRule.coding[0].code, "OPTIN") self.assertEqual(inst.policyRule.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.provision.action[0].coding[0].code, "access") - self.assertEqual(inst.provision.action[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/consentaction") - self.assertEqual(inst.provision.action[1].coding[0].code, "correct") - self.assertEqual(inst.provision.action[1].coding[0].system, "http://terminology.hl7.org/CodeSystem/consentaction") - self.assertEqual(inst.provision.actor[0].role.coding[0].code, "PRCP") - self.assertEqual(inst.provision.actor[0].role.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") - self.assertEqual(inst.provision.type, "deny") + self.assertEqual(inst.provision.period.end.date, FHIRDate("2016-06-23T17:32:33+10:00").date) + self.assertEqual(inst.provision.period.end.as_json(), "2016-06-23T17:32:33+10:00") + self.assertEqual(inst.provision.period.start.date, FHIRDate("2016-06-23T17:02:33+10:00").date) + self.assertEqual(inst.provision.period.start.as_json(), "2016-06-23T17:02:33+10:00") + self.assertEqual(inst.provision.provision[0].action[0].coding[0].code, "access") + self.assertEqual(inst.provision.provision[0].action[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/consentaction") + self.assertEqual(inst.provision.provision[0].class_fhir[0].code, "MedicationRequest") + self.assertEqual(inst.provision.provision[0].class_fhir[0].system, "http://hl7.org/fhir/resource-types") + self.assertEqual(inst.provision.provision[0].type, "permit") self.assertEqual(inst.scope.coding[0].code, "patient-privacy") self.assertEqual(inst.scope.coding[0].system, "http://terminology.hl7.org/CodeSystem/consentscope") - self.assertEqual(inst.sourceAttachment.title, "The terms of the consent in lawyer speak.") self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") - def testConsent9(self): + def testConsent6(self): inst = self.instantiate_from("consent-example-pkb.json") self.assertIsNotNone(inst, "Must have instantiated a Consent instance") - self.implConsent9(inst) + self.implConsent6(inst) js = inst.as_json() self.assertEqual("Consent", js["resourceType"]) inst2 = consent.Consent(js) - self.implConsent9(inst2) + self.implConsent6(inst2) - def implConsent9(self, inst): + def implConsent6(self, inst): self.assertEqual(inst.category[0].coding[0].code, "59284-0") self.assertEqual(inst.category[0].coding[0].system, "http://loinc.org") self.assertEqual(inst.dateTime.date, FHIRDate("2016-06-16").date) @@ -379,8 +284,96 @@ def implConsent9(self, inst): self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") + def testConsent7(self): + inst = self.instantiate_from("consent-example-notTime.json") + self.assertIsNotNone(inst, "Must have instantiated a Consent instance") + self.implConsent7(inst) + + js = inst.as_json() + self.assertEqual("Consent", js["resourceType"]) + inst2 = consent.Consent(js) + self.implConsent7(inst2) + + def implConsent7(self, inst): + self.assertEqual(inst.category[0].coding[0].code, "59284-0") + self.assertEqual(inst.category[0].coding[0].system, "http://loinc.org") + self.assertEqual(inst.dateTime.date, FHIRDate("2015-11-18").date) + self.assertEqual(inst.dateTime.as_json(), "2015-11-18") + self.assertEqual(inst.id, "consent-example-notTime") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.policyRule.coding[0].code, "OPTIN") + self.assertEqual(inst.policyRule.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") + self.assertEqual(inst.provision.period.end.date, FHIRDate("2015-02-01").date) + self.assertEqual(inst.provision.period.end.as_json(), "2015-02-01") + self.assertEqual(inst.provision.period.start.date, FHIRDate("2015-01-01").date) + self.assertEqual(inst.provision.period.start.as_json(), "2015-01-01") + self.assertEqual(inst.scope.coding[0].code, "patient-privacy") + self.assertEqual(inst.scope.coding[0].system, "http://terminology.hl7.org/CodeSystem/consentscope") + self.assertEqual(inst.sourceAttachment.title, "The terms of the consent in lawyer speak.") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.status, "generated") + + def testConsent8(self): + inst = self.instantiate_from("consent-example-notAuthor.json") + self.assertIsNotNone(inst, "Must have instantiated a Consent instance") + self.implConsent8(inst) + + js = inst.as_json() + self.assertEqual("Consent", js["resourceType"]) + inst2 = consent.Consent(js) + self.implConsent8(inst2) + + def implConsent8(self, inst): + self.assertEqual(inst.category[0].coding[0].code, "59284-0") + self.assertEqual(inst.category[0].coding[0].system, "http://loinc.org") + self.assertEqual(inst.dateTime.date, FHIRDate("2015-11-18").date) + self.assertEqual(inst.dateTime.as_json(), "2015-11-18") + self.assertEqual(inst.id, "consent-example-notAuthor") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.policyRule.coding[0].code, "OPTIN") + self.assertEqual(inst.policyRule.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") + self.assertEqual(inst.provision.actor[0].role.coding[0].code, "CST") + self.assertEqual(inst.provision.actor[0].role.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") + self.assertEqual(inst.scope.coding[0].code, "patient-privacy") + self.assertEqual(inst.scope.coding[0].system, "http://terminology.hl7.org/CodeSystem/consentscope") + self.assertEqual(inst.sourceAttachment.title, "The terms of the consent in lawyer speak.") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.status, "generated") + + def testConsent9(self): + inst = self.instantiate_from("consent-example-notThis.json") + self.assertIsNotNone(inst, "Must have instantiated a Consent instance") + self.implConsent9(inst) + + js = inst.as_json() + self.assertEqual("Consent", js["resourceType"]) + inst2 = consent.Consent(js) + self.implConsent9(inst2) + + def implConsent9(self, inst): + self.assertEqual(inst.category[0].coding[0].code, "59284-0") + self.assertEqual(inst.category[0].coding[0].system, "http://loinc.org") + self.assertEqual(inst.dateTime.date, FHIRDate("2015-11-18").date) + self.assertEqual(inst.dateTime.as_json(), "2015-11-18") + self.assertEqual(inst.id, "consent-example-notThis") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.policyRule.coding[0].code, "OPTIN") + self.assertEqual(inst.policyRule.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") + self.assertEqual(inst.provision.data[0].meaning, "related") + self.assertEqual(inst.scope.coding[0].code, "patient-privacy") + self.assertEqual(inst.scope.coding[0].system, "http://terminology.hl7.org/CodeSystem/consentscope") + self.assertEqual(inst.sourceAttachment.title, "The terms of the consent in lawyer speak.") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.status, "generated") + def testConsent10(self): - inst = self.instantiate_from("consent-example.json") + inst = self.instantiate_from("consent-example-Emergency.json") self.assertIsNotNone(inst, "Must have instantiated a Consent instance") self.implConsent10(inst) @@ -390,20 +383,23 @@ def testConsent10(self): self.implConsent10(inst2) def implConsent10(self, inst): - self.assertEqual(inst.category[0].coding[0].code, "59284-0") - self.assertEqual(inst.category[0].coding[0].system, "http://loinc.org") - self.assertEqual(inst.dateTime.date, FHIRDate("2016-05-11").date) - self.assertEqual(inst.dateTime.as_json(), "2016-05-11") - self.assertEqual(inst.id, "consent-example-basic") + self.assertEqual(inst.category[0].coding[0].code, "EMRGONLY") + self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") + self.assertEqual(inst.dateTime.date, FHIRDate("2015-11-18").date) + self.assertEqual(inst.dateTime.as_json(), "2015-11-18") + self.assertEqual(inst.id, "consent-example-Emergency") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.policyRule.coding[0].code, "OPTIN") + self.assertEqual(inst.policyRule.coding[0].code, "OPTOUT") self.assertEqual(inst.policyRule.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.provision.period.end.date, FHIRDate("2016-01-01").date) - self.assertEqual(inst.provision.period.end.as_json(), "2016-01-01") - self.assertEqual(inst.provision.period.start.date, FHIRDate("1964-01-01").date) - self.assertEqual(inst.provision.period.start.as_json(), "1964-01-01") + self.assertEqual(inst.provision.actor[0].role.coding[0].code, "CST") + self.assertEqual(inst.provision.actor[0].role.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") + self.assertEqual(inst.provision.provision[0].actor[0].role.coding[0].code, "CST") + self.assertEqual(inst.provision.provision[0].actor[0].role.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") + self.assertEqual(inst.provision.provision[0].type, "deny") + self.assertEqual(inst.provision.purpose[0].code, "ETREAT") + self.assertEqual(inst.provision.purpose[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.scope.coding[0].code, "patient-privacy") self.assertEqual(inst.scope.coding[0].system, "http://terminology.hl7.org/CodeSystem/consentscope") self.assertEqual(inst.sourceAttachment.title, "The terms of the consent in lawyer speak.") diff --git a/fhirclient/models/contactdetail.py b/fhirclient/models/contactdetail.py index 6b631a575..8b1763d84 100644 --- a/fhirclient/models/contactdetail.py +++ b/fhirclient/models/contactdetail.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ContactDetail) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ContactDetail) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/contactpoint.py b/fhirclient/models/contactpoint.py index 7e5084e67..b99cae3ab 100644 --- a/fhirclient/models/contactpoint.py +++ b/fhirclient/models/contactpoint.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ContactPoint) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ContactPoint) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/contract.py b/fhirclient/models/contract.py index 7553a5912..33ea6e72a 100644 --- a/fhirclient/models/contract.py +++ b/fhirclient/models/contract.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Contract) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Contract) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -118,8 +118,9 @@ def __init__(self, jsondict=None, strict=True): List of `FHIRReference` items (represented as `dict` in JSON). """ self.status = None - """ draft | active | suspended | cancelled | completed | entered-in- - error | unknown. + """ amended | appended | cancelled | disputed | entered-in-error | + executable | executed | negotiable | offered | policy | rejected | + renewed | revoked | resolved | terminated. Type `str`. """ self.subType = None @@ -239,7 +240,9 @@ def __init__(self, jsondict=None, strict=True): Type `FHIRDate` (represented as `str` in JSON). """ self.publicationStatus = None - """ draft | active | retired | unknown. + """ amended | appended | cancelled | disputed | entered-in-error | + executable | executed | negotiable | offered | policy | rejected | + renewed | revoked | resolved | terminated. Type `str`. """ self.publisher = None diff --git a/fhirclient/models/contract_tests.py b/fhirclient/models/contract_tests.py index 5be488d1a..215a155fd 100644 --- a/fhirclient/models/contract_tests.py +++ b/fhirclient/models/contract_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return contract.Contract(js) def testContract1(self): - inst = self.instantiate_from("pcd-example-notOrg.json") + inst = self.instantiate_from("pcd-example-notThis.json") self.assertIsNotNone(inst, "Must have instantiated a Contract instance") self.implContract1(inst) @@ -33,7 +33,7 @@ def testContract1(self): def implContract1(self, inst): self.assertEqual(inst.friendly[0].contentAttachment.title, "The terms of the consent in friendly consumer speak.") - self.assertEqual(inst.id, "pcd-example-notOrg") + self.assertEqual(inst.id, "pcd-example-notThis") self.assertEqual(inst.issued.date, FHIRDate("2015-11-18").date) self.assertEqual(inst.issued.as_json(), "2015-11-18") self.assertEqual(inst.legal[0].contentAttachment.title, "The terms of the consent in lawyer speak.") @@ -43,16 +43,22 @@ def implContract1(self, inst): self.assertEqual(inst.subType[0].coding[0].code, "Opt-In") self.assertEqual(inst.subType[0].coding[0].display, "Default Authorization with exceptions.") self.assertEqual(inst.subType[0].coding[0].system, "http://www.infoway-inforoute.ca.org/Consent-subtype-codes") + self.assertEqual(inst.term[0].applies.start.date, FHIRDate("2015-11-18").date) + self.assertEqual(inst.term[0].applies.start.as_json(), "2015-11-18") + self.assertEqual(inst.term[0].identifier.system, "http://example.org/fhir/term-items") + self.assertEqual(inst.term[0].identifier.value, "3347689") + self.assertEqual(inst.term[0].issued.date, FHIRDate("2015-11-01").date) + self.assertEqual(inst.term[0].issued.as_json(), "2015-11-01") self.assertEqual(inst.term[0].offer.text, "Withhold this order and any results or related objects from any provider.") - self.assertEqual(inst.term[0].type.coding[0].code, "withhold-from") - self.assertEqual(inst.term[0].type.coding[0].display, "Withhold all data from specified actor entity.") + self.assertEqual(inst.term[0].type.coding[0].code, "withhold-identified-object-and-related") + self.assertEqual(inst.term[0].type.coding[0].display, "Withhold the identified object and any other resources that are related to this object.") self.assertEqual(inst.term[0].type.coding[0].system, "http://example.org/fhir/consent-term-type-codes") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type.coding[0].code, "57016-8") self.assertEqual(inst.type.coding[0].system, "http://loinc.org") def testContract2(self): - inst = self.instantiate_from("contract-example-ins-policy.json") + inst = self.instantiate_from("pcd-example-notLabs.json") self.assertIsNotNone(inst, "Must have instantiated a Contract instance") self.implContract2(inst) @@ -62,52 +68,34 @@ def testContract2(self): self.implContract2(inst2) def implContract2(self, inst): - self.assertEqual(inst.applies.start.date, FHIRDate("2017-01-01").date) - self.assertEqual(inst.applies.start.as_json(), "2017-01-01") - self.assertEqual(inst.id, "INS-101") - self.assertEqual(inst.identifier[0].system, "http://xyz-insurance.com/forms") - self.assertEqual(inst.identifier[0].value, "YCSCWLN(01-2017)") + self.assertEqual(inst.friendly[0].contentAttachment.title, "The terms of the consent in friendly consumer speak.") + self.assertEqual(inst.id, "pcd-example-notLabs") + self.assertEqual(inst.issued.date, FHIRDate("2014-08-17").date) + self.assertEqual(inst.issued.as_json(), "2014-08-17") + self.assertEqual(inst.legal[0].contentAttachment.title, "The terms of the consent in lawyer speak.") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.term[0].asset[0].period[0].start.date, FHIRDate("2017-06-01").date) - self.assertEqual(inst.term[0].asset[0].period[0].start.as_json(), "2017-06-01") - self.assertEqual(inst.term[0].asset[0].subtype[0].text, "sample") - self.assertEqual(inst.term[0].asset[0].type[0].coding[0].code, "RicardianContract") - self.assertEqual(inst.term[0].asset[0].type[0].coding[0].system, "urn:ietf:rfc:3986") - self.assertEqual(inst.term[0].asset[0].valuedItem[0].effectiveTime.date, FHIRDate("1995").date) - self.assertEqual(inst.term[0].asset[0].valuedItem[0].effectiveTime.as_json(), "1995") - self.assertEqual(inst.term[0].asset[0].valuedItem[0].entityCodeableConcept.text, "Ford Bobcat") - self.assertEqual(inst.term[0].asset[0].valuedItem[0].factor, 1.0) - self.assertEqual(inst.term[0].asset[0].valuedItem[0].identifier.system, "http://somewhere.motor-vehicle.com/vin") - self.assertEqual(inst.term[0].asset[0].valuedItem[0].identifier.value, "XXSVT34-7665t952236") - self.assertEqual(inst.term[0].asset[0].valuedItem[0].net.currency, "CAD") - self.assertEqual(inst.term[0].asset[0].valuedItem[0].net.value, 200.0) - self.assertEqual(inst.term[0].asset[0].valuedItem[0].points, 1.0) - self.assertEqual(inst.term[0].asset[0].valuedItem[0].quantity.value, 1) - self.assertEqual(inst.term[0].asset[0].valuedItem[0].unitPrice.currency, "CAD") - self.assertEqual(inst.term[0].asset[0].valuedItem[0].unitPrice.value, 200.0) - self.assertEqual(inst.term[0].group[0].offer.text, "Eligible Providers") - self.assertEqual(inst.term[0].group[1].offer.text, "Responsibility for Payment") - self.assertEqual(inst.term[0].group[2].group[0].group[0].offer.text, "Emergency Room Copay") - self.assertEqual(inst.term[0].group[2].group[0].group[1].offer.text, "Professional Visit Copay") - self.assertEqual(inst.term[0].group[2].group[0].offer.text, "Copays") - self.assertEqual(inst.term[0].group[2].group[1].offer.text, "Calendar Year Deductible") - self.assertEqual(inst.term[0].group[2].group[2].offer.text, "Out-Of-Pocket Maximum") - self.assertEqual(inst.term[0].group[2].group[3].group[0].offer.text, "Ambulance Services") - self.assertEqual(inst.term[0].group[2].group[3].group[1].offer.text, "Dental Services") - self.assertEqual(inst.term[0].group[2].group[3].group[2].offer.text, "Diagnostic Services") - self.assertEqual(inst.term[0].group[2].group[3].group[3].offer.text, "Emergency Room Services") - self.assertEqual(inst.term[0].group[2].group[3].group[4].offer.text, "Hospital Inpatient Care") - self.assertEqual(inst.term[0].group[2].group[3].offer.text, "Medical Services") - self.assertEqual(inst.term[0].group[2].offer.text, "List of Benefits") + self.assertEqual(inst.subType[0].coding[0].code, "Opt-In") + self.assertEqual(inst.subType[0].coding[0].display, "Default Authorization with exceptions.") + self.assertEqual(inst.subType[0].coding[0].system, "http://www.infoway-inforoute.ca.org/Consent-subtype-codes") + self.assertEqual(inst.term[0].group[0].offer.text, "Withhold orders from any provider.") + self.assertEqual(inst.term[0].group[0].subType.coding[0].code, "ServiceRequest") + self.assertEqual(inst.term[0].group[0].subType.coding[0].system, "http://hl7.org/fhir/resource-types") + self.assertEqual(inst.term[0].group[0].type.coding[0].code, "withhold-object-type") + self.assertEqual(inst.term[0].group[0].type.coding[0].system, "http://example.org/fhir/consent-term-type-codes") + self.assertEqual(inst.term[0].group[1].offer.text, "Withhold order results from any provider.") + self.assertEqual(inst.term[0].group[1].subType.coding[0].code, "DiagnosticReport") + self.assertEqual(inst.term[0].group[1].subType.coding[0].system, "http://hl7.org/fhir/resource-types") + self.assertEqual(inst.term[0].group[1].type.coding[0].code, "withhold-object-type") + self.assertEqual(inst.term[0].group[1].type.coding[0].system, "http://example.org/fhir/consent-term-type-codes") + self.assertEqual(inst.term[0].offer.text, "sample") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.coding[0].code, "healthinsurance") - self.assertEqual(inst.type.coding[0].display, "Health Insurance") - self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/contract-type") + self.assertEqual(inst.type.coding[0].code, "57016-8") + self.assertEqual(inst.type.coding[0].system, "http://loinc.org") def testContract3(self): - inst = self.instantiate_from("contract-example-42cfr-part2.json") + inst = self.instantiate_from("pcd-example-notOrg.json") self.assertIsNotNone(inst, "Must have instantiated a Contract instance") self.implContract3(inst) @@ -117,6 +105,66 @@ def testContract3(self): self.implContract3(inst2) def implContract3(self, inst): + self.assertEqual(inst.friendly[0].contentAttachment.title, "The terms of the consent in friendly consumer speak.") + self.assertEqual(inst.id, "pcd-example-notOrg") + self.assertEqual(inst.issued.date, FHIRDate("2015-11-18").date) + self.assertEqual(inst.issued.as_json(), "2015-11-18") + self.assertEqual(inst.legal[0].contentAttachment.title, "The terms of the consent in lawyer speak.") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.subType[0].coding[0].code, "Opt-In") + self.assertEqual(inst.subType[0].coding[0].display, "Default Authorization with exceptions.") + self.assertEqual(inst.subType[0].coding[0].system, "http://www.infoway-inforoute.ca.org/Consent-subtype-codes") + self.assertEqual(inst.term[0].offer.text, "Withhold this order and any results or related objects from any provider.") + self.assertEqual(inst.term[0].type.coding[0].code, "withhold-from") + self.assertEqual(inst.term[0].type.coding[0].display, "Withhold all data from specified actor entity.") + self.assertEqual(inst.term[0].type.coding[0].system, "http://example.org/fhir/consent-term-type-codes") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.type.coding[0].code, "57016-8") + self.assertEqual(inst.type.coding[0].system, "http://loinc.org") + + def testContract4(self): + inst = self.instantiate_from("pcd-example-notAuthor.json") + self.assertIsNotNone(inst, "Must have instantiated a Contract instance") + self.implContract4(inst) + + js = inst.as_json() + self.assertEqual("Contract", js["resourceType"]) + inst2 = contract.Contract(js) + self.implContract4(inst2) + + def implContract4(self, inst): + self.assertEqual(inst.friendly[0].contentAttachment.title, "The terms of the consent in friendly consumer speak.") + self.assertEqual(inst.id, "pcd-example-notAuthor") + self.assertEqual(inst.issued.date, FHIRDate("2015-11-18").date) + self.assertEqual(inst.issued.as_json(), "2015-11-18") + self.assertEqual(inst.legal[0].contentAttachment.title, "The terms of the consent in lawyer speak.") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.subType[0].coding[0].code, "Opt-In") + self.assertEqual(inst.subType[0].coding[0].display, "Default Authorization with exceptions.") + self.assertEqual(inst.subType[0].coding[0].system, "http://www.infoway-inforoute.ca.org/Consent-subtype-codes") + self.assertEqual(inst.term[0].offer.text, "Withhold all data authored by Good Health provider.") + self.assertEqual(inst.term[0].type.coding[0].code, "withhold-authored-by") + self.assertEqual(inst.term[0].type.coding[0].display, "Withhold all data authored by specified actor entity.") + self.assertEqual(inst.term[0].type.coding[0].system, "http://example.org/fhir/consent-term-type-codes") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.type.coding[0].code, "57016-8") + self.assertEqual(inst.type.coding[0].system, "http://loinc.org") + + def testContract5(self): + inst = self.instantiate_from("contract-example-42cfr-part2.json") + self.assertIsNotNone(inst, "Must have instantiated a Contract instance") + self.implContract5(inst) + + js = inst.as_json() + self.assertEqual("Contract", js["resourceType"]) + inst2 = contract.Contract(js) + self.implContract5(inst2) + + def implContract5(self, inst): self.assertEqual(inst.applies.start.date, FHIRDate("2013-11-01T21:18:27-04:00").date) self.assertEqual(inst.applies.start.as_json(), "2013-11-01T21:18:27-04:00") self.assertEqual(inst.contentDerivative.coding[0].code, "registration") @@ -170,81 +218,8 @@ def implContract3(self, inst): self.assertEqual(inst.type.coding[0].system, "http://mdhhs.org/fhir/consentdirective-type") self.assertEqual(inst.type.text, "Opt-in consent directive") - def testContract4(self): - inst = self.instantiate_from("pcd-example-notLabs.json") - self.assertIsNotNone(inst, "Must have instantiated a Contract instance") - self.implContract4(inst) - - js = inst.as_json() - self.assertEqual("Contract", js["resourceType"]) - inst2 = contract.Contract(js) - self.implContract4(inst2) - - def implContract4(self, inst): - self.assertEqual(inst.friendly[0].contentAttachment.title, "The terms of the consent in friendly consumer speak.") - self.assertEqual(inst.id, "pcd-example-notLabs") - self.assertEqual(inst.issued.date, FHIRDate("2014-08-17").date) - self.assertEqual(inst.issued.as_json(), "2014-08-17") - self.assertEqual(inst.legal[0].contentAttachment.title, "The terms of the consent in lawyer speak.") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.subType[0].coding[0].code, "Opt-In") - self.assertEqual(inst.subType[0].coding[0].display, "Default Authorization with exceptions.") - self.assertEqual(inst.subType[0].coding[0].system, "http://www.infoway-inforoute.ca.org/Consent-subtype-codes") - self.assertEqual(inst.term[0].group[0].offer.text, "Withhold orders from any provider.") - self.assertEqual(inst.term[0].group[0].subType.coding[0].code, "ServiceRequest") - self.assertEqual(inst.term[0].group[0].subType.coding[0].system, "http://hl7.org/fhir/resource-types") - self.assertEqual(inst.term[0].group[0].type.coding[0].code, "withhold-object-type") - self.assertEqual(inst.term[0].group[0].type.coding[0].system, "http://example.org/fhir/consent-term-type-codes") - self.assertEqual(inst.term[0].group[1].offer.text, "Withhold order results from any provider.") - self.assertEqual(inst.term[0].group[1].subType.coding[0].code, "DiagnosticReport") - self.assertEqual(inst.term[0].group[1].subType.coding[0].system, "http://hl7.org/fhir/resource-types") - self.assertEqual(inst.term[0].group[1].type.coding[0].code, "withhold-object-type") - self.assertEqual(inst.term[0].group[1].type.coding[0].system, "http://example.org/fhir/consent-term-type-codes") - self.assertEqual(inst.term[0].offer.text, "sample") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.coding[0].code, "57016-8") - self.assertEqual(inst.type.coding[0].system, "http://loinc.org") - - def testContract5(self): - inst = self.instantiate_from("pcd-example-notThem.json") - self.assertIsNotNone(inst, "Must have instantiated a Contract instance") - self.implContract5(inst) - - js = inst.as_json() - self.assertEqual("Contract", js["resourceType"]) - inst2 = contract.Contract(js) - self.implContract5(inst2) - - def implContract5(self, inst): - self.assertEqual(inst.friendly[0].contentAttachment.title, "The terms of the consent in friendly consumer speak.") - self.assertEqual(inst.id, "pcd-example-notThem") - self.assertEqual(inst.issued.date, FHIRDate("2015-11-18").date) - self.assertEqual(inst.issued.as_json(), "2015-11-18") - self.assertEqual(inst.legal[0].contentAttachment.title, "The terms of the consent in lawyer speak.") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.signer[0].signature[0].type[0].code, "1.2.840.10065.1.12.1.1") - self.assertEqual(inst.signer[0].signature[0].type[0].system, "urn:iso-astm:E1762-95:2013") - self.assertEqual(inst.signer[0].signature[0].when.date, FHIRDate("2013-06-08T10:57:34-07:00").date) - self.assertEqual(inst.signer[0].signature[0].when.as_json(), "2013-06-08T10:57:34-07:00") - self.assertEqual(inst.signer[0].type.code, "COVPTY") - self.assertEqual(inst.signer[0].type.system, "http://terminology.hl7.org/CodeSystem/contractsignertypecodes") - self.assertEqual(inst.subType[0].coding[0].code, "Opt-In") - self.assertEqual(inst.subType[0].coding[0].display, "Default Authorization with exceptions.") - self.assertEqual(inst.subType[0].coding[0].system, "http://www.infoway-inforoute.ca.org/Consent-subtype-codes") - self.assertEqual(inst.term[0].offer.text, "Withhold this order and any results or related objects from specified nurse provider.") - self.assertEqual(inst.term[0].type.coding[0].code, "withhold-from") - self.assertEqual(inst.term[0].type.coding[0].display, "Withhold all data from specified actor entity.") - self.assertEqual(inst.term[0].type.coding[0].system, "http://example.org/fhir/consent-term-type-codes") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.coding[0].code, "57016-8") - self.assertEqual(inst.type.coding[0].system, "http://loinc.org") - def testContract6(self): - inst = self.instantiate_from("pcd-example-notAuthor.json") + inst = self.instantiate_from("contract-example-ins-policy.json") self.assertIsNotNone(inst, "Must have instantiated a Contract instance") self.implContract6(inst) @@ -254,24 +229,49 @@ def testContract6(self): self.implContract6(inst2) def implContract6(self, inst): - self.assertEqual(inst.friendly[0].contentAttachment.title, "The terms of the consent in friendly consumer speak.") - self.assertEqual(inst.id, "pcd-example-notAuthor") - self.assertEqual(inst.issued.date, FHIRDate("2015-11-18").date) - self.assertEqual(inst.issued.as_json(), "2015-11-18") - self.assertEqual(inst.legal[0].contentAttachment.title, "The terms of the consent in lawyer speak.") + self.assertEqual(inst.applies.start.date, FHIRDate("2017-01-01").date) + self.assertEqual(inst.applies.start.as_json(), "2017-01-01") + self.assertEqual(inst.id, "INS-101") + self.assertEqual(inst.identifier[0].system, "http://xyz-insurance.com/forms") + self.assertEqual(inst.identifier[0].value, "YCSCWLN(01-2017)") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.subType[0].coding[0].code, "Opt-In") - self.assertEqual(inst.subType[0].coding[0].display, "Default Authorization with exceptions.") - self.assertEqual(inst.subType[0].coding[0].system, "http://www.infoway-inforoute.ca.org/Consent-subtype-codes") - self.assertEqual(inst.term[0].offer.text, "Withhold all data authored by Good Health provider.") - self.assertEqual(inst.term[0].type.coding[0].code, "withhold-authored-by") - self.assertEqual(inst.term[0].type.coding[0].display, "Withhold all data authored by specified actor entity.") - self.assertEqual(inst.term[0].type.coding[0].system, "http://example.org/fhir/consent-term-type-codes") + self.assertEqual(inst.term[0].asset[0].period[0].start.date, FHIRDate("2017-06-01").date) + self.assertEqual(inst.term[0].asset[0].period[0].start.as_json(), "2017-06-01") + self.assertEqual(inst.term[0].asset[0].subtype[0].text, "sample") + self.assertEqual(inst.term[0].asset[0].type[0].coding[0].code, "RicardianContract") + self.assertEqual(inst.term[0].asset[0].type[0].coding[0].system, "urn:ietf:rfc:3986") + self.assertEqual(inst.term[0].asset[0].valuedItem[0].effectiveTime.date, FHIRDate("1995").date) + self.assertEqual(inst.term[0].asset[0].valuedItem[0].effectiveTime.as_json(), "1995") + self.assertEqual(inst.term[0].asset[0].valuedItem[0].entityCodeableConcept.text, "Ford Bobcat") + self.assertEqual(inst.term[0].asset[0].valuedItem[0].factor, 1.0) + self.assertEqual(inst.term[0].asset[0].valuedItem[0].identifier.system, "http://somewhere.motor-vehicle.com/vin") + self.assertEqual(inst.term[0].asset[0].valuedItem[0].identifier.value, "XXSVT34-7665t952236") + self.assertEqual(inst.term[0].asset[0].valuedItem[0].net.currency, "CAD") + self.assertEqual(inst.term[0].asset[0].valuedItem[0].net.value, 200.0) + self.assertEqual(inst.term[0].asset[0].valuedItem[0].points, 1.0) + self.assertEqual(inst.term[0].asset[0].valuedItem[0].quantity.value, 1) + self.assertEqual(inst.term[0].asset[0].valuedItem[0].unitPrice.currency, "CAD") + self.assertEqual(inst.term[0].asset[0].valuedItem[0].unitPrice.value, 200.0) + self.assertEqual(inst.term[0].group[0].offer.text, "Eligible Providers") + self.assertEqual(inst.term[0].group[1].offer.text, "Responsibility for Payment") + self.assertEqual(inst.term[0].group[2].group[0].group[0].offer.text, "Emergency Room Copay") + self.assertEqual(inst.term[0].group[2].group[0].group[1].offer.text, "Professional Visit Copay") + self.assertEqual(inst.term[0].group[2].group[0].offer.text, "Copays") + self.assertEqual(inst.term[0].group[2].group[1].offer.text, "Calendar Year Deductible") + self.assertEqual(inst.term[0].group[2].group[2].offer.text, "Out-Of-Pocket Maximum") + self.assertEqual(inst.term[0].group[2].group[3].group[0].offer.text, "Ambulance Services") + self.assertEqual(inst.term[0].group[2].group[3].group[1].offer.text, "Dental Services") + self.assertEqual(inst.term[0].group[2].group[3].group[2].offer.text, "Diagnostic Services") + self.assertEqual(inst.term[0].group[2].group[3].group[3].offer.text, "Emergency Room Services") + self.assertEqual(inst.term[0].group[2].group[3].group[4].offer.text, "Hospital Inpatient Care") + self.assertEqual(inst.term[0].group[2].group[3].offer.text, "Medical Services") + self.assertEqual(inst.term[0].group[2].offer.text, "List of Benefits") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.coding[0].code, "57016-8") - self.assertEqual(inst.type.coding[0].system, "http://loinc.org") + self.assertEqual(inst.type.coding[0].code, "healthinsurance") + self.assertEqual(inst.type.coding[0].display, "Health Insurance") + self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/contract-type") def testContract7(self): inst = self.instantiate_from("contract-example.json") @@ -316,7 +316,7 @@ def implContract7(self, inst): self.assertEqual(inst.text.status, "generated") def testContract8(self): - inst = self.instantiate_from("pcd-example-notThis.json") + inst = self.instantiate_from("pcd-example-notThem.json") self.assertIsNotNone(inst, "Must have instantiated a Contract instance") self.implContract8(inst) @@ -327,25 +327,25 @@ def testContract8(self): def implContract8(self, inst): self.assertEqual(inst.friendly[0].contentAttachment.title, "The terms of the consent in friendly consumer speak.") - self.assertEqual(inst.id, "pcd-example-notThis") + self.assertEqual(inst.id, "pcd-example-notThem") self.assertEqual(inst.issued.date, FHIRDate("2015-11-18").date) self.assertEqual(inst.issued.as_json(), "2015-11-18") self.assertEqual(inst.legal[0].contentAttachment.title, "The terms of the consent in lawyer speak.") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.signer[0].signature[0].type[0].code, "1.2.840.10065.1.12.1.1") + self.assertEqual(inst.signer[0].signature[0].type[0].system, "urn:iso-astm:E1762-95:2013") + self.assertEqual(inst.signer[0].signature[0].when.date, FHIRDate("2013-06-08T10:57:34-07:00").date) + self.assertEqual(inst.signer[0].signature[0].when.as_json(), "2013-06-08T10:57:34-07:00") + self.assertEqual(inst.signer[0].type.code, "COVPTY") + self.assertEqual(inst.signer[0].type.system, "http://terminology.hl7.org/CodeSystem/contractsignertypecodes") self.assertEqual(inst.subType[0].coding[0].code, "Opt-In") self.assertEqual(inst.subType[0].coding[0].display, "Default Authorization with exceptions.") self.assertEqual(inst.subType[0].coding[0].system, "http://www.infoway-inforoute.ca.org/Consent-subtype-codes") - self.assertEqual(inst.term[0].applies.start.date, FHIRDate("2015-11-18").date) - self.assertEqual(inst.term[0].applies.start.as_json(), "2015-11-18") - self.assertEqual(inst.term[0].identifier.system, "http://example.org/fhir/term-items") - self.assertEqual(inst.term[0].identifier.value, "3347689") - self.assertEqual(inst.term[0].issued.date, FHIRDate("2015-11-01").date) - self.assertEqual(inst.term[0].issued.as_json(), "2015-11-01") - self.assertEqual(inst.term[0].offer.text, "Withhold this order and any results or related objects from any provider.") - self.assertEqual(inst.term[0].type.coding[0].code, "withhold-identified-object-and-related") - self.assertEqual(inst.term[0].type.coding[0].display, "Withhold the identified object and any other resources that are related to this object.") + self.assertEqual(inst.term[0].offer.text, "Withhold this order and any results or related objects from specified nurse provider.") + self.assertEqual(inst.term[0].type.coding[0].code, "withhold-from") + self.assertEqual(inst.term[0].type.coding[0].display, "Withhold all data from specified actor entity.") self.assertEqual(inst.term[0].type.coding[0].system, "http://example.org/fhir/consent-term-type-codes") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type.coding[0].code, "57016-8") diff --git a/fhirclient/models/contributor.py b/fhirclient/models/contributor.py index 138f636c2..d519f8f68 100644 --- a/fhirclient/models/contributor.py +++ b/fhirclient/models/contributor.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Contributor) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Contributor) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/count.py b/fhirclient/models/count.py index 28e8a9336..ace7a58ea 100644 --- a/fhirclient/models/count.py +++ b/fhirclient/models/count.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Count) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Count) on 2024-07-15. +# 2024, SMART Health IT. from . import quantity diff --git a/fhirclient/models/coverage.py b/fhirclient/models/coverage.py index f061e64dd..856c4ee95 100644 --- a/fhirclient/models/coverage.py +++ b/fhirclient/models/coverage.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Coverage) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Coverage) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/coverage_tests.py b/fhirclient/models/coverage_tests.py index 28fdf27ca..793effd83 100644 --- a/fhirclient/models/coverage_tests.py +++ b/fhirclient/models/coverage_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return coverage.Coverage(js) def testCoverage1(self): - inst = self.instantiate_from("coverage-example-2.json") + inst = self.instantiate_from("coverage-example.json") self.assertIsNotNone(inst, "Must have instantiated a Coverage instance") self.implCoverage1(inst) @@ -32,44 +32,55 @@ def testCoverage1(self): self.implCoverage1(inst2) def implCoverage1(self, inst): - self.assertEqual(inst.class_fhir[0].name, "Western Airlines") + self.assertEqual(inst.class_fhir[0].name, "Corporate Baker's Inc. Local #35") self.assertEqual(inst.class_fhir[0].type.coding[0].code, "group") self.assertEqual(inst.class_fhir[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") - self.assertEqual(inst.class_fhir[0].value, "WESTAIR") - self.assertEqual(inst.class_fhir[1].name, "Full Coverage: Medical, Dental, Pharmacy, Vision, EHC") - self.assertEqual(inst.class_fhir[1].type.coding[0].code, "plan") + self.assertEqual(inst.class_fhir[0].value, "CB135") + self.assertEqual(inst.class_fhir[1].name, "Trainee Part-time Benefits") + self.assertEqual(inst.class_fhir[1].type.coding[0].code, "subgroup") self.assertEqual(inst.class_fhir[1].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") - self.assertEqual(inst.class_fhir[1].value, "BG4352") - self.assertEqual(inst.class_fhir[2].name, "Platinum") - self.assertEqual(inst.class_fhir[2].type.coding[0].code, "subplan") + self.assertEqual(inst.class_fhir[1].value, "123") + self.assertEqual(inst.class_fhir[2].name, "Full Coverage: Medical, Dental, Pharmacy, Vision, EHC") + self.assertEqual(inst.class_fhir[2].type.coding[0].code, "plan") self.assertEqual(inst.class_fhir[2].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") - self.assertEqual(inst.class_fhir[2].value, "D15C9") - self.assertEqual(inst.costToBeneficiary[0].exception[0].period.end.date, FHIRDate("2018-12-31").date) - self.assertEqual(inst.costToBeneficiary[0].exception[0].period.end.as_json(), "2018-12-31") - self.assertEqual(inst.costToBeneficiary[0].exception[0].period.start.date, FHIRDate("2018-01-01").date) - self.assertEqual(inst.costToBeneficiary[0].exception[0].period.start.as_json(), "2018-01-01") - self.assertEqual(inst.costToBeneficiary[0].exception[0].type.coding[0].code, "retired") - self.assertEqual(inst.costToBeneficiary[0].exception[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-coverage-financial-exception") - self.assertEqual(inst.costToBeneficiary[0].type.coding[0].code, "gpvisit") - self.assertEqual(inst.costToBeneficiary[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-copay-type") - self.assertEqual(inst.costToBeneficiary[0].valueMoney.currency, "USD") - self.assertEqual(inst.costToBeneficiary[0].valueMoney.value, 20.0) - self.assertEqual(inst.dependent, "1") - self.assertEqual(inst.id, "7546D") - self.assertEqual(inst.identifier[0].system, "http://xyz.com/codes/identifier") - self.assertEqual(inst.identifier[0].value, "AB98761") + self.assertEqual(inst.class_fhir[2].value, "B37FC") + self.assertEqual(inst.class_fhir[3].name, "Includes afterlife benefits") + self.assertEqual(inst.class_fhir[3].type.coding[0].code, "subplan") + self.assertEqual(inst.class_fhir[3].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") + self.assertEqual(inst.class_fhir[3].value, "P7") + self.assertEqual(inst.class_fhir[4].name, "Silver: Family Plan spouse only") + self.assertEqual(inst.class_fhir[4].type.coding[0].code, "class") + self.assertEqual(inst.class_fhir[4].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") + self.assertEqual(inst.class_fhir[4].value, "SILVER") + self.assertEqual(inst.class_fhir[5].name, "Low deductable, max $20 copay") + self.assertEqual(inst.class_fhir[5].type.coding[0].code, "subclass") + self.assertEqual(inst.class_fhir[5].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") + self.assertEqual(inst.class_fhir[5].value, "Tier2") + self.assertEqual(inst.class_fhir[6].type.coding[0].code, "sequence") + self.assertEqual(inst.class_fhir[6].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") + self.assertEqual(inst.class_fhir[6].value, "9") + self.assertEqual(inst.class_fhir[7].type.coding[0].code, "rxid") + self.assertEqual(inst.class_fhir[7].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") + self.assertEqual(inst.class_fhir[7].value, "MDF12345") + self.assertEqual(inst.class_fhir[8].type.coding[0].code, "rxbin") + self.assertEqual(inst.class_fhir[8].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") + self.assertEqual(inst.class_fhir[8].value, "987654") + self.assertEqual(inst.class_fhir[9].type.coding[0].code, "rxgroup") + self.assertEqual(inst.class_fhir[9].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") + self.assertEqual(inst.class_fhir[9].value, "M35PT") + self.assertEqual(inst.dependent, "0") + self.assertEqual(inst.id, "9876B1") + self.assertEqual(inst.identifier[0].system, "http://benefitsinc.com/certificate") + self.assertEqual(inst.identifier[0].value, "12345") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.network, "5") - self.assertEqual(inst.order, 2) - self.assertEqual(inst.period.end.date, FHIRDate("2012-03-17").date) - self.assertEqual(inst.period.end.as_json(), "2012-03-17") - self.assertEqual(inst.period.start.date, FHIRDate("2011-03-17").date) - self.assertEqual(inst.period.start.as_json(), "2011-03-17") + self.assertEqual(inst.period.end.date, FHIRDate("2012-05-23").date) + self.assertEqual(inst.period.end.as_json(), "2012-05-23") + self.assertEqual(inst.period.start.date, FHIRDate("2011-05-23").date) + self.assertEqual(inst.period.start.as_json(), "2011-05-23") self.assertEqual(inst.relationship.coding[0].code, "self") self.assertEqual(inst.status, "active") - self.assertEqual(inst.subscriberId, "AB9876") self.assertEqual(inst.text.div, "
A human-readable rendering of the coverage
") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type.coding[0].code, "EHCPOL") @@ -131,7 +142,7 @@ def implCoverage3(self, inst): self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") def testCoverage4(self): - inst = self.instantiate_from("coverage-example.json") + inst = self.instantiate_from("coverage-example-2.json") self.assertIsNotNone(inst, "Must have instantiated a Coverage instance") self.implCoverage4(inst) @@ -141,55 +152,44 @@ def testCoverage4(self): self.implCoverage4(inst2) def implCoverage4(self, inst): - self.assertEqual(inst.class_fhir[0].name, "Corporate Baker's Inc. Local #35") + self.assertEqual(inst.class_fhir[0].name, "Western Airlines") self.assertEqual(inst.class_fhir[0].type.coding[0].code, "group") self.assertEqual(inst.class_fhir[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") - self.assertEqual(inst.class_fhir[0].value, "CB135") - self.assertEqual(inst.class_fhir[1].name, "Trainee Part-time Benefits") - self.assertEqual(inst.class_fhir[1].type.coding[0].code, "subgroup") + self.assertEqual(inst.class_fhir[0].value, "WESTAIR") + self.assertEqual(inst.class_fhir[1].name, "Full Coverage: Medical, Dental, Pharmacy, Vision, EHC") + self.assertEqual(inst.class_fhir[1].type.coding[0].code, "plan") self.assertEqual(inst.class_fhir[1].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") - self.assertEqual(inst.class_fhir[1].value, "123") - self.assertEqual(inst.class_fhir[2].name, "Full Coverage: Medical, Dental, Pharmacy, Vision, EHC") - self.assertEqual(inst.class_fhir[2].type.coding[0].code, "plan") + self.assertEqual(inst.class_fhir[1].value, "BG4352") + self.assertEqual(inst.class_fhir[2].name, "Platinum") + self.assertEqual(inst.class_fhir[2].type.coding[0].code, "subplan") self.assertEqual(inst.class_fhir[2].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") - self.assertEqual(inst.class_fhir[2].value, "B37FC") - self.assertEqual(inst.class_fhir[3].name, "Includes afterlife benefits") - self.assertEqual(inst.class_fhir[3].type.coding[0].code, "subplan") - self.assertEqual(inst.class_fhir[3].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") - self.assertEqual(inst.class_fhir[3].value, "P7") - self.assertEqual(inst.class_fhir[4].name, "Silver: Family Plan spouse only") - self.assertEqual(inst.class_fhir[4].type.coding[0].code, "class") - self.assertEqual(inst.class_fhir[4].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") - self.assertEqual(inst.class_fhir[4].value, "SILVER") - self.assertEqual(inst.class_fhir[5].name, "Low deductable, max $20 copay") - self.assertEqual(inst.class_fhir[5].type.coding[0].code, "subclass") - self.assertEqual(inst.class_fhir[5].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") - self.assertEqual(inst.class_fhir[5].value, "Tier2") - self.assertEqual(inst.class_fhir[6].type.coding[0].code, "sequence") - self.assertEqual(inst.class_fhir[6].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") - self.assertEqual(inst.class_fhir[6].value, "9") - self.assertEqual(inst.class_fhir[7].type.coding[0].code, "rxid") - self.assertEqual(inst.class_fhir[7].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") - self.assertEqual(inst.class_fhir[7].value, "MDF12345") - self.assertEqual(inst.class_fhir[8].type.coding[0].code, "rxbin") - self.assertEqual(inst.class_fhir[8].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") - self.assertEqual(inst.class_fhir[8].value, "987654") - self.assertEqual(inst.class_fhir[9].type.coding[0].code, "rxgroup") - self.assertEqual(inst.class_fhir[9].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-class") - self.assertEqual(inst.class_fhir[9].value, "M35PT") - self.assertEqual(inst.dependent, "0") - self.assertEqual(inst.id, "9876B1") - self.assertEqual(inst.identifier[0].system, "http://benefitsinc.com/certificate") - self.assertEqual(inst.identifier[0].value, "12345") + self.assertEqual(inst.class_fhir[2].value, "D15C9") + self.assertEqual(inst.costToBeneficiary[0].exception[0].period.end.date, FHIRDate("2018-12-31").date) + self.assertEqual(inst.costToBeneficiary[0].exception[0].period.end.as_json(), "2018-12-31") + self.assertEqual(inst.costToBeneficiary[0].exception[0].period.start.date, FHIRDate("2018-01-01").date) + self.assertEqual(inst.costToBeneficiary[0].exception[0].period.start.as_json(), "2018-01-01") + self.assertEqual(inst.costToBeneficiary[0].exception[0].type.coding[0].code, "retired") + self.assertEqual(inst.costToBeneficiary[0].exception[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-coverage-financial-exception") + self.assertEqual(inst.costToBeneficiary[0].type.coding[0].code, "gpvisit") + self.assertEqual(inst.costToBeneficiary[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/coverage-copay-type") + self.assertEqual(inst.costToBeneficiary[0].valueMoney.currency, "USD") + self.assertEqual(inst.costToBeneficiary[0].valueMoney.value, 20.0) + self.assertEqual(inst.dependent, "1") + self.assertEqual(inst.id, "7546D") + self.assertEqual(inst.identifier[0].system, "http://xyz.com/codes/identifier") + self.assertEqual(inst.identifier[0].value, "AB98761") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.period.end.date, FHIRDate("2012-05-23").date) - self.assertEqual(inst.period.end.as_json(), "2012-05-23") - self.assertEqual(inst.period.start.date, FHIRDate("2011-05-23").date) - self.assertEqual(inst.period.start.as_json(), "2011-05-23") + self.assertEqual(inst.network, "5") + self.assertEqual(inst.order, 2) + self.assertEqual(inst.period.end.date, FHIRDate("2012-03-17").date) + self.assertEqual(inst.period.end.as_json(), "2012-03-17") + self.assertEqual(inst.period.start.date, FHIRDate("2011-03-17").date) + self.assertEqual(inst.period.start.as_json(), "2011-03-17") self.assertEqual(inst.relationship.coding[0].code, "self") self.assertEqual(inst.status, "active") + self.assertEqual(inst.subscriberId, "AB9876") self.assertEqual(inst.text.div, "
A human-readable rendering of the coverage
") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type.coding[0].code, "EHCPOL") diff --git a/fhirclient/models/coverageeligibilityrequest.py b/fhirclient/models/coverageeligibilityrequest.py index f0a0fd213..63286996c 100644 --- a/fhirclient/models/coverageeligibilityrequest.py +++ b/fhirclient/models/coverageeligibilityrequest.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/CoverageEligibilityRequest) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CoverageEligibilityRequest) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/coverageeligibilityrequest_tests.py b/fhirclient/models/coverageeligibilityrequest_tests.py index a5cad2454..cea3434e5 100644 --- a/fhirclient/models/coverageeligibilityrequest_tests.py +++ b/fhirclient/models/coverageeligibilityrequest_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/coverageeligibilityresponse.py b/fhirclient/models/coverageeligibilityresponse.py index 25d924cd4..117d1ea37 100644 --- a/fhirclient/models/coverageeligibilityresponse.py +++ b/fhirclient/models/coverageeligibilityresponse.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/CoverageEligibilityResponse) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CoverageEligibilityResponse) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/coverageeligibilityresponse_tests.py b/fhirclient/models/coverageeligibilityresponse_tests.py index 4bf387ecb..1a97be0ce 100644 --- a/fhirclient/models/coverageeligibilityresponse_tests.py +++ b/fhirclient/models/coverageeligibilityresponse_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -49,7 +49,7 @@ def implCoverageEligibilityResponse1(self, inst): self.assertEqual(inst.text.status, "generated") def testCoverageEligibilityResponse2(self): - inst = self.instantiate_from("coverageeligibilityresponse-example-error.json") + inst = self.instantiate_from("coverageeligibilityresponse-example-benefits.json") self.assertIsNotNone(inst, "Must have instantiated a CoverageEligibilityResponse instance") self.implCoverageEligibilityResponse2(inst) @@ -59,52 +59,17 @@ def testCoverageEligibilityResponse2(self): self.implCoverageEligibilityResponse2(inst2) def implCoverageEligibilityResponse2(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-09-16").date) - self.assertEqual(inst.created.as_json(), "2014-09-16") - self.assertEqual(inst.disposition, "Eligibiliy request could not be processed, please address errors before submitting.") - self.assertEqual(inst.error[0].code.coding[0].code, "a001") - self.assertEqual(inst.error[0].code.coding[0].system, "http://terminology.hl7.org/CodeSystem/adjudication-error") - self.assertEqual(inst.form.coding[0].code, "ELRSP/2017/01") - self.assertEqual(inst.form.coding[0].system, "http://national.org/form") - self.assertEqual(inst.id, "E2503") - self.assertEqual(inst.identifier[0].system, "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse") - self.assertEqual(inst.identifier[0].value, "8812343") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.outcome, "error") - self.assertEqual(inst.purpose[0], "validation") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.div, "
A human-readable rendering of the CoverageEligibilityResponse.
") - self.assertEqual(inst.text.status, "generated") - - def testCoverageEligibilityResponse3(self): - inst = self.instantiate_from("coverageeligibilityresponse-example-benefits-2.json") - self.assertIsNotNone(inst, "Must have instantiated a CoverageEligibilityResponse instance") - self.implCoverageEligibilityResponse3(inst) - - js = inst.as_json() - self.assertEqual("CoverageEligibilityResponse", js["resourceType"]) - inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(js) - self.implCoverageEligibilityResponse3(inst2) - - def implCoverageEligibilityResponse3(self, inst): - self.assertEqual(inst.contained[0].id, "coverage-1") - self.assertEqual(inst.created.date, FHIRDate("2014-09-16").date) - self.assertEqual(inst.created.as_json(), "2014-09-16") + self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.as_json(), "2014-08-16") self.assertEqual(inst.disposition, "Policy is currently in-force.") - self.assertEqual(inst.form.coding[0].code, "ELRSP/2017/01") - self.assertEqual(inst.form.coding[0].system, "http://national.org/form") - self.assertEqual(inst.id, "E2502") + self.assertEqual(inst.id, "E2501") self.assertEqual(inst.identifier[0].system, "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse") - self.assertEqual(inst.identifier[0].value, "8812342") + self.assertEqual(inst.identifier[0].value, "881234") self.assertTrue(inst.insurance[0].inforce) - self.assertEqual(inst.insurance[0].item[0].benefit[0].allowedMoney.currency, "USD") + self.assertEqual(inst.insurance[0].item[0].benefit[0].allowedMoney.currency, "SAR") self.assertEqual(inst.insurance[0].item[0].benefit[0].allowedMoney.value, 500000) self.assertEqual(inst.insurance[0].item[0].benefit[0].type.coding[0].code, "benefit") - self.assertEqual(inst.insurance[0].item[0].benefit[0].usedMoney.currency, "USD") - self.assertEqual(inst.insurance[0].item[0].benefit[0].usedMoney.value, 3748.0) - self.assertEqual(inst.insurance[0].item[0].benefit[1].allowedMoney.currency, "USD") + self.assertEqual(inst.insurance[0].item[0].benefit[1].allowedMoney.currency, "SAR") self.assertEqual(inst.insurance[0].item[0].benefit[1].allowedMoney.value, 100) self.assertEqual(inst.insurance[0].item[0].benefit[1].type.coding[0].code, "copay-maximum") self.assertEqual(inst.insurance[0].item[0].benefit[2].allowedUnsignedInt, 20) @@ -118,7 +83,7 @@ def implCoverageEligibilityResponse3(self, inst): self.assertEqual(inst.insurance[0].item[0].term.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-term") self.assertEqual(inst.insurance[0].item[0].unit.coding[0].code, "individual") self.assertEqual(inst.insurance[0].item[0].unit.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-unit") - self.assertEqual(inst.insurance[0].item[1].benefit[0].allowedMoney.currency, "USD") + self.assertEqual(inst.insurance[0].item[1].benefit[0].allowedMoney.currency, "SAR") self.assertEqual(inst.insurance[0].item[1].benefit[0].allowedMoney.value, 15000) self.assertEqual(inst.insurance[0].item[1].benefit[0].type.coding[0].code, "benefit") self.assertEqual(inst.insurance[0].item[1].category.coding[0].code, "69") @@ -130,7 +95,7 @@ def implCoverageEligibilityResponse3(self, inst): self.assertEqual(inst.insurance[0].item[1].term.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-term") self.assertEqual(inst.insurance[0].item[1].unit.coding[0].code, "individual") self.assertEqual(inst.insurance[0].item[1].unit.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-unit") - self.assertEqual(inst.insurance[0].item[2].benefit[0].allowedMoney.currency, "USD") + self.assertEqual(inst.insurance[0].item[2].benefit[0].allowedMoney.currency, "SAR") self.assertEqual(inst.insurance[0].item[2].benefit[0].allowedMoney.value, 2000) self.assertEqual(inst.insurance[0].item[2].benefit[0].type.coding[0].code, "benefit") self.assertEqual(inst.insurance[0].item[2].category.coding[0].code, "F3") @@ -142,44 +107,71 @@ def implCoverageEligibilityResponse3(self, inst): self.assertEqual(inst.insurance[0].item[2].term.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-term") self.assertEqual(inst.insurance[0].item[2].unit.coding[0].code, "individual") self.assertEqual(inst.insurance[0].item[2].unit.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-unit") + self.assertEqual(inst.insurance[0].item[3].benefit[0].allowedMoney.currency, "SAR") + self.assertEqual(inst.insurance[0].item[3].benefit[0].allowedMoney.value, 400) + self.assertEqual(inst.insurance[0].item[3].benefit[0].type.coding[0].code, "benefit") self.assertEqual(inst.insurance[0].item[3].category.coding[0].code, "F6") self.assertEqual(inst.insurance[0].item[3].category.coding[0].display, "Vision Coverage") self.assertEqual(inst.insurance[0].item[3].category.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-benefitcategory") - self.assertEqual(inst.insurance[0].item[3].description, "Vision products and services such as exams, glasses and contact lenses.") - self.assertTrue(inst.insurance[0].item[3].excluded) - self.assertEqual(inst.insurance[0].item[3].name, "Vision") + self.assertEqual(inst.insurance[0].item[3].network.coding[0].code, "in") + self.assertEqual(inst.insurance[0].item[3].network.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-network") + self.assertEqual(inst.insurance[0].item[3].term.coding[0].code, "annual") + self.assertEqual(inst.insurance[0].item[3].term.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-term") + self.assertEqual(inst.insurance[0].item[3].unit.coding[0].code, "individual") + self.assertEqual(inst.insurance[0].item[3].unit.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-unit") + self.assertEqual(inst.insurance[0].item[4].benefit[0].allowedString, "shared") + self.assertEqual(inst.insurance[0].item[4].benefit[0].type.coding[0].code, "room") + self.assertEqual(inst.insurance[0].item[4].benefit[1].allowedMoney.currency, "SAR") + self.assertEqual(inst.insurance[0].item[4].benefit[1].allowedMoney.value, 600) + self.assertEqual(inst.insurance[0].item[4].benefit[1].type.coding[0].code, "benefit") + self.assertEqual(inst.insurance[0].item[4].category.coding[0].code, "49") + self.assertEqual(inst.insurance[0].item[4].category.coding[0].display, "Hospital Room and Board") + self.assertEqual(inst.insurance[0].item[4].category.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-benefitcategory") + self.assertEqual(inst.insurance[0].item[4].network.coding[0].code, "in") + self.assertEqual(inst.insurance[0].item[4].network.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-network") + self.assertEqual(inst.insurance[0].item[4].term.coding[0].code, "day") + self.assertEqual(inst.insurance[0].item[4].term.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-term") + self.assertEqual(inst.insurance[0].item[4].unit.coding[0].code, "individual") + self.assertEqual(inst.insurance[0].item[4].unit.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-unit") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.outcome, "complete") self.assertEqual(inst.purpose[0], "validation") self.assertEqual(inst.purpose[1], "benefits") + self.assertEqual(inst.servicedDate.date, FHIRDate("2014-09-17").date) + self.assertEqual(inst.servicedDate.as_json(), "2014-09-17") self.assertEqual(inst.status, "active") self.assertEqual(inst.text.div, "
A human-readable rendering of the CoverageEligibilityResponse.
") self.assertEqual(inst.text.status, "generated") - def testCoverageEligibilityResponse4(self): - inst = self.instantiate_from("coverageeligibilityresponse-example-benefits.json") + def testCoverageEligibilityResponse3(self): + inst = self.instantiate_from("coverageeligibilityresponse-example-benefits-2.json") self.assertIsNotNone(inst, "Must have instantiated a CoverageEligibilityResponse instance") - self.implCoverageEligibilityResponse4(inst) + self.implCoverageEligibilityResponse3(inst) js = inst.as_json() self.assertEqual("CoverageEligibilityResponse", js["resourceType"]) inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(js) - self.implCoverageEligibilityResponse4(inst2) + self.implCoverageEligibilityResponse3(inst2) - def implCoverageEligibilityResponse4(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.created.as_json(), "2014-08-16") + def implCoverageEligibilityResponse3(self, inst): + self.assertEqual(inst.contained[0].id, "coverage-1") + self.assertEqual(inst.created.date, FHIRDate("2014-09-16").date) + self.assertEqual(inst.created.as_json(), "2014-09-16") self.assertEqual(inst.disposition, "Policy is currently in-force.") - self.assertEqual(inst.id, "E2501") + self.assertEqual(inst.form.coding[0].code, "ELRSP/2017/01") + self.assertEqual(inst.form.coding[0].system, "http://national.org/form") + self.assertEqual(inst.id, "E2502") self.assertEqual(inst.identifier[0].system, "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse") - self.assertEqual(inst.identifier[0].value, "881234") + self.assertEqual(inst.identifier[0].value, "8812342") self.assertTrue(inst.insurance[0].inforce) - self.assertEqual(inst.insurance[0].item[0].benefit[0].allowedMoney.currency, "SAR") + self.assertEqual(inst.insurance[0].item[0].benefit[0].allowedMoney.currency, "USD") self.assertEqual(inst.insurance[0].item[0].benefit[0].allowedMoney.value, 500000) self.assertEqual(inst.insurance[0].item[0].benefit[0].type.coding[0].code, "benefit") - self.assertEqual(inst.insurance[0].item[0].benefit[1].allowedMoney.currency, "SAR") + self.assertEqual(inst.insurance[0].item[0].benefit[0].usedMoney.currency, "USD") + self.assertEqual(inst.insurance[0].item[0].benefit[0].usedMoney.value, 3748.0) + self.assertEqual(inst.insurance[0].item[0].benefit[1].allowedMoney.currency, "USD") self.assertEqual(inst.insurance[0].item[0].benefit[1].allowedMoney.value, 100) self.assertEqual(inst.insurance[0].item[0].benefit[1].type.coding[0].code, "copay-maximum") self.assertEqual(inst.insurance[0].item[0].benefit[2].allowedUnsignedInt, 20) @@ -193,7 +185,7 @@ def implCoverageEligibilityResponse4(self, inst): self.assertEqual(inst.insurance[0].item[0].term.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-term") self.assertEqual(inst.insurance[0].item[0].unit.coding[0].code, "individual") self.assertEqual(inst.insurance[0].item[0].unit.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-unit") - self.assertEqual(inst.insurance[0].item[1].benefit[0].allowedMoney.currency, "SAR") + self.assertEqual(inst.insurance[0].item[1].benefit[0].allowedMoney.currency, "USD") self.assertEqual(inst.insurance[0].item[1].benefit[0].allowedMoney.value, 15000) self.assertEqual(inst.insurance[0].item[1].benefit[0].type.coding[0].code, "benefit") self.assertEqual(inst.insurance[0].item[1].category.coding[0].code, "69") @@ -205,7 +197,7 @@ def implCoverageEligibilityResponse4(self, inst): self.assertEqual(inst.insurance[0].item[1].term.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-term") self.assertEqual(inst.insurance[0].item[1].unit.coding[0].code, "individual") self.assertEqual(inst.insurance[0].item[1].unit.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-unit") - self.assertEqual(inst.insurance[0].item[2].benefit[0].allowedMoney.currency, "SAR") + self.assertEqual(inst.insurance[0].item[2].benefit[0].allowedMoney.currency, "USD") self.assertEqual(inst.insurance[0].item[2].benefit[0].allowedMoney.value, 2000) self.assertEqual(inst.insurance[0].item[2].benefit[0].type.coding[0].code, "benefit") self.assertEqual(inst.insurance[0].item[2].category.coding[0].code, "F3") @@ -217,40 +209,48 @@ def implCoverageEligibilityResponse4(self, inst): self.assertEqual(inst.insurance[0].item[2].term.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-term") self.assertEqual(inst.insurance[0].item[2].unit.coding[0].code, "individual") self.assertEqual(inst.insurance[0].item[2].unit.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-unit") - self.assertEqual(inst.insurance[0].item[3].benefit[0].allowedMoney.currency, "SAR") - self.assertEqual(inst.insurance[0].item[3].benefit[0].allowedMoney.value, 400) - self.assertEqual(inst.insurance[0].item[3].benefit[0].type.coding[0].code, "benefit") self.assertEqual(inst.insurance[0].item[3].category.coding[0].code, "F6") self.assertEqual(inst.insurance[0].item[3].category.coding[0].display, "Vision Coverage") self.assertEqual(inst.insurance[0].item[3].category.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-benefitcategory") - self.assertEqual(inst.insurance[0].item[3].network.coding[0].code, "in") - self.assertEqual(inst.insurance[0].item[3].network.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-network") - self.assertEqual(inst.insurance[0].item[3].term.coding[0].code, "annual") - self.assertEqual(inst.insurance[0].item[3].term.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-term") - self.assertEqual(inst.insurance[0].item[3].unit.coding[0].code, "individual") - self.assertEqual(inst.insurance[0].item[3].unit.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-unit") - self.assertEqual(inst.insurance[0].item[4].benefit[0].allowedString, "shared") - self.assertEqual(inst.insurance[0].item[4].benefit[0].type.coding[0].code, "room") - self.assertEqual(inst.insurance[0].item[4].benefit[1].allowedMoney.currency, "SAR") - self.assertEqual(inst.insurance[0].item[4].benefit[1].allowedMoney.value, 600) - self.assertEqual(inst.insurance[0].item[4].benefit[1].type.coding[0].code, "benefit") - self.assertEqual(inst.insurance[0].item[4].category.coding[0].code, "49") - self.assertEqual(inst.insurance[0].item[4].category.coding[0].display, "Hospital Room and Board") - self.assertEqual(inst.insurance[0].item[4].category.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-benefitcategory") - self.assertEqual(inst.insurance[0].item[4].network.coding[0].code, "in") - self.assertEqual(inst.insurance[0].item[4].network.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-network") - self.assertEqual(inst.insurance[0].item[4].term.coding[0].code, "day") - self.assertEqual(inst.insurance[0].item[4].term.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-term") - self.assertEqual(inst.insurance[0].item[4].unit.coding[0].code, "individual") - self.assertEqual(inst.insurance[0].item[4].unit.coding[0].system, "http://terminology.hl7.org/CodeSystem/benefit-unit") + self.assertEqual(inst.insurance[0].item[3].description, "Vision products and services such as exams, glasses and contact lenses.") + self.assertTrue(inst.insurance[0].item[3].excluded) + self.assertEqual(inst.insurance[0].item[3].name, "Vision") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.outcome, "complete") self.assertEqual(inst.purpose[0], "validation") self.assertEqual(inst.purpose[1], "benefits") - self.assertEqual(inst.servicedDate.date, FHIRDate("2014-09-17").date) - self.assertEqual(inst.servicedDate.as_json(), "2014-09-17") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.div, "
A human-readable rendering of the CoverageEligibilityResponse.
") + self.assertEqual(inst.text.status, "generated") + + def testCoverageEligibilityResponse4(self): + inst = self.instantiate_from("coverageeligibilityresponse-example-error.json") + self.assertIsNotNone(inst, "Must have instantiated a CoverageEligibilityResponse instance") + self.implCoverageEligibilityResponse4(inst) + + js = inst.as_json() + self.assertEqual("CoverageEligibilityResponse", js["resourceType"]) + inst2 = coverageeligibilityresponse.CoverageEligibilityResponse(js) + self.implCoverageEligibilityResponse4(inst2) + + def implCoverageEligibilityResponse4(self, inst): + self.assertEqual(inst.created.date, FHIRDate("2014-09-16").date) + self.assertEqual(inst.created.as_json(), "2014-09-16") + self.assertEqual(inst.disposition, "Eligibiliy request could not be processed, please address errors before submitting.") + self.assertEqual(inst.error[0].code.coding[0].code, "a001") + self.assertEqual(inst.error[0].code.coding[0].system, "http://terminology.hl7.org/CodeSystem/adjudication-error") + self.assertEqual(inst.form.coding[0].code, "ELRSP/2017/01") + self.assertEqual(inst.form.coding[0].system, "http://national.org/form") + self.assertEqual(inst.id, "E2503") + self.assertEqual(inst.identifier[0].system, "http://www.BenefitsInc.com/fhir/coverageeligibilityresponse") + self.assertEqual(inst.identifier[0].value, "8812343") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.outcome, "error") + self.assertEqual(inst.purpose[0], "validation") self.assertEqual(inst.status, "active") self.assertEqual(inst.text.div, "
A human-readable rendering of the CoverageEligibilityResponse.
") self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/datarequirement.py b/fhirclient/models/datarequirement.py index b1a8e5a0e..2467e1d8e 100644 --- a/fhirclient/models/datarequirement.py +++ b/fhirclient/models/datarequirement.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/DataRequirement) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DataRequirement) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/detectedissue.py b/fhirclient/models/detectedissue.py index e2201a7a7..5dfffeb5b 100644 --- a/fhirclient/models/detectedissue.py +++ b/fhirclient/models/detectedissue.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/DetectedIssue) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DetectedIssue) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/detectedissue_tests.py b/fhirclient/models/detectedissue_tests.py index 2749deeb1..300a61597 100644 --- a/fhirclient/models/detectedissue_tests.py +++ b/fhirclient/models/detectedissue_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return detectedissue.DetectedIssue(js) def testDetectedIssue1(self): - inst = self.instantiate_from("detectedissue-example-allergy.json") + inst = self.instantiate_from("detectedissue-example-lab.json") self.assertIsNotNone(inst, "Must have instantiated a DetectedIssue instance") self.implDetectedIssue1(inst) @@ -32,7 +32,7 @@ def testDetectedIssue1(self): self.implDetectedIssue1(inst2) def implDetectedIssue1(self, inst): - self.assertEqual(inst.id, "allergy") + self.assertEqual(inst.id, "lab") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") @@ -41,7 +41,7 @@ def implDetectedIssue1(self, inst): self.assertEqual(inst.text.status, "generated") def testDetectedIssue2(self): - inst = self.instantiate_from("detectedissue-example-dup.json") + inst = self.instantiate_from("detectedissue-example-allergy.json") self.assertIsNotNone(inst, "Must have instantiated a DetectedIssue instance") self.implDetectedIssue2(inst) @@ -51,6 +51,25 @@ def testDetectedIssue2(self): self.implDetectedIssue2(inst2) def implDetectedIssue2(self, inst): + self.assertEqual(inst.id, "allergy") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.status, "final") + self.assertEqual(inst.text.div, "
[Put rendering here]
") + self.assertEqual(inst.text.status, "generated") + + def testDetectedIssue3(self): + inst = self.instantiate_from("detectedissue-example-dup.json") + self.assertIsNotNone(inst, "Must have instantiated a DetectedIssue instance") + self.implDetectedIssue3(inst) + + js = inst.as_json() + self.assertEqual("DetectedIssue", js["resourceType"]) + inst2 = detectedissue.DetectedIssue(js) + self.implDetectedIssue3(inst2) + + def implDetectedIssue3(self, inst): self.assertEqual(inst.code.coding[0].code, "DUPTHPY") self.assertEqual(inst.code.coding[0].display, "Duplicate Therapy Alert") self.assertEqual(inst.code.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") @@ -68,17 +87,17 @@ def implDetectedIssue2(self, inst): self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "generated") - def testDetectedIssue3(self): + def testDetectedIssue4(self): inst = self.instantiate_from("detectedissue-example.json") self.assertIsNotNone(inst, "Must have instantiated a DetectedIssue instance") - self.implDetectedIssue3(inst) + self.implDetectedIssue4(inst) js = inst.as_json() self.assertEqual("DetectedIssue", js["resourceType"]) inst2 = detectedissue.DetectedIssue(js) - self.implDetectedIssue3(inst2) + self.implDetectedIssue4(inst2) - def implDetectedIssue3(self, inst): + def implDetectedIssue4(self, inst): self.assertEqual(inst.code.coding[0].code, "DRG") self.assertEqual(inst.code.coding[0].display, "Drug Interaction Alert") self.assertEqual(inst.code.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") @@ -97,23 +116,4 @@ def implDetectedIssue3(self, inst): self.assertEqual(inst.severity, "high") self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "generated") - - def testDetectedIssue4(self): - inst = self.instantiate_from("detectedissue-example-lab.json") - self.assertIsNotNone(inst, "Must have instantiated a DetectedIssue instance") - self.implDetectedIssue4(inst) - - js = inst.as_json() - self.assertEqual("DetectedIssue", js["resourceType"]) - inst2 = detectedissue.DetectedIssue(js) - self.implDetectedIssue4(inst2) - - def implDetectedIssue4(self, inst): - self.assertEqual(inst.id, "lab") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.status, "final") - self.assertEqual(inst.text.div, "
[Put rendering here]
") - self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/device.py b/fhirclient/models/device.py index 51c824e2f..6d08330d2 100644 --- a/fhirclient/models/device.py +++ b/fhirclient/models/device.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Device) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Device) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/device_tests.py b/fhirclient/models/device_tests.py index 3698ecf32..4f17963eb 100644 --- a/fhirclient/models/device_tests.py +++ b/fhirclient/models/device_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return device.Device(js) def testDevice1(self): - inst = self.instantiate_from("device-example-f001-feedingtube.json") + inst = self.instantiate_from("device-example.json") self.assertIsNotNone(inst, "Must have instantiated a Device instance") self.implDevice1(inst) @@ -32,18 +32,17 @@ def testDevice1(self): self.implDevice1(inst2) def implDevice1(self, inst): - self.assertEqual(inst.id, "f001") - self.assertEqual(inst.identifier[0].system, "http:/goodhealthhospital/identifier/devices") - self.assertEqual(inst.identifier[0].value, "12345") + self.assertEqual(inst.id, "example") + self.assertEqual(inst.identifier[0].system, "http://goodcare.org/devices/id") + self.assertEqual(inst.identifier[0].value, "345675") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.div, "

Generated Narrative with Details

id: f001

identifier: 12345

status: active

") + self.assertEqual(inst.text.div, "

Generated Narrative with Details

id: example

identifier: 345675

") self.assertEqual(inst.text.status, "generated") def testDevice2(self): - inst = self.instantiate_from("device-example.json") + inst = self.instantiate_from("device-example-f001-feedingtube.json") self.assertIsNotNone(inst, "Must have instantiated a Device instance") self.implDevice2(inst) @@ -53,12 +52,13 @@ def testDevice2(self): self.implDevice2(inst2) def implDevice2(self, inst): - self.assertEqual(inst.id, "example") - self.assertEqual(inst.identifier[0].system, "http://goodcare.org/devices/id") - self.assertEqual(inst.identifier[0].value, "345675") + self.assertEqual(inst.id, "f001") + self.assertEqual(inst.identifier[0].system, "http:/goodhealthhospital/identifier/devices") + self.assertEqual(inst.identifier[0].value, "12345") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.text.div, "

Generated Narrative with Details

id: example

identifier: 345675

") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.div, "

Generated Narrative with Details

id: f001

identifier: 12345

status: active

") self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/devicedefinition.py b/fhirclient/models/devicedefinition.py index 9c645a284..079dc2884 100644 --- a/fhirclient/models/devicedefinition.py +++ b/fhirclient/models/devicedefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/DeviceDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DeviceDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/devicedefinition_tests.py b/fhirclient/models/devicedefinition_tests.py index 2d8ec40b6..026d6f69c 100644 --- a/fhirclient/models/devicedefinition_tests.py +++ b/fhirclient/models/devicedefinition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/devicemetric.py b/fhirclient/models/devicemetric.py index b47b2f68a..0e9d685a4 100644 --- a/fhirclient/models/devicemetric.py +++ b/fhirclient/models/devicemetric.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/DeviceMetric) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DeviceMetric) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/devicemetric_tests.py b/fhirclient/models/devicemetric_tests.py index 944c91be3..75b766848 100644 --- a/fhirclient/models/devicemetric_tests.py +++ b/fhirclient/models/devicemetric_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/devicerequest.py b/fhirclient/models/devicerequest.py index 494914c55..f1b701445 100644 --- a/fhirclient/models/devicerequest.py +++ b/fhirclient/models/devicerequest.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/DeviceRequest) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DeviceRequest) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -66,7 +66,8 @@ def __init__(self, jsondict=None, strict=True): List of `FHIRReference` items (represented as `dict` in JSON). """ self.intent = None - """ proposal | plan | original-order | encoded | reflex-order. + """ proposal | plan | directive | order | original-order | reflex-order + | filler-order | instance-order | option. Type `str`. """ self.note = None @@ -102,8 +103,7 @@ def __init__(self, jsondict=None, strict=True): List of `FHIRReference` items (represented as `dict` in JSON). """ self.priority = None - """ Indicates how quickly the {{title}} should be addressed with - respect to other requests. + """ routine | urgent | asap | stat. Type `str`. """ self.reasonCode = None @@ -123,8 +123,8 @@ def __init__(self, jsondict=None, strict=True): Type `FHIRReference` (represented as `dict` in JSON). """ self.status = None - """ draft | active | suspended | completed | entered-in-error | - cancelled. + """ draft | active | on-hold | revoked | completed | entered-in-error | + unknown. Type `str`. """ self.subject = None diff --git a/fhirclient/models/devicerequest_tests.py b/fhirclient/models/devicerequest_tests.py index adbc8ed39..ef3450835 100644 --- a/fhirclient/models/devicerequest_tests.py +++ b/fhirclient/models/devicerequest_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/deviceusestatement.py b/fhirclient/models/deviceusestatement.py index d0de8a817..d2401c784 100644 --- a/fhirclient/models/deviceusestatement.py +++ b/fhirclient/models/deviceusestatement.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/DeviceUseStatement) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DeviceUseStatement) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/deviceusestatement_tests.py b/fhirclient/models/deviceusestatement_tests.py index ecbfaae72..cfef354e7 100644 --- a/fhirclient/models/deviceusestatement_tests.py +++ b/fhirclient/models/deviceusestatement_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/diagnosticreport.py b/fhirclient/models/diagnosticreport.py index 707c80620..ed62e616a 100644 --- a/fhirclient/models/diagnosticreport.py +++ b/fhirclient/models/diagnosticreport.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/DiagnosticReport) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DiagnosticReport) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/diagnosticreport_tests.py b/fhirclient/models/diagnosticreport_tests.py index d20113665..ffe451ead 100644 --- a/fhirclient/models/diagnosticreport_tests.py +++ b/fhirclient/models/diagnosticreport_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return diagnosticreport.DiagnosticReport(js) def testDiagnosticReport1(self): - inst = self.instantiate_from("diagnosticreport-example-ultrasound.json") + inst = self.instantiate_from("diagnosticreport-example-pgx.json") self.assertIsNotNone(inst, "Must have instantiated a DiagnosticReport instance") self.implDiagnosticReport1(inst) @@ -32,30 +32,30 @@ def testDiagnosticReport1(self): self.implDiagnosticReport1(inst2) def implDiagnosticReport1(self, inst): - self.assertEqual(inst.category[0].coding[0].code, "394914008") - self.assertEqual(inst.category[0].coding[0].display, "Radiology") - self.assertEqual(inst.category[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.category[0].coding[1].code, "RAD") - self.assertEqual(inst.category[0].coding[1].system, "http://terminology.hl7.org/CodeSystem/v2-0074") - self.assertEqual(inst.code.coding[0].code, "45036003") - self.assertEqual(inst.code.coding[0].display, "Ultrasonography of abdomen") - self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.code.text, "Abdominal Ultrasound") - self.assertEqual(inst.conclusion, "Unremarkable study") - self.assertEqual(inst.effectiveDateTime.date, FHIRDate("2012-12-01T12:00:00+01:00").date) - self.assertEqual(inst.effectiveDateTime.as_json(), "2012-12-01T12:00:00+01:00") - self.assertEqual(inst.id, "ultrasound") - self.assertEqual(inst.issued.date, FHIRDate("2012-12-01T12:00:00+01:00").date) - self.assertEqual(inst.issued.as_json(), "2012-12-01T12:00:00+01:00") - self.assertEqual(inst.media[0].comment, "A comment about the image") + self.assertEqual(inst.code.coding[0].code, "PGxReport") + self.assertEqual(inst.code.coding[0].display, "Pharmacogenetics Report") + self.assertEqual(inst.code.coding[0].system, "https://system/PGxReport") + self.assertEqual(inst.code.text, "Pharmacogenetics Report") + self.assertEqual(inst.effectiveDateTime.date, FHIRDate("2016-10-15T12:34:56+11:00").date) + self.assertEqual(inst.effectiveDateTime.as_json(), "2016-10-15T12:34:56+11:00") + self.assertEqual(inst.id, "example-pgx") + self.assertEqual(inst.issued.date, FHIRDate("2016-10-20T14:00:05+11:00").date) + self.assertEqual(inst.issued.as_json(), "2016-10-20T14:00:05+11:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.presentedForm[0].contentType, "application/pdf") + self.assertEqual(inst.presentedForm[0].creation.date, FHIRDate("2016-10-20T20:00:00+11:00").date) + self.assertEqual(inst.presentedForm[0].creation.as_json(), "2016-10-20T20:00:00+11:00") + self.assertEqual(inst.presentedForm[0].data, "cGRmSW5CYXNlNjRCaW5hcnk=") + self.assertEqual(inst.presentedForm[0].hash, "571ef9c5655840f324e679072ed62b1b95eef8a0") + self.assertEqual(inst.presentedForm[0].language, "en") + self.assertEqual(inst.presentedForm[0].title, "Pharmacogenetics Report") self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "generated") def testDiagnosticReport2(self): - inst = self.instantiate_from("diagnosticreport-example-f201-brainct.json") + inst = self.instantiate_from("diagnosticreport-example-papsmear.json") self.assertIsNotNone(inst, "Must have instantiated a DiagnosticReport instance") self.implDiagnosticReport2(inst) @@ -65,6 +65,30 @@ def testDiagnosticReport2(self): self.implDiagnosticReport2(inst2) def implDiagnosticReport2(self, inst): + self.assertEqual(inst.code.coding[0].code, "47527-7") + self.assertEqual(inst.code.coding[0].system, "http://loinc.org") + self.assertEqual(inst.effectiveDateTime.date, FHIRDate("2013-02-11T10:33:33+11:00").date) + self.assertEqual(inst.effectiveDateTime.as_json(), "2013-02-11T10:33:33+11:00") + self.assertEqual(inst.id, "pap") + self.assertEqual(inst.issued.date, FHIRDate("2013-02-13T11:45:33+11:00").date) + self.assertEqual(inst.issued.as_json(), "2013-02-13T11:45:33+11:00") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.status, "final") + self.assertEqual(inst.text.status, "additional") + + def testDiagnosticReport3(self): + inst = self.instantiate_from("diagnosticreport-example-f201-brainct.json") + self.assertIsNotNone(inst, "Must have instantiated a DiagnosticReport instance") + self.implDiagnosticReport3(inst) + + js = inst.as_json() + self.assertEqual("DiagnosticReport", js["resourceType"]) + inst2 = diagnosticreport.DiagnosticReport(js) + self.implDiagnosticReport3(inst2) + + def implDiagnosticReport3(self, inst): self.assertEqual(inst.category[0].coding[0].code, "394914008") self.assertEqual(inst.category[0].coding[0].display, "Radiology") self.assertEqual(inst.category[0].coding[0].system, "http://snomed.info/sct") @@ -89,41 +113,50 @@ def implDiagnosticReport2(self, inst): self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "generated") - def testDiagnosticReport3(self): - inst = self.instantiate_from("diagnosticreport-example-papsmear.json") + def testDiagnosticReport4(self): + inst = self.instantiate_from("diagnosticreport-example-ultrasound.json") self.assertIsNotNone(inst, "Must have instantiated a DiagnosticReport instance") - self.implDiagnosticReport3(inst) + self.implDiagnosticReport4(inst) js = inst.as_json() self.assertEqual("DiagnosticReport", js["resourceType"]) inst2 = diagnosticreport.DiagnosticReport(js) - self.implDiagnosticReport3(inst2) + self.implDiagnosticReport4(inst2) - def implDiagnosticReport3(self, inst): - self.assertEqual(inst.code.coding[0].code, "47527-7") - self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.effectiveDateTime.date, FHIRDate("2013-02-11T10:33:33+11:00").date) - self.assertEqual(inst.effectiveDateTime.as_json(), "2013-02-11T10:33:33+11:00") - self.assertEqual(inst.id, "pap") - self.assertEqual(inst.issued.date, FHIRDate("2013-02-13T11:45:33+11:00").date) - self.assertEqual(inst.issued.as_json(), "2013-02-13T11:45:33+11:00") + def implDiagnosticReport4(self, inst): + self.assertEqual(inst.category[0].coding[0].code, "394914008") + self.assertEqual(inst.category[0].coding[0].display, "Radiology") + self.assertEqual(inst.category[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.category[0].coding[1].code, "RAD") + self.assertEqual(inst.category[0].coding[1].system, "http://terminology.hl7.org/CodeSystem/v2-0074") + self.assertEqual(inst.code.coding[0].code, "45036003") + self.assertEqual(inst.code.coding[0].display, "Ultrasonography of abdomen") + self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.code.text, "Abdominal Ultrasound") + self.assertEqual(inst.conclusion, "Unremarkable study") + self.assertEqual(inst.effectiveDateTime.date, FHIRDate("2012-12-01T12:00:00+01:00").date) + self.assertEqual(inst.effectiveDateTime.as_json(), "2012-12-01T12:00:00+01:00") + self.assertEqual(inst.id, "ultrasound") + self.assertEqual(inst.issued.date, FHIRDate("2012-12-01T12:00:00+01:00").date) + self.assertEqual(inst.issued.as_json(), "2012-12-01T12:00:00+01:00") + self.assertEqual(inst.media[0].comment, "A comment about the image") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.status, "final") - self.assertEqual(inst.text.status, "additional") + self.assertEqual(inst.text.status, "generated") - def testDiagnosticReport4(self): + def testDiagnosticReport5(self): inst = self.instantiate_from("diagnosticreport-example-gingival-mass.json") self.assertIsNotNone(inst, "Must have instantiated a DiagnosticReport instance") - self.implDiagnosticReport4(inst) + self.implDiagnosticReport5(inst) js = inst.as_json() self.assertEqual("DiagnosticReport", js["resourceType"]) inst2 = diagnosticreport.DiagnosticReport(js) - self.implDiagnosticReport4(inst2) + self.implDiagnosticReport5(inst2) - def implDiagnosticReport4(self, inst): + def implDiagnosticReport5(self, inst): self.assertEqual(inst.category[0].coding[0].code, "PAT") self.assertEqual(inst.category[0].coding[0].display, "Pathology (gross & histopath, not surgical)") self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0074") @@ -148,39 +181,6 @@ def implDiagnosticReport4(self, inst): self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "generated") - def testDiagnosticReport5(self): - inst = self.instantiate_from("diagnosticreport-example-pgx.json") - self.assertIsNotNone(inst, "Must have instantiated a DiagnosticReport instance") - self.implDiagnosticReport5(inst) - - js = inst.as_json() - self.assertEqual("DiagnosticReport", js["resourceType"]) - inst2 = diagnosticreport.DiagnosticReport(js) - self.implDiagnosticReport5(inst2) - - def implDiagnosticReport5(self, inst): - self.assertEqual(inst.code.coding[0].code, "PGxReport") - self.assertEqual(inst.code.coding[0].display, "Pharmacogenetics Report") - self.assertEqual(inst.code.coding[0].system, "https://system/PGxReport") - self.assertEqual(inst.code.text, "Pharmacogenetics Report") - self.assertEqual(inst.effectiveDateTime.date, FHIRDate("2016-10-15T12:34:56+11:00").date) - self.assertEqual(inst.effectiveDateTime.as_json(), "2016-10-15T12:34:56+11:00") - self.assertEqual(inst.id, "example-pgx") - self.assertEqual(inst.issued.date, FHIRDate("2016-10-20T14:00:05+11:00").date) - self.assertEqual(inst.issued.as_json(), "2016-10-20T14:00:05+11:00") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.presentedForm[0].contentType, "application/pdf") - self.assertEqual(inst.presentedForm[0].creation.date, FHIRDate("2016-10-20T20:00:00+11:00").date) - self.assertEqual(inst.presentedForm[0].creation.as_json(), "2016-10-20T20:00:00+11:00") - self.assertEqual(inst.presentedForm[0].data, "cGRmSW5CYXNlNjRCaW5hcnk=") - self.assertEqual(inst.presentedForm[0].hash, "571ef9c5655840f324e679072ed62b1b95eef8a0") - self.assertEqual(inst.presentedForm[0].language, "en") - self.assertEqual(inst.presentedForm[0].title, "Pharmacogenetics Report") - self.assertEqual(inst.status, "final") - self.assertEqual(inst.text.status, "generated") - def testDiagnosticReport6(self): inst = self.instantiate_from("diagnosticreport-example-dxa.json") self.assertIsNotNone(inst, "Must have instantiated a DiagnosticReport instance") diff --git a/fhirclient/models/distance.py b/fhirclient/models/distance.py index 836da615f..06ee82f54 100644 --- a/fhirclient/models/distance.py +++ b/fhirclient/models/distance.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Distance) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Distance) on 2024-07-15. +# 2024, SMART Health IT. from . import quantity diff --git a/fhirclient/models/documentmanifest.py b/fhirclient/models/documentmanifest.py index 2d25db3a8..4b6b099bb 100644 --- a/fhirclient/models/documentmanifest.py +++ b/fhirclient/models/documentmanifest.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/DocumentManifest) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DocumentManifest) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/documentmanifest_tests.py b/fhirclient/models/documentmanifest_tests.py index 4d2328960..2784851b1 100644 --- a/fhirclient/models/documentmanifest_tests.py +++ b/fhirclient/models/documentmanifest_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/documentreference.py b/fhirclient/models/documentreference.py index 219e47c89..cb4146c4d 100644 --- a/fhirclient/models/documentreference.py +++ b/fhirclient/models/documentreference.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/DocumentReference) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DocumentReference) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -60,7 +60,7 @@ def __init__(self, jsondict=None, strict=True): Type `str`. """ self.docStatus = None - """ preliminary | final | appended | amended | entered-in-error. + """ preliminary | final | amended | entered-in-error. Type `str`. """ self.identifier = None diff --git a/fhirclient/models/documentreference_tests.py b/fhirclient/models/documentreference_tests.py index bb394fb85..a501b067d 100644 --- a/fhirclient/models/documentreference_tests.py +++ b/fhirclient/models/documentreference_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/domainresource.py b/fhirclient/models/domainresource.py index 2bc2b458a..e94b6c69b 100644 --- a/fhirclient/models/domainresource.py +++ b/fhirclient/models/domainresource.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/DomainResource) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DomainResource) on 2024-07-15. +# 2024, SMART Health IT. from . import resource diff --git a/fhirclient/models/dosage.py b/fhirclient/models/dosage.py index fdb546e6d..a2a27a0ff 100644 --- a/fhirclient/models/dosage.py +++ b/fhirclient/models/dosage.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Dosage) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Dosage) on 2024-07-15. +# 2024, SMART Health IT. from . import backboneelement diff --git a/fhirclient/models/duration.py b/fhirclient/models/duration.py index 922e777fd..8c8eaa2c4 100644 --- a/fhirclient/models/duration.py +++ b/fhirclient/models/duration.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Duration) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Duration) on 2024-07-15. +# 2024, SMART Health IT. from . import quantity diff --git a/fhirclient/models/effectevidencesynthesis.py b/fhirclient/models/effectevidencesynthesis.py index f88a95ae2..4de194d12 100644 --- a/fhirclient/models/effectevidencesynthesis.py +++ b/fhirclient/models/effectevidencesynthesis.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/EffectEvidenceSynthesis) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EffectEvidenceSynthesis) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/effectevidencesynthesis_tests.py b/fhirclient/models/effectevidencesynthesis_tests.py index b46814840..18e265b51 100644 --- a/fhirclient/models/effectevidencesynthesis_tests.py +++ b/fhirclient/models/effectevidencesynthesis_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/element.py b/fhirclient/models/element.py index 812aa22bd..b4ad4e093 100644 --- a/fhirclient/models/element.py +++ b/fhirclient/models/element.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Element) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Element) on 2024-07-15. +# 2024, SMART Health IT. from . import fhirabstractbase diff --git a/fhirclient/models/elementdefinition.py b/fhirclient/models/elementdefinition.py index 5c1ae4cf9..78a2d17a1 100644 --- a/fhirclient/models/elementdefinition.py +++ b/fhirclient/models/elementdefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ElementDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ElementDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import backboneelement @@ -168,6 +168,10 @@ def __init__(self, jsondict=None, strict=True): """ Specified value if missing from instance. Type `str`. """ + self.defaultValueMeta = None + """ Specified value if missing from instance. + Type `Meta` (represented as `dict` in JSON). """ + self.defaultValueMoney = None """ Specified value if missing from instance. Type `Money` (represented as `dict` in JSON). """ @@ -372,6 +376,10 @@ def __init__(self, jsondict=None, strict=True): """ Value must be exactly this. Type `str`. """ + self.fixedMeta = None + """ Value must be exactly this. + Type `Meta` (represented as `dict` in JSON). """ + self.fixedMoney = None """ Value must be exactly this. Type `Money` (represented as `dict` in JSON). """ @@ -688,6 +696,10 @@ def __init__(self, jsondict=None, strict=True): """ Value must have at least these property values. Type `str`. """ + self.patternMeta = None + """ Value must have at least these property values. + Type `Meta` (represented as `dict` in JSON). """ + self.patternMoney = None """ Value must have at least these property values. Type `Money` (represented as `dict` in JSON). """ @@ -842,6 +854,7 @@ def elementProperties(self): ("defaultValueInstant", "defaultValueInstant", fhirdate.FHIRDate, False, "defaultValue", False), ("defaultValueInteger", "defaultValueInteger", int, False, "defaultValue", False), ("defaultValueMarkdown", "defaultValueMarkdown", str, False, "defaultValue", False), + ("defaultValueMeta", "defaultValueMeta", meta.Meta, False, "defaultValue", False), ("defaultValueMoney", "defaultValueMoney", money.Money, False, "defaultValue", False), ("defaultValueOid", "defaultValueOid", str, False, "defaultValue", False), ("defaultValueParameterDefinition", "defaultValueParameterDefinition", parameterdefinition.ParameterDefinition, False, "defaultValue", False), @@ -893,6 +906,7 @@ def elementProperties(self): ("fixedInstant", "fixedInstant", fhirdate.FHIRDate, False, "fixed", False), ("fixedInteger", "fixedInteger", int, False, "fixed", False), ("fixedMarkdown", "fixedMarkdown", str, False, "fixed", False), + ("fixedMeta", "fixedMeta", meta.Meta, False, "fixed", False), ("fixedMoney", "fixedMoney", money.Money, False, "fixed", False), ("fixedOid", "fixedOid", str, False, "fixed", False), ("fixedParameterDefinition", "fixedParameterDefinition", parameterdefinition.ParameterDefinition, False, "fixed", False), @@ -972,6 +986,7 @@ def elementProperties(self): ("patternInstant", "patternInstant", fhirdate.FHIRDate, False, "pattern", False), ("patternInteger", "patternInteger", int, False, "pattern", False), ("patternMarkdown", "patternMarkdown", str, False, "pattern", False), + ("patternMeta", "patternMeta", meta.Meta, False, "pattern", False), ("patternMoney", "patternMoney", money.Money, False, "pattern", False), ("patternOid", "patternOid", str, False, "pattern", False), ("patternParameterDefinition", "patternParameterDefinition", parameterdefinition.ParameterDefinition, False, "pattern", False), @@ -1288,6 +1303,10 @@ def __init__(self, jsondict=None, strict=True): """ Value of Example (one of allowed types). Type `str`. """ + self.valueMeta = None + """ Value of Example (one of allowed types). + Type `Meta` (represented as `dict` in JSON). """ + self.valueMoney = None """ Value of Example (one of allowed types). Type `Money` (represented as `dict` in JSON). """ @@ -1406,6 +1425,7 @@ def elementProperties(self): ("valueInstant", "valueInstant", fhirdate.FHIRDate, False, "value", True), ("valueInteger", "valueInteger", int, False, "value", True), ("valueMarkdown", "valueMarkdown", str, False, "value", True), + ("valueMeta", "valueMeta", meta.Meta, False, "value", True), ("valueMoney", "valueMoney", money.Money, False, "value", True), ("valueOid", "valueOid", str, False, "value", True), ("valueParameterDefinition", "valueParameterDefinition", parameterdefinition.ParameterDefinition, False, "value", True), @@ -1696,6 +1716,10 @@ def elementProperties(self): from . import identifier except ImportError: identifier = sys.modules[__package__ + '.identifier'] +try: + from . import meta +except ImportError: + meta = sys.modules[__package__ + '.meta'] try: from . import money except ImportError: diff --git a/fhirclient/models/encounter.py b/fhirclient/models/encounter.py index 6c201d0ea..937019959 100644 --- a/fhirclient/models/encounter.py +++ b/fhirclient/models/encounter.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Encounter) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Encounter) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/encounter_tests.py b/fhirclient/models/encounter_tests.py index c0611906d..ebfa9647a 100644 --- a/fhirclient/models/encounter_tests.py +++ b/fhirclient/models/encounter_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return encounter.Encounter(js) def testEncounter1(self): - inst = self.instantiate_from("encounter-example-home.json") + inst = self.instantiate_from("encounter-example-f001-heart.json") self.assertIsNotNone(inst, "Must have instantiated a Encounter instance") self.implEncounter1(inst) @@ -32,33 +32,43 @@ def testEncounter1(self): self.implEncounter1(inst2) def implEncounter1(self, inst): - self.assertEqual(inst.class_fhir.code, "HH") - self.assertEqual(inst.class_fhir.display, "home health") + self.assertEqual(inst.class_fhir.code, "AMB") + self.assertEqual(inst.class_fhir.display, "ambulatory") self.assertEqual(inst.class_fhir.system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.contained[0].id, "home") - self.assertEqual(inst.id, "home") - self.assertEqual(inst.location[0].period.end.date, FHIRDate("2015-01-17T16:30:00+10:00").date) - self.assertEqual(inst.location[0].period.end.as_json(), "2015-01-17T16:30:00+10:00") - self.assertEqual(inst.location[0].period.start.date, FHIRDate("2015-01-17T16:00:00+10:00").date) - self.assertEqual(inst.location[0].period.start.as_json(), "2015-01-17T16:00:00+10:00") - self.assertEqual(inst.location[0].status, "completed") + self.assertEqual(inst.hospitalization.admitSource.coding[0].code, "305956004") + self.assertEqual(inst.hospitalization.admitSource.coding[0].display, "Referral by physician") + self.assertEqual(inst.hospitalization.admitSource.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.hospitalization.dischargeDisposition.coding[0].code, "306689006") + self.assertEqual(inst.hospitalization.dischargeDisposition.coding[0].display, "Discharge to home") + self.assertEqual(inst.hospitalization.dischargeDisposition.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.hospitalization.preAdmissionIdentifier.system, "http://www.amc.nl/zorgportal/identifiers/pre-admissions") + self.assertEqual(inst.hospitalization.preAdmissionIdentifier.use, "official") + self.assertEqual(inst.hospitalization.preAdmissionIdentifier.value, "93042") + self.assertEqual(inst.id, "f001") + self.assertEqual(inst.identifier[0].system, "http://www.amc.nl/zorgportal/identifiers/visits") + self.assertEqual(inst.identifier[0].use, "official") + self.assertEqual(inst.identifier[0].value, "v1451") + self.assertEqual(inst.length.code, "min") + self.assertEqual(inst.length.system, "http://unitsofmeasure.org") + self.assertEqual(inst.length.unit, "min") + self.assertEqual(inst.length.value, 140) self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.participant[0].period.end.date, FHIRDate("2015-01-17T16:30:00+10:00").date) - self.assertEqual(inst.participant[0].period.end.as_json(), "2015-01-17T16:30:00+10:00") - self.assertEqual(inst.participant[0].period.start.date, FHIRDate("2015-01-17T16:00:00+10:00").date) - self.assertEqual(inst.participant[0].period.start.as_json(), "2015-01-17T16:00:00+10:00") - self.assertEqual(inst.period.end.date, FHIRDate("2015-01-17T16:30:00+10:00").date) - self.assertEqual(inst.period.end.as_json(), "2015-01-17T16:30:00+10:00") - self.assertEqual(inst.period.start.date, FHIRDate("2015-01-17T16:00:00+10:00").date) - self.assertEqual(inst.period.start.as_json(), "2015-01-17T16:00:00+10:00") + self.assertEqual(inst.priority.coding[0].code, "310361003") + self.assertEqual(inst.priority.coding[0].display, "Non-urgent cardiological admission") + self.assertEqual(inst.priority.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.reasonCode[0].coding[0].code, "34068001") + self.assertEqual(inst.reasonCode[0].coding[0].display, "Heart valve replacement") + self.assertEqual(inst.reasonCode[0].coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.status, "finished") - self.assertEqual(inst.text.div, "
Encounter with patient @example who is at home
") self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.type[0].coding[0].code, "270427003") + self.assertEqual(inst.type[0].coding[0].display, "Patient-initiated encounter") + self.assertEqual(inst.type[0].coding[0].system, "http://snomed.info/sct") def testEncounter2(self): - inst = self.instantiate_from("encounter-example-f201-20130404.json") + inst = self.instantiate_from("encounter-example-f202-20130128.json") self.assertIsNotNone(inst, "Must have instantiated a Encounter instance") self.implEncounter2(inst) @@ -71,20 +81,32 @@ def implEncounter2(self, inst): self.assertEqual(inst.class_fhir.code, "AMB") self.assertEqual(inst.class_fhir.display, "ambulatory") self.assertEqual(inst.class_fhir.system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.id, "f201") + self.assertEqual(inst.diagnosis[0].rank, 2) + self.assertEqual(inst.diagnosis[0].use.coding[0].code, "AD") + self.assertEqual(inst.diagnosis[0].use.coding[0].display, "Admission diagnosis") + self.assertEqual(inst.diagnosis[0].use.coding[0].system, "http://terminology.hl7.org/CodeSystem/diagnosis-role") + self.assertEqual(inst.diagnosis[1].rank, 1) + self.assertEqual(inst.diagnosis[1].use.coding[0].code, "CC") + self.assertEqual(inst.diagnosis[1].use.coding[0].display, "Chief complaint") + self.assertEqual(inst.diagnosis[1].use.coding[0].system, "http://terminology.hl7.org/CodeSystem/diagnosis-role") + self.assertEqual(inst.id, "f202") self.assertEqual(inst.identifier[0].use, "temp") - self.assertEqual(inst.identifier[0].value, "Encounter_Roel_20130404") + self.assertEqual(inst.identifier[0].value, "Encounter_Roel_20130128") + self.assertEqual(inst.length.code, "min") + self.assertEqual(inst.length.system, "http://unitsofmeasure.org") + self.assertEqual(inst.length.unit, "minutes") + self.assertEqual(inst.length.value, 56) self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.priority.coding[0].code, "17621005") - self.assertEqual(inst.priority.coding[0].display, "Normal") + self.assertEqual(inst.priority.coding[0].code, "103391001") + self.assertEqual(inst.priority.coding[0].display, "Urgent") self.assertEqual(inst.priority.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.reasonCode[0].text, "The patient had fever peaks over the last couple of days. He is worried about these peaks.") + self.assertEqual(inst.reasonCode[0].text, "The patient is treated for a tumor.") self.assertEqual(inst.status, "finished") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type[0].coding[0].code, "11429006") - self.assertEqual(inst.type[0].coding[0].display, "Consultation") + self.assertEqual(inst.type[0].coding[0].code, "367336001") + self.assertEqual(inst.type[0].coding[0].display, "Chemotherapy") self.assertEqual(inst.type[0].coding[0].system, "http://snomed.info/sct") def testEncounter3(self): @@ -134,7 +156,7 @@ def implEncounter3(self, inst): self.assertEqual(inst.type[0].coding[0].system, "http://snomed.info/sct") def testEncounter4(self): - inst = self.instantiate_from("encounter-example.json") + inst = self.instantiate_from("encounter-example-emerg.json") self.assertIsNotNone(inst, "Must have instantiated a Encounter instance") self.implEncounter4(inst) @@ -144,19 +166,82 @@ def testEncounter4(self): self.implEncounter4(inst2) def implEncounter4(self, inst): + self.assertEqual(inst.classHistory[0].class_fhir.code, "EMER") + self.assertEqual(inst.classHistory[0].class_fhir.display, "emergency") + self.assertEqual(inst.classHistory[0].class_fhir.system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") + self.assertEqual(inst.classHistory[0].period.end.date, FHIRDate("2017-02-01T09:27:00+10:00").date) + self.assertEqual(inst.classHistory[0].period.end.as_json(), "2017-02-01T09:27:00+10:00") + self.assertEqual(inst.classHistory[0].period.start.date, FHIRDate("2017-02-01T07:15:00+10:00").date) + self.assertEqual(inst.classHistory[0].period.start.as_json(), "2017-02-01T07:15:00+10:00") + self.assertEqual(inst.classHistory[1].class_fhir.code, "IMP") + self.assertEqual(inst.classHistory[1].class_fhir.display, "inpatient encounter") + self.assertEqual(inst.classHistory[1].class_fhir.system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") + self.assertEqual(inst.classHistory[1].period.start.date, FHIRDate("2017-02-01T09:27:00+10:00").date) + self.assertEqual(inst.classHistory[1].period.start.as_json(), "2017-02-01T09:27:00+10:00") self.assertEqual(inst.class_fhir.code, "IMP") self.assertEqual(inst.class_fhir.display, "inpatient encounter") self.assertEqual(inst.class_fhir.system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.id, "example") + self.assertEqual(inst.hospitalization.admitSource.coding[0].code, "emd") + self.assertEqual(inst.hospitalization.admitSource.coding[0].display, "From accident/emergency department") + self.assertEqual(inst.hospitalization.admitSource.coding[0].system, "http://terminology.hl7.org/CodeSystem/admit-source") + self.assertEqual(inst.id, "emerg") + self.assertEqual(inst.location[0].period.end.date, FHIRDate("2017-02-01T08:45:00+10:00").date) + self.assertEqual(inst.location[0].period.end.as_json(), "2017-02-01T08:45:00+10:00") + self.assertEqual(inst.location[0].period.start.date, FHIRDate("2017-02-01T07:15:00+10:00").date) + self.assertEqual(inst.location[0].period.start.as_json(), "2017-02-01T07:15:00+10:00") + self.assertEqual(inst.location[0].status, "active") + self.assertEqual(inst.location[1].period.end.date, FHIRDate("2017-02-01T09:27:00+10:00").date) + self.assertEqual(inst.location[1].period.end.as_json(), "2017-02-01T09:27:00+10:00") + self.assertEqual(inst.location[1].period.start.date, FHIRDate("2017-02-01T08:45:00+10:00").date) + self.assertEqual(inst.location[1].period.start.as_json(), "2017-02-01T08:45:00+10:00") + self.assertEqual(inst.location[1].status, "active") + self.assertEqual(inst.location[2].period.end.date, FHIRDate("2017-02-01T12:15:00+10:00").date) + self.assertEqual(inst.location[2].period.end.as_json(), "2017-02-01T12:15:00+10:00") + self.assertEqual(inst.location[2].period.start.date, FHIRDate("2017-02-01T09:27:00+10:00").date) + self.assertEqual(inst.location[2].period.start.as_json(), "2017-02-01T09:27:00+10:00") + self.assertEqual(inst.location[2].status, "active") + self.assertEqual(inst.location[3].period.end.date, FHIRDate("2017-02-01T12:45:00+10:00").date) + self.assertEqual(inst.location[3].period.end.as_json(), "2017-02-01T12:45:00+10:00") + self.assertEqual(inst.location[3].period.start.date, FHIRDate("2017-02-01T12:15:00+10:00").date) + self.assertEqual(inst.location[3].period.start.as_json(), "2017-02-01T12:15:00+10:00") + self.assertEqual(inst.location[3].status, "reserved") + self.assertEqual(inst.location[4].period.start.date, FHIRDate("2017-02-01T12:45:00+10:00").date) + self.assertEqual(inst.location[4].period.start.as_json(), "2017-02-01T12:45:00+10:00") + self.assertEqual(inst.location[4].status, "active") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.period.start.date, FHIRDate("2017-02-01T07:15:00+10:00").date) + self.assertEqual(inst.period.start.as_json(), "2017-02-01T07:15:00+10:00") self.assertEqual(inst.status, "in-progress") - self.assertEqual(inst.text.div, "
Encounter with patient @example
") + self.assertEqual(inst.statusHistory[0].period.end.date, FHIRDate("2017-02-01T07:35:00+10:00").date) + self.assertEqual(inst.statusHistory[0].period.end.as_json(), "2017-02-01T07:35:00+10:00") + self.assertEqual(inst.statusHistory[0].period.start.date, FHIRDate("2017-02-01T07:15:00+10:00").date) + self.assertEqual(inst.statusHistory[0].period.start.as_json(), "2017-02-01T07:15:00+10:00") + self.assertEqual(inst.statusHistory[0].status, "arrived") + self.assertEqual(inst.statusHistory[1].period.end.date, FHIRDate("2017-02-01T08:45:00+10:00").date) + self.assertEqual(inst.statusHistory[1].period.end.as_json(), "2017-02-01T08:45:00+10:00") + self.assertEqual(inst.statusHistory[1].period.start.date, FHIRDate("2017-02-01T07:35:00+10:00").date) + self.assertEqual(inst.statusHistory[1].period.start.as_json(), "2017-02-01T07:35:00+10:00") + self.assertEqual(inst.statusHistory[1].status, "triaged") + self.assertEqual(inst.statusHistory[2].period.end.date, FHIRDate("2017-02-01T12:15:00+10:00").date) + self.assertEqual(inst.statusHistory[2].period.end.as_json(), "2017-02-01T12:15:00+10:00") + self.assertEqual(inst.statusHistory[2].period.start.date, FHIRDate("2017-02-01T08:45:00+10:00").date) + self.assertEqual(inst.statusHistory[2].period.start.as_json(), "2017-02-01T08:45:00+10:00") + self.assertEqual(inst.statusHistory[2].status, "in-progress") + self.assertEqual(inst.statusHistory[3].period.end.date, FHIRDate("2017-02-01T12:45:00+10:00").date) + self.assertEqual(inst.statusHistory[3].period.end.as_json(), "2017-02-01T12:45:00+10:00") + self.assertEqual(inst.statusHistory[3].period.start.date, FHIRDate("2017-02-01T12:15:00+10:00").date) + self.assertEqual(inst.statusHistory[3].period.start.as_json(), "2017-02-01T12:15:00+10:00") + self.assertEqual(inst.statusHistory[3].status, "onleave") + self.assertEqual(inst.statusHistory[4].period.start.date, FHIRDate("2017-02-01T12:45:00+10:00").date) + self.assertEqual(inst.statusHistory[4].period.start.as_json(), "2017-02-01T12:45:00+10:00") + self.assertEqual(inst.statusHistory[4].status, "in-progress") + self.assertEqual(inst.text.div, "
Emergency visit that escalated into inpatient patient @example
") self.assertEqual(inst.text.status, "generated") def testEncounter5(self): - inst = self.instantiate_from("encounter-example-f002-lung.json") + inst = self.instantiate_from("encounter-example-home.json") self.assertIsNotNone(inst, "Must have instantiated a Encounter instance") self.implEncounter5(inst) @@ -166,43 +251,33 @@ def testEncounter5(self): self.implEncounter5(inst2) def implEncounter5(self, inst): - self.assertEqual(inst.class_fhir.code, "AMB") - self.assertEqual(inst.class_fhir.display, "ambulatory") + self.assertEqual(inst.class_fhir.code, "HH") + self.assertEqual(inst.class_fhir.display, "home health") self.assertEqual(inst.class_fhir.system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.hospitalization.admitSource.coding[0].code, "305997006") - self.assertEqual(inst.hospitalization.admitSource.coding[0].display, "Referral by radiologist") - self.assertEqual(inst.hospitalization.admitSource.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.hospitalization.dischargeDisposition.coding[0].code, "306689006") - self.assertEqual(inst.hospitalization.dischargeDisposition.coding[0].display, "Discharge to home") - self.assertEqual(inst.hospitalization.dischargeDisposition.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.hospitalization.preAdmissionIdentifier.system, "http://www.bmc.nl/zorgportal/identifiers/pre-admissions") - self.assertEqual(inst.hospitalization.preAdmissionIdentifier.use, "official") - self.assertEqual(inst.hospitalization.preAdmissionIdentifier.value, "98682") - self.assertEqual(inst.id, "f002") - self.assertEqual(inst.identifier[0].system, "http://www.bmc.nl/zorgportal/identifiers/encounters") - self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "v3251") - self.assertEqual(inst.length.code, "min") - self.assertEqual(inst.length.system, "http://unitsofmeasure.org") - self.assertEqual(inst.length.unit, "min") - self.assertEqual(inst.length.value, 140) + self.assertEqual(inst.contained[0].id, "home") + self.assertEqual(inst.id, "home") + self.assertEqual(inst.location[0].period.end.date, FHIRDate("2015-01-17T16:30:00+10:00").date) + self.assertEqual(inst.location[0].period.end.as_json(), "2015-01-17T16:30:00+10:00") + self.assertEqual(inst.location[0].period.start.date, FHIRDate("2015-01-17T16:00:00+10:00").date) + self.assertEqual(inst.location[0].period.start.as_json(), "2015-01-17T16:00:00+10:00") + self.assertEqual(inst.location[0].status, "completed") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.priority.coding[0].code, "103391001") - self.assertEqual(inst.priority.coding[0].display, "Urgent") - self.assertEqual(inst.priority.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.reasonCode[0].coding[0].code, "34068001") - self.assertEqual(inst.reasonCode[0].coding[0].display, "Partial lobectomy of lung") - self.assertEqual(inst.reasonCode[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.participant[0].period.end.date, FHIRDate("2015-01-17T16:30:00+10:00").date) + self.assertEqual(inst.participant[0].period.end.as_json(), "2015-01-17T16:30:00+10:00") + self.assertEqual(inst.participant[0].period.start.date, FHIRDate("2015-01-17T16:00:00+10:00").date) + self.assertEqual(inst.participant[0].period.start.as_json(), "2015-01-17T16:00:00+10:00") + self.assertEqual(inst.period.end.date, FHIRDate("2015-01-17T16:30:00+10:00").date) + self.assertEqual(inst.period.end.as_json(), "2015-01-17T16:30:00+10:00") + self.assertEqual(inst.period.start.date, FHIRDate("2015-01-17T16:00:00+10:00").date) + self.assertEqual(inst.period.start.as_json(), "2015-01-17T16:00:00+10:00") self.assertEqual(inst.status, "finished") + self.assertEqual(inst.text.div, "
Encounter with patient @example who is at home
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type[0].coding[0].code, "270427003") - self.assertEqual(inst.type[0].coding[0].display, "Patient-initiated encounter") - self.assertEqual(inst.type[0].coding[0].system, "http://snomed.info/sct") def testEncounter6(self): - inst = self.instantiate_from("encounter-example-f203-20130311.json") + inst = self.instantiate_from("encounter-example-xcda.json") self.assertIsNotNone(inst, "Must have instantiated a Encounter instance") self.implEncounter6(inst) @@ -212,6 +287,33 @@ def testEncounter6(self): self.implEncounter6(inst2) def implEncounter6(self, inst): + self.assertEqual(inst.class_fhir.code, "AMB") + self.assertEqual(inst.class_fhir.display, "ambulatory") + self.assertEqual(inst.class_fhir.system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") + self.assertEqual(inst.id, "xcda") + self.assertEqual(inst.identifier[0].system, "http://healthcare.example.org/identifiers/enocunter") + self.assertEqual(inst.identifier[0].use, "official") + self.assertEqual(inst.identifier[0].value, "1234213.52345873") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.reasonCode[0].coding[0].code, "T-D8200") + self.assertEqual(inst.reasonCode[0].coding[0].display, "Arm") + self.assertEqual(inst.reasonCode[0].coding[0].system, "http://ihe.net/xds/connectathon/eventCodes") + self.assertEqual(inst.status, "finished") + self.assertEqual(inst.text.status, "generated") + + def testEncounter7(self): + inst = self.instantiate_from("encounter-example-f203-20130311.json") + self.assertIsNotNone(inst, "Must have instantiated a Encounter instance") + self.implEncounter7(inst) + + js = inst.as_json() + self.assertEqual("Encounter", js["resourceType"]) + inst2 = encounter.Encounter(js) + self.implEncounter7(inst2) + + def implEncounter7(self, inst): self.assertEqual(inst.class_fhir.code, "IMP") self.assertEqual(inst.class_fhir.display, "inpatient encounter") self.assertEqual(inst.class_fhir.system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") @@ -260,35 +362,8 @@ def implEncounter6(self, inst): self.assertEqual(inst.type[0].coding[0].display, "Inpatient stay for nine days") self.assertEqual(inst.type[0].coding[0].system, "http://snomed.info/sct") - def testEncounter7(self): - inst = self.instantiate_from("encounter-example-xcda.json") - self.assertIsNotNone(inst, "Must have instantiated a Encounter instance") - self.implEncounter7(inst) - - js = inst.as_json() - self.assertEqual("Encounter", js["resourceType"]) - inst2 = encounter.Encounter(js) - self.implEncounter7(inst2) - - def implEncounter7(self, inst): - self.assertEqual(inst.class_fhir.code, "AMB") - self.assertEqual(inst.class_fhir.display, "ambulatory") - self.assertEqual(inst.class_fhir.system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.id, "xcda") - self.assertEqual(inst.identifier[0].system, "http://healthcare.example.org/identifiers/enocunter") - self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "1234213.52345873") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.reasonCode[0].coding[0].code, "T-D8200") - self.assertEqual(inst.reasonCode[0].coding[0].display, "Arm") - self.assertEqual(inst.reasonCode[0].coding[0].system, "http://ihe.net/xds/connectathon/eventCodes") - self.assertEqual(inst.status, "finished") - self.assertEqual(inst.text.status, "generated") - def testEncounter8(self): - inst = self.instantiate_from("encounter-example-f202-20130128.json") + inst = self.instantiate_from("encounter-example.json") self.assertIsNotNone(inst, "Must have instantiated a Encounter instance") self.implEncounter8(inst) @@ -298,39 +373,19 @@ def testEncounter8(self): self.implEncounter8(inst2) def implEncounter8(self, inst): - self.assertEqual(inst.class_fhir.code, "AMB") - self.assertEqual(inst.class_fhir.display, "ambulatory") + self.assertEqual(inst.class_fhir.code, "IMP") + self.assertEqual(inst.class_fhir.display, "inpatient encounter") self.assertEqual(inst.class_fhir.system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.diagnosis[0].rank, 2) - self.assertEqual(inst.diagnosis[0].use.coding[0].code, "AD") - self.assertEqual(inst.diagnosis[0].use.coding[0].display, "Admission diagnosis") - self.assertEqual(inst.diagnosis[0].use.coding[0].system, "http://terminology.hl7.org/CodeSystem/diagnosis-role") - self.assertEqual(inst.diagnosis[1].rank, 1) - self.assertEqual(inst.diagnosis[1].use.coding[0].code, "CC") - self.assertEqual(inst.diagnosis[1].use.coding[0].display, "Chief complaint") - self.assertEqual(inst.diagnosis[1].use.coding[0].system, "http://terminology.hl7.org/CodeSystem/diagnosis-role") - self.assertEqual(inst.id, "f202") - self.assertEqual(inst.identifier[0].use, "temp") - self.assertEqual(inst.identifier[0].value, "Encounter_Roel_20130128") - self.assertEqual(inst.length.code, "min") - self.assertEqual(inst.length.system, "http://unitsofmeasure.org") - self.assertEqual(inst.length.unit, "minutes") - self.assertEqual(inst.length.value, 56) + self.assertEqual(inst.id, "example") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.priority.coding[0].code, "103391001") - self.assertEqual(inst.priority.coding[0].display, "Urgent") - self.assertEqual(inst.priority.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.reasonCode[0].text, "The patient is treated for a tumor.") - self.assertEqual(inst.status, "finished") + self.assertEqual(inst.status, "in-progress") + self.assertEqual(inst.text.div, "
Encounter with patient @example
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type[0].coding[0].code, "367336001") - self.assertEqual(inst.type[0].coding[0].display, "Chemotherapy") - self.assertEqual(inst.type[0].coding[0].system, "http://snomed.info/sct") def testEncounter9(self): - inst = self.instantiate_from("encounter-example-emerg.json") + inst = self.instantiate_from("encounter-example-f201-20130404.json") self.assertIsNotNone(inst, "Must have instantiated a Encounter instance") self.implEncounter9(inst) @@ -340,82 +395,27 @@ def testEncounter9(self): self.implEncounter9(inst2) def implEncounter9(self, inst): - self.assertEqual(inst.classHistory[0].class_fhir.code, "EMER") - self.assertEqual(inst.classHistory[0].class_fhir.display, "emergency") - self.assertEqual(inst.classHistory[0].class_fhir.system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.classHistory[0].period.end.date, FHIRDate("2017-02-01T09:27:00+10:00").date) - self.assertEqual(inst.classHistory[0].period.end.as_json(), "2017-02-01T09:27:00+10:00") - self.assertEqual(inst.classHistory[0].period.start.date, FHIRDate("2017-02-01T07:15:00+10:00").date) - self.assertEqual(inst.classHistory[0].period.start.as_json(), "2017-02-01T07:15:00+10:00") - self.assertEqual(inst.classHistory[1].class_fhir.code, "IMP") - self.assertEqual(inst.classHistory[1].class_fhir.display, "inpatient encounter") - self.assertEqual(inst.classHistory[1].class_fhir.system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.classHistory[1].period.start.date, FHIRDate("2017-02-01T09:27:00+10:00").date) - self.assertEqual(inst.classHistory[1].period.start.as_json(), "2017-02-01T09:27:00+10:00") - self.assertEqual(inst.class_fhir.code, "IMP") - self.assertEqual(inst.class_fhir.display, "inpatient encounter") + self.assertEqual(inst.class_fhir.code, "AMB") + self.assertEqual(inst.class_fhir.display, "ambulatory") self.assertEqual(inst.class_fhir.system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.hospitalization.admitSource.coding[0].code, "emd") - self.assertEqual(inst.hospitalization.admitSource.coding[0].display, "From accident/emergency department") - self.assertEqual(inst.hospitalization.admitSource.coding[0].system, "http://terminology.hl7.org/CodeSystem/admit-source") - self.assertEqual(inst.id, "emerg") - self.assertEqual(inst.location[0].period.end.date, FHIRDate("2017-02-01T08:45:00+10:00").date) - self.assertEqual(inst.location[0].period.end.as_json(), "2017-02-01T08:45:00+10:00") - self.assertEqual(inst.location[0].period.start.date, FHIRDate("2017-02-01T07:15:00+10:00").date) - self.assertEqual(inst.location[0].period.start.as_json(), "2017-02-01T07:15:00+10:00") - self.assertEqual(inst.location[0].status, "active") - self.assertEqual(inst.location[1].period.end.date, FHIRDate("2017-02-01T09:27:00+10:00").date) - self.assertEqual(inst.location[1].period.end.as_json(), "2017-02-01T09:27:00+10:00") - self.assertEqual(inst.location[1].period.start.date, FHIRDate("2017-02-01T08:45:00+10:00").date) - self.assertEqual(inst.location[1].period.start.as_json(), "2017-02-01T08:45:00+10:00") - self.assertEqual(inst.location[1].status, "active") - self.assertEqual(inst.location[2].period.end.date, FHIRDate("2017-02-01T12:15:00+10:00").date) - self.assertEqual(inst.location[2].period.end.as_json(), "2017-02-01T12:15:00+10:00") - self.assertEqual(inst.location[2].period.start.date, FHIRDate("2017-02-01T09:27:00+10:00").date) - self.assertEqual(inst.location[2].period.start.as_json(), "2017-02-01T09:27:00+10:00") - self.assertEqual(inst.location[2].status, "active") - self.assertEqual(inst.location[3].period.end.date, FHIRDate("2017-02-01T12:45:00+10:00").date) - self.assertEqual(inst.location[3].period.end.as_json(), "2017-02-01T12:45:00+10:00") - self.assertEqual(inst.location[3].period.start.date, FHIRDate("2017-02-01T12:15:00+10:00").date) - self.assertEqual(inst.location[3].period.start.as_json(), "2017-02-01T12:15:00+10:00") - self.assertEqual(inst.location[3].status, "reserved") - self.assertEqual(inst.location[4].period.start.date, FHIRDate("2017-02-01T12:45:00+10:00").date) - self.assertEqual(inst.location[4].period.start.as_json(), "2017-02-01T12:45:00+10:00") - self.assertEqual(inst.location[4].status, "active") + self.assertEqual(inst.id, "f201") + self.assertEqual(inst.identifier[0].use, "temp") + self.assertEqual(inst.identifier[0].value, "Encounter_Roel_20130404") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.period.start.date, FHIRDate("2017-02-01T07:15:00+10:00").date) - self.assertEqual(inst.period.start.as_json(), "2017-02-01T07:15:00+10:00") - self.assertEqual(inst.status, "in-progress") - self.assertEqual(inst.statusHistory[0].period.end.date, FHIRDate("2017-02-01T07:35:00+10:00").date) - self.assertEqual(inst.statusHistory[0].period.end.as_json(), "2017-02-01T07:35:00+10:00") - self.assertEqual(inst.statusHistory[0].period.start.date, FHIRDate("2017-02-01T07:15:00+10:00").date) - self.assertEqual(inst.statusHistory[0].period.start.as_json(), "2017-02-01T07:15:00+10:00") - self.assertEqual(inst.statusHistory[0].status, "arrived") - self.assertEqual(inst.statusHistory[1].period.end.date, FHIRDate("2017-02-01T08:45:00+10:00").date) - self.assertEqual(inst.statusHistory[1].period.end.as_json(), "2017-02-01T08:45:00+10:00") - self.assertEqual(inst.statusHistory[1].period.start.date, FHIRDate("2017-02-01T07:35:00+10:00").date) - self.assertEqual(inst.statusHistory[1].period.start.as_json(), "2017-02-01T07:35:00+10:00") - self.assertEqual(inst.statusHistory[1].status, "triaged") - self.assertEqual(inst.statusHistory[2].period.end.date, FHIRDate("2017-02-01T12:15:00+10:00").date) - self.assertEqual(inst.statusHistory[2].period.end.as_json(), "2017-02-01T12:15:00+10:00") - self.assertEqual(inst.statusHistory[2].period.start.date, FHIRDate("2017-02-01T08:45:00+10:00").date) - self.assertEqual(inst.statusHistory[2].period.start.as_json(), "2017-02-01T08:45:00+10:00") - self.assertEqual(inst.statusHistory[2].status, "in-progress") - self.assertEqual(inst.statusHistory[3].period.end.date, FHIRDate("2017-02-01T12:45:00+10:00").date) - self.assertEqual(inst.statusHistory[3].period.end.as_json(), "2017-02-01T12:45:00+10:00") - self.assertEqual(inst.statusHistory[3].period.start.date, FHIRDate("2017-02-01T12:15:00+10:00").date) - self.assertEqual(inst.statusHistory[3].period.start.as_json(), "2017-02-01T12:15:00+10:00") - self.assertEqual(inst.statusHistory[3].status, "onleave") - self.assertEqual(inst.statusHistory[4].period.start.date, FHIRDate("2017-02-01T12:45:00+10:00").date) - self.assertEqual(inst.statusHistory[4].period.start.as_json(), "2017-02-01T12:45:00+10:00") - self.assertEqual(inst.statusHistory[4].status, "in-progress") - self.assertEqual(inst.text.div, "
Emergency visit that escalated into inpatient patient @example
") + self.assertEqual(inst.priority.coding[0].code, "17621005") + self.assertEqual(inst.priority.coding[0].display, "Normal") + self.assertEqual(inst.priority.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.reasonCode[0].text, "The patient had fever peaks over the last couple of days. He is worried about these peaks.") + self.assertEqual(inst.status, "finished") self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.type[0].coding[0].code, "11429006") + self.assertEqual(inst.type[0].coding[0].display, "Consultation") + self.assertEqual(inst.type[0].coding[0].system, "http://snomed.info/sct") def testEncounter10(self): - inst = self.instantiate_from("encounter-example-f001-heart.json") + inst = self.instantiate_from("encounter-example-f002-lung.json") self.assertIsNotNone(inst, "Must have instantiated a Encounter instance") self.implEncounter10(inst) @@ -428,19 +428,19 @@ def implEncounter10(self, inst): self.assertEqual(inst.class_fhir.code, "AMB") self.assertEqual(inst.class_fhir.display, "ambulatory") self.assertEqual(inst.class_fhir.system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.hospitalization.admitSource.coding[0].code, "305956004") - self.assertEqual(inst.hospitalization.admitSource.coding[0].display, "Referral by physician") + self.assertEqual(inst.hospitalization.admitSource.coding[0].code, "305997006") + self.assertEqual(inst.hospitalization.admitSource.coding[0].display, "Referral by radiologist") self.assertEqual(inst.hospitalization.admitSource.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.hospitalization.dischargeDisposition.coding[0].code, "306689006") self.assertEqual(inst.hospitalization.dischargeDisposition.coding[0].display, "Discharge to home") self.assertEqual(inst.hospitalization.dischargeDisposition.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.hospitalization.preAdmissionIdentifier.system, "http://www.amc.nl/zorgportal/identifiers/pre-admissions") + self.assertEqual(inst.hospitalization.preAdmissionIdentifier.system, "http://www.bmc.nl/zorgportal/identifiers/pre-admissions") self.assertEqual(inst.hospitalization.preAdmissionIdentifier.use, "official") - self.assertEqual(inst.hospitalization.preAdmissionIdentifier.value, "93042") - self.assertEqual(inst.id, "f001") - self.assertEqual(inst.identifier[0].system, "http://www.amc.nl/zorgportal/identifiers/visits") + self.assertEqual(inst.hospitalization.preAdmissionIdentifier.value, "98682") + self.assertEqual(inst.id, "f002") + self.assertEqual(inst.identifier[0].system, "http://www.bmc.nl/zorgportal/identifiers/encounters") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "v1451") + self.assertEqual(inst.identifier[0].value, "v3251") self.assertEqual(inst.length.code, "min") self.assertEqual(inst.length.system, "http://unitsofmeasure.org") self.assertEqual(inst.length.unit, "min") @@ -448,11 +448,11 @@ def implEncounter10(self, inst): self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.priority.coding[0].code, "310361003") - self.assertEqual(inst.priority.coding[0].display, "Non-urgent cardiological admission") + self.assertEqual(inst.priority.coding[0].code, "103391001") + self.assertEqual(inst.priority.coding[0].display, "Urgent") self.assertEqual(inst.priority.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.reasonCode[0].coding[0].code, "34068001") - self.assertEqual(inst.reasonCode[0].coding[0].display, "Heart valve replacement") + self.assertEqual(inst.reasonCode[0].coding[0].display, "Partial lobectomy of lung") self.assertEqual(inst.reasonCode[0].coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.status, "finished") self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/endpoint.py b/fhirclient/models/endpoint.py index 1dcffb47d..df9a319c7 100644 --- a/fhirclient/models/endpoint.py +++ b/fhirclient/models/endpoint.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Endpoint) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Endpoint) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/endpoint_tests.py b/fhirclient/models/endpoint_tests.py index 73ab722e8..1337d9525 100644 --- a/fhirclient/models/endpoint_tests.py +++ b/fhirclient/models/endpoint_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return endpoint.Endpoint(js) def testEndpoint1(self): - inst = self.instantiate_from("endpoint-example-iid.json") + inst = self.instantiate_from("endpoint-example.json") self.assertIsNotNone(inst, "Must have instantiated a Endpoint instance") self.implEndpoint1(inst) @@ -32,20 +32,30 @@ def testEndpoint1(self): self.implEndpoint1(inst2) def implEndpoint1(self, inst): - self.assertEqual(inst.address, "https://pacs.hospital.org/IHEInvokeImageDisplay") - self.assertEqual(inst.connectionType.code, "ihe-iid") + self.assertEqual(inst.address, "http://fhir3.healthintersections.com.au/open/CarePlan") + self.assertEqual(inst.connectionType.code, "hl7-fhir-rest") self.assertEqual(inst.connectionType.system, "http://terminology.hl7.org/CodeSystem/endpoint-connection-type") - self.assertEqual(inst.id, "example-iid") + self.assertEqual(inst.contact[0].system, "email") + self.assertEqual(inst.contact[0].use, "work") + self.assertEqual(inst.contact[0].value, "endpointmanager@example.org") + self.assertEqual(inst.header[0], "bearer-code BASGS534s4") + self.assertEqual(inst.id, "example") + self.assertEqual(inst.identifier[0].system, "http://example.org/enpoint-identifier") + self.assertEqual(inst.identifier[0].value, "epcp12") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "PACS Hospital Invoke Image Display endpoint") - self.assertEqual(inst.payloadType[0].text, "DICOM IID") + self.assertEqual(inst.name, "Health Intersections CarePlan Hub") + self.assertEqual(inst.payloadMimeType[0], "application/fhir+xml") + self.assertEqual(inst.payloadType[0].coding[0].code, "CarePlan") + self.assertEqual(inst.payloadType[0].coding[0].system, "http://hl7.org/fhir/resource-types") + self.assertEqual(inst.period.start.date, FHIRDate("2014-09-01").date) + self.assertEqual(inst.period.start.as_json(), "2014-09-01") self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") def testEndpoint2(self): - inst = self.instantiate_from("endpoint-example-direct.json") + inst = self.instantiate_from("endpoint-example-iid.json") self.assertIsNotNone(inst, "Must have instantiated a Endpoint instance") self.implEndpoint2(inst) @@ -55,15 +65,15 @@ def testEndpoint2(self): self.implEndpoint2(inst2) def implEndpoint2(self, inst): - self.assertEqual(inst.address, "mailto:MARTIN.SMIETANKA@directnppes.com") - self.assertEqual(inst.connectionType.code, "direct-project") - self.assertEqual(inst.id, "direct-endpoint") + self.assertEqual(inst.address, "https://pacs.hospital.org/IHEInvokeImageDisplay") + self.assertEqual(inst.connectionType.code, "ihe-iid") + self.assertEqual(inst.connectionType.system, "http://terminology.hl7.org/CodeSystem/endpoint-connection-type") + self.assertEqual(inst.id, "example-iid") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "MARTIN SMIETANKA") - self.assertEqual(inst.payloadType[0].coding[0].code, "urn:hl7-org:sdwg:ccda-structuredBody:1.1") - self.assertEqual(inst.payloadType[0].coding[0].system, "urn:oid:1.3.6.1.4.1.19376.1.2.3") + self.assertEqual(inst.name, "PACS Hospital Invoke Image Display endpoint") + self.assertEqual(inst.payloadType[0].text, "DICOM IID") self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") @@ -92,7 +102,7 @@ def implEndpoint3(self, inst): self.assertEqual(inst.text.status, "generated") def testEndpoint4(self): - inst = self.instantiate_from("endpoint-example.json") + inst = self.instantiate_from("endpoint-example-direct.json") self.assertIsNotNone(inst, "Must have instantiated a Endpoint instance") self.implEndpoint4(inst) @@ -102,25 +112,15 @@ def testEndpoint4(self): self.implEndpoint4(inst2) def implEndpoint4(self, inst): - self.assertEqual(inst.address, "http://fhir3.healthintersections.com.au/open/CarePlan") - self.assertEqual(inst.connectionType.code, "hl7-fhir-rest") - self.assertEqual(inst.connectionType.system, "http://terminology.hl7.org/CodeSystem/endpoint-connection-type") - self.assertEqual(inst.contact[0].system, "email") - self.assertEqual(inst.contact[0].use, "work") - self.assertEqual(inst.contact[0].value, "endpointmanager@example.org") - self.assertEqual(inst.header[0], "bearer-code BASGS534s4") - self.assertEqual(inst.id, "example") - self.assertEqual(inst.identifier[0].system, "http://example.org/enpoint-identifier") - self.assertEqual(inst.identifier[0].value, "epcp12") + self.assertEqual(inst.address, "mailto:MARTIN.SMIETANKA@directnppes.com") + self.assertEqual(inst.connectionType.code, "direct-project") + self.assertEqual(inst.id, "direct-endpoint") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "Health Intersections CarePlan Hub") - self.assertEqual(inst.payloadMimeType[0], "application/fhir+xml") - self.assertEqual(inst.payloadType[0].coding[0].code, "CarePlan") - self.assertEqual(inst.payloadType[0].coding[0].system, "http://hl7.org/fhir/resource-types") - self.assertEqual(inst.period.start.date, FHIRDate("2014-09-01").date) - self.assertEqual(inst.period.start.as_json(), "2014-09-01") + self.assertEqual(inst.name, "MARTIN SMIETANKA") + self.assertEqual(inst.payloadType[0].coding[0].code, "urn:hl7-org:sdwg:ccda-structuredBody:1.1") + self.assertEqual(inst.payloadType[0].coding[0].system, "urn:oid:1.3.6.1.4.1.19376.1.2.3") self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/enrollmentrequest.py b/fhirclient/models/enrollmentrequest.py index 1eab212c0..b15b07229 100644 --- a/fhirclient/models/enrollmentrequest.py +++ b/fhirclient/models/enrollmentrequest.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/EnrollmentRequest) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EnrollmentRequest) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/enrollmentrequest_tests.py b/fhirclient/models/enrollmentrequest_tests.py index 431e53564..4c15bbe5e 100644 --- a/fhirclient/models/enrollmentrequest_tests.py +++ b/fhirclient/models/enrollmentrequest_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/enrollmentresponse.py b/fhirclient/models/enrollmentresponse.py index eb380c52d..d1a422515 100644 --- a/fhirclient/models/enrollmentresponse.py +++ b/fhirclient/models/enrollmentresponse.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/EnrollmentResponse) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EnrollmentResponse) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/enrollmentresponse_tests.py b/fhirclient/models/enrollmentresponse_tests.py index 6e721e841..7f3a776c8 100644 --- a/fhirclient/models/enrollmentresponse_tests.py +++ b/fhirclient/models/enrollmentresponse_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/episodeofcare.py b/fhirclient/models/episodeofcare.py index b0d1ee2ec..52ae325ca 100644 --- a/fhirclient/models/episodeofcare.py +++ b/fhirclient/models/episodeofcare.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/EpisodeOfCare) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EpisodeOfCare) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/episodeofcare_tests.py b/fhirclient/models/episodeofcare_tests.py index 1781fcff3..1a3bb4f1a 100644 --- a/fhirclient/models/episodeofcare_tests.py +++ b/fhirclient/models/episodeofcare_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/eventdefinition.py b/fhirclient/models/eventdefinition.py index f3a18a3e3..2d066d34d 100644 --- a/fhirclient/models/eventdefinition.py +++ b/fhirclient/models/eventdefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/EventDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EventDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/eventdefinition_tests.py b/fhirclient/models/eventdefinition_tests.py index 903d444ae..b66f5714f 100644 --- a/fhirclient/models/eventdefinition_tests.py +++ b/fhirclient/models/eventdefinition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/evidence.py b/fhirclient/models/evidence.py index d2b6ba5ee..8cc4247ca 100644 --- a/fhirclient/models/evidence.py +++ b/fhirclient/models/evidence.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Evidence) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Evidence) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/evidence_tests.py b/fhirclient/models/evidence_tests.py index e61c309ae..4b6090385 100644 --- a/fhirclient/models/evidence_tests.py +++ b/fhirclient/models/evidence_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/evidencevariable.py b/fhirclient/models/evidencevariable.py index e0ef1fb60..ea93c4874 100644 --- a/fhirclient/models/evidencevariable.py +++ b/fhirclient/models/evidencevariable.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/EvidenceVariable) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EvidenceVariable) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/evidencevariable_tests.py b/fhirclient/models/evidencevariable_tests.py index 1f0d8069b..1da86fe84 100644 --- a/fhirclient/models/evidencevariable_tests.py +++ b/fhirclient/models/evidencevariable_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/examplescenario.py b/fhirclient/models/examplescenario.py index dcc85f74a..09379dc6e 100644 --- a/fhirclient/models/examplescenario.py +++ b/fhirclient/models/examplescenario.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ExampleScenario) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ExampleScenario) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/examplescenario_tests.py b/fhirclient/models/examplescenario_tests.py index 451a4cc24..0f3225e34 100644 --- a/fhirclient/models/examplescenario_tests.py +++ b/fhirclient/models/examplescenario_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/explanationofbenefit.py b/fhirclient/models/explanationofbenefit.py index e855bcab0..39c20d31f 100644 --- a/fhirclient/models/explanationofbenefit.py +++ b/fhirclient/models/explanationofbenefit.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/explanationofbenefit_tests.py b/fhirclient/models/explanationofbenefit_tests.py index b45c18c5e..b0f757719 100644 --- a/fhirclient/models/explanationofbenefit_tests.py +++ b/fhirclient/models/explanationofbenefit_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return explanationofbenefit.ExplanationOfBenefit(js) def testExplanationOfBenefit1(self): - inst = self.instantiate_from("explanationofbenefit-example.json") + inst = self.instantiate_from("explanationofbenefit-example-2.json") self.assertIsNotNone(inst, "Must have instantiated a ExplanationOfBenefit instance") self.implExplanationOfBenefit1(inst) @@ -32,6 +32,79 @@ def testExplanationOfBenefit1(self): self.implExplanationOfBenefit1(inst2) def implExplanationOfBenefit1(self, inst): + self.assertEqual(inst.accident.date.date, FHIRDate("2014-02-14").date) + self.assertEqual(inst.accident.date.as_json(), "2014-02-14") + self.assertEqual(inst.accident.type.coding[0].code, "SPT") + self.assertEqual(inst.accident.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") + self.assertEqual(inst.billablePeriod.end.date, FHIRDate("2014-03-01").date) + self.assertEqual(inst.billablePeriod.end.as_json(), "2014-03-01") + self.assertEqual(inst.billablePeriod.start.date, FHIRDate("2014-02-01").date) + self.assertEqual(inst.billablePeriod.start.as_json(), "2014-02-01") + self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.as_json(), "2014-08-16") + self.assertEqual(inst.disposition, "Could not process.") + self.assertEqual(inst.formCode.coding[0].code, "2") + self.assertEqual(inst.formCode.coding[0].system, "http://terminology.hl7.org/CodeSystem/forms-codes") + self.assertEqual(inst.id, "EB3501") + self.assertEqual(inst.identifier[0].system, "http://www.BenefitsInc.com/fhir/explanationofbenefit") + self.assertEqual(inst.identifier[0].value, "error-1") + self.assertTrue(inst.insurance[0].focal) + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.outcome, "error") + self.assertEqual(inst.precedence, 2) + self.assertEqual(inst.procedure[0].date.date, FHIRDate("2014-02-14").date) + self.assertEqual(inst.procedure[0].date.as_json(), "2014-02-14") + self.assertEqual(inst.procedure[0].procedureCodeableConcept.coding[0].code, "123001") + self.assertEqual(inst.procedure[0].procedureCodeableConcept.coding[0].system, "http://hl7.org/fhir/sid/ex-icd-10-procedures") + self.assertEqual(inst.procedure[0].sequence, 1) + self.assertEqual(inst.processNote[0].language.coding[0].code, "en-CA") + self.assertEqual(inst.processNote[0].language.coding[0].system, "urn:ietf:bcp:47") + self.assertEqual(inst.processNote[0].number, 1) + self.assertEqual(inst.processNote[0].text, "Invalid claim") + self.assertEqual(inst.processNote[0].type, "display") + self.assertEqual(inst.related[0].reference.system, "http://www.BenefitsInc.com/case-number") + self.assertEqual(inst.related[0].reference.value, "23-56Tu-XX-47-20150M14") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.subType.coding[0].code, "emergency") + self.assertEqual(inst.subType.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-claimsubtype") + self.assertEqual(inst.supportingInfo[0].category.coding[0].code, "employmentimpacted") + self.assertEqual(inst.supportingInfo[0].category.coding[0].system, "http://terminology.hl7.org/CodeSystem/claiminformationcategory") + self.assertEqual(inst.supportingInfo[0].sequence, 1) + self.assertEqual(inst.supportingInfo[0].timingPeriod.end.date, FHIRDate("2014-02-28").date) + self.assertEqual(inst.supportingInfo[0].timingPeriod.end.as_json(), "2014-02-28") + self.assertEqual(inst.supportingInfo[0].timingPeriod.start.date, FHIRDate("2014-02-14").date) + self.assertEqual(inst.supportingInfo[0].timingPeriod.start.as_json(), "2014-02-14") + self.assertEqual(inst.supportingInfo[1].category.coding[0].code, "hospitalized") + self.assertEqual(inst.supportingInfo[1].category.coding[0].system, "http://terminology.hl7.org/CodeSystem/claiminformationcategory") + self.assertEqual(inst.supportingInfo[1].sequence, 2) + self.assertEqual(inst.supportingInfo[1].timingPeriod.end.date, FHIRDate("2014-02-16").date) + self.assertEqual(inst.supportingInfo[1].timingPeriod.end.as_json(), "2014-02-16") + self.assertEqual(inst.supportingInfo[1].timingPeriod.start.date, FHIRDate("2014-02-14").date) + self.assertEqual(inst.supportingInfo[1].timingPeriod.start.as_json(), "2014-02-14") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.total[0].amount.currency, "USD") + self.assertEqual(inst.total[0].amount.value, 2478.57) + self.assertEqual(inst.total[0].category.coding[0].code, "submitted") + self.assertEqual(inst.total[1].amount.currency, "USD") + self.assertEqual(inst.total[1].amount.value, 0.0) + self.assertEqual(inst.total[1].category.coding[0].code, "benefit") + self.assertEqual(inst.type.coding[0].code, "oral") + self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") + self.assertEqual(inst.use, "claim") + + def testExplanationOfBenefit2(self): + inst = self.instantiate_from("explanationofbenefit-example.json") + self.assertIsNotNone(inst, "Must have instantiated a ExplanationOfBenefit instance") + self.implExplanationOfBenefit2(inst) + + js = inst.as_json() + self.assertEqual("ExplanationOfBenefit", js["resourceType"]) + inst2 = explanationofbenefit.ExplanationOfBenefit(js) + self.implExplanationOfBenefit2(inst2) + + def implExplanationOfBenefit2(self, inst): self.assertEqual(inst.careTeam[0].sequence, 1) self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) self.assertEqual(inst.created.as_json(), "2014-08-16") @@ -108,77 +181,4 @@ def implExplanationOfBenefit1(self, inst): self.assertEqual(inst.type.coding[0].code, "oral") self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") self.assertEqual(inst.use, "claim") - - def testExplanationOfBenefit2(self): - inst = self.instantiate_from("explanationofbenefit-example-2.json") - self.assertIsNotNone(inst, "Must have instantiated a ExplanationOfBenefit instance") - self.implExplanationOfBenefit2(inst) - - js = inst.as_json() - self.assertEqual("ExplanationOfBenefit", js["resourceType"]) - inst2 = explanationofbenefit.ExplanationOfBenefit(js) - self.implExplanationOfBenefit2(inst2) - - def implExplanationOfBenefit2(self, inst): - self.assertEqual(inst.accident.date.date, FHIRDate("2014-02-14").date) - self.assertEqual(inst.accident.date.as_json(), "2014-02-14") - self.assertEqual(inst.accident.type.coding[0].code, "SPT") - self.assertEqual(inst.accident.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.billablePeriod.end.date, FHIRDate("2014-03-01").date) - self.assertEqual(inst.billablePeriod.end.as_json(), "2014-03-01") - self.assertEqual(inst.billablePeriod.start.date, FHIRDate("2014-02-01").date) - self.assertEqual(inst.billablePeriod.start.as_json(), "2014-02-01") - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.created.as_json(), "2014-08-16") - self.assertEqual(inst.disposition, "Could not process.") - self.assertEqual(inst.formCode.coding[0].code, "2") - self.assertEqual(inst.formCode.coding[0].system, "http://terminology.hl7.org/CodeSystem/forms-codes") - self.assertEqual(inst.id, "EB3501") - self.assertEqual(inst.identifier[0].system, "http://www.BenefitsInc.com/fhir/explanationofbenefit") - self.assertEqual(inst.identifier[0].value, "error-1") - self.assertTrue(inst.insurance[0].focal) - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.outcome, "error") - self.assertEqual(inst.precedence, 2) - self.assertEqual(inst.procedure[0].date.date, FHIRDate("2014-02-14").date) - self.assertEqual(inst.procedure[0].date.as_json(), "2014-02-14") - self.assertEqual(inst.procedure[0].procedureCodeableConcept.coding[0].code, "123001") - self.assertEqual(inst.procedure[0].procedureCodeableConcept.coding[0].system, "http://hl7.org/fhir/sid/ex-icd-10-procedures") - self.assertEqual(inst.procedure[0].sequence, 1) - self.assertEqual(inst.processNote[0].language.coding[0].code, "en-CA") - self.assertEqual(inst.processNote[0].language.coding[0].system, "urn:ietf:bcp:47") - self.assertEqual(inst.processNote[0].number, 1) - self.assertEqual(inst.processNote[0].text, "Invalid claim") - self.assertEqual(inst.processNote[0].type, "display") - self.assertEqual(inst.related[0].reference.system, "http://www.BenefitsInc.com/case-number") - self.assertEqual(inst.related[0].reference.value, "23-56Tu-XX-47-20150M14") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.subType.coding[0].code, "emergency") - self.assertEqual(inst.subType.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-claimsubtype") - self.assertEqual(inst.supportingInfo[0].category.coding[0].code, "employmentimpacted") - self.assertEqual(inst.supportingInfo[0].category.coding[0].system, "http://terminology.hl7.org/CodeSystem/claiminformationcategory") - self.assertEqual(inst.supportingInfo[0].sequence, 1) - self.assertEqual(inst.supportingInfo[0].timingPeriod.end.date, FHIRDate("2014-02-28").date) - self.assertEqual(inst.supportingInfo[0].timingPeriod.end.as_json(), "2014-02-28") - self.assertEqual(inst.supportingInfo[0].timingPeriod.start.date, FHIRDate("2014-02-14").date) - self.assertEqual(inst.supportingInfo[0].timingPeriod.start.as_json(), "2014-02-14") - self.assertEqual(inst.supportingInfo[1].category.coding[0].code, "hospitalized") - self.assertEqual(inst.supportingInfo[1].category.coding[0].system, "http://terminology.hl7.org/CodeSystem/claiminformationcategory") - self.assertEqual(inst.supportingInfo[1].sequence, 2) - self.assertEqual(inst.supportingInfo[1].timingPeriod.end.date, FHIRDate("2014-02-16").date) - self.assertEqual(inst.supportingInfo[1].timingPeriod.end.as_json(), "2014-02-16") - self.assertEqual(inst.supportingInfo[1].timingPeriod.start.date, FHIRDate("2014-02-14").date) - self.assertEqual(inst.supportingInfo[1].timingPeriod.start.as_json(), "2014-02-14") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.total[0].amount.currency, "USD") - self.assertEqual(inst.total[0].amount.value, 2478.57) - self.assertEqual(inst.total[0].category.coding[0].code, "submitted") - self.assertEqual(inst.total[1].amount.currency, "USD") - self.assertEqual(inst.total[1].amount.value, 0.0) - self.assertEqual(inst.total[1].category.coding[0].code, "benefit") - self.assertEqual(inst.type.coding[0].code, "oral") - self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/claim-type") - self.assertEqual(inst.use, "claim") diff --git a/fhirclient/models/expression.py b/fhirclient/models/expression.py index 119206532..858c149e2 100644 --- a/fhirclient/models/expression.py +++ b/fhirclient/models/expression.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Expression) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Expression) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/extension.py b/fhirclient/models/extension.py index 2dff366d8..b87b1a049 100644 --- a/fhirclient/models/extension.py +++ b/fhirclient/models/extension.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Extension) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Extension) on 2024-07-15. +# 2024, SMART Health IT. from . import element @@ -139,6 +139,10 @@ def __init__(self, jsondict=None, strict=True): """ Value of extension. Type `str`. """ + self.valueMeta = None + """ Value of extension. + Type `Meta` (represented as `dict` in JSON). """ + self.valueMoney = None """ Value of extension. Type `Money` (represented as `dict` in JSON). """ @@ -257,6 +261,7 @@ def elementProperties(self): ("valueInstant", "valueInstant", fhirdate.FHIRDate, False, "value", False), ("valueInteger", "valueInteger", int, False, "value", False), ("valueMarkdown", "valueMarkdown", str, False, "value", False), + ("valueMeta", "valueMeta", meta.Meta, False, "value", False), ("valueMoney", "valueMoney", money.Money, False, "value", False), ("valueOid", "valueOid", str, False, "value", False), ("valueParameterDefinition", "valueParameterDefinition", parameterdefinition.ParameterDefinition, False, "value", False), @@ -359,6 +364,10 @@ def elementProperties(self): from . import identifier except ImportError: identifier = sys.modules[__package__ + '.identifier'] +try: + from . import meta +except ImportError: + meta = sys.modules[__package__ + '.meta'] try: from . import money except ImportError: diff --git a/fhirclient/models/familymemberhistory.py b/fhirclient/models/familymemberhistory.py index 176c089f7..94b82c3d7 100644 --- a/fhirclient/models/familymemberhistory.py +++ b/fhirclient/models/familymemberhistory.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/familymemberhistory_tests.py b/fhirclient/models/familymemberhistory_tests.py index 5345cb4e7..ecb2d5db0 100644 --- a/fhirclient/models/familymemberhistory_tests.py +++ b/fhirclient/models/familymemberhistory_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/fhirelementfactory.py b/fhirclient/models/fhirelementfactory.py index 0016e3eeb..30b1a1571 100644 --- a/fhirclient/models/fhirelementfactory.py +++ b/fhirclient/models/fhirelementfactory.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. class FHIRElementFactory(object): diff --git a/fhirclient/models/flag.py b/fhirclient/models/flag.py index 5c76ae4c1..187b5369a 100644 --- a/fhirclient/models/flag.py +++ b/fhirclient/models/flag.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Flag) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Flag) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/flag_tests.py b/fhirclient/models/flag_tests.py index 624deee6e..2fc4cda0a 100644 --- a/fhirclient/models/flag_tests.py +++ b/fhirclient/models/flag_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/goal.py b/fhirclient/models/goal.py index 432b1f576..be6ed4901 100644 --- a/fhirclient/models/goal.py +++ b/fhirclient/models/goal.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Goal) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Goal) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/goal_tests.py b/fhirclient/models/goal_tests.py index 3f39c17ae..8d1615a39 100644 --- a/fhirclient/models/goal_tests.py +++ b/fhirclient/models/goal_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/graphdefinition.py b/fhirclient/models/graphdefinition.py index 5e6832e30..8e7026349 100644 --- a/fhirclient/models/graphdefinition.py +++ b/fhirclient/models/graphdefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/GraphDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/GraphDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -228,7 +228,7 @@ def __init__(self, jsondict=None, strict=True): """ self.code = None - """ Identifies the compartment. + """ Patient | Encounter | RelatedPerson | Practitioner | Device. Type `str`. """ self.description = None diff --git a/fhirclient/models/graphdefinition_tests.py b/fhirclient/models/graphdefinition_tests.py index 5c147c2f8..9cf6158ee 100644 --- a/fhirclient/models/graphdefinition_tests.py +++ b/fhirclient/models/graphdefinition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/group.py b/fhirclient/models/group.py index 08eda14cd..b60f1b4ef 100644 --- a/fhirclient/models/group.py +++ b/fhirclient/models/group.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Group) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Group) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/group_tests.py b/fhirclient/models/group_tests.py index 1c7b47599..b93398ab8 100644 --- a/fhirclient/models/group_tests.py +++ b/fhirclient/models/group_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return group.Group(js) def testGroup1(self): - inst = self.instantiate_from("group-example.json") + inst = self.instantiate_from("group-example-herd1.json") self.assertIsNotNone(inst, "Must have instantiated a Group instance") self.implGroup1(inst) @@ -32,6 +32,41 @@ def testGroup1(self): self.implGroup1(inst2) def implGroup1(self, inst): + self.assertTrue(inst.active) + self.assertTrue(inst.actual) + self.assertEqual(inst.characteristic[0].code.text, "gender") + self.assertFalse(inst.characteristic[0].exclude) + self.assertEqual(inst.characteristic[0].valueCodeableConcept.text, "female") + self.assertEqual(inst.code.coding[0].code, "388393002") + self.assertEqual(inst.code.coding[0].display, "Genus Sus (organism)") + self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.code.coding[1].code, "POR") + self.assertEqual(inst.code.coding[1].display, "porcine") + self.assertEqual(inst.code.coding[1].system, "https://www.aphis.usda.gov") + self.assertEqual(inst.code.text, "Porcine") + self.assertEqual(inst.extension[0].url, "http://example.org/fhir/StructureDefinition/owner") + self.assertEqual(inst.id, "herd1") + self.assertEqual(inst.identifier[0].system, "https://vetmed.iastate.edu/vdl") + self.assertEqual(inst.identifier[0].value, "20171120-1234") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.name, "Breeding herd") + self.assertEqual(inst.quantity, 2500) + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.type, "animal") + + def testGroup2(self): + inst = self.instantiate_from("group-example.json") + self.assertIsNotNone(inst, "Must have instantiated a Group instance") + self.implGroup2(inst) + + js = inst.as_json() + self.assertEqual("Group", js["resourceType"]) + inst2 = group.Group(js) + self.implGroup2(inst2) + + def implGroup2(self, inst): self.assertTrue(inst.actual) self.assertEqual(inst.characteristic[0].code.text, "gender") self.assertFalse(inst.characteristic[0].exclude) @@ -51,17 +86,17 @@ def implGroup1(self, inst): self.assertEqual(inst.text.status, "additional") self.assertEqual(inst.type, "animal") - def testGroup2(self): + def testGroup3(self): inst = self.instantiate_from("group-example-member.json") self.assertIsNotNone(inst, "Must have instantiated a Group instance") - self.implGroup2(inst) + self.implGroup3(inst) js = inst.as_json() self.assertEqual("Group", js["resourceType"]) inst2 = group.Group(js) - self.implGroup2(inst2) + self.implGroup3(inst2) - def implGroup2(self, inst): + def implGroup3(self, inst): self.assertTrue(inst.actual) self.assertEqual(inst.id, "102") self.assertEqual(inst.member[0].period.start.date, FHIRDate("2014-10-08").date) @@ -79,17 +114,17 @@ def implGroup2(self, inst): self.assertEqual(inst.text.status, "additional") self.assertEqual(inst.type, "person") - def testGroup3(self): + def testGroup4(self): inst = self.instantiate_from("group-example-patientlist.json") self.assertIsNotNone(inst, "Must have instantiated a Group instance") - self.implGroup3(inst) + self.implGroup4(inst) js = inst.as_json() self.assertEqual("Group", js["resourceType"]) inst2 = group.Group(js) - self.implGroup3(inst2) + self.implGroup4(inst2) - def implGroup3(self, inst): + def implGroup4(self, inst): self.assertTrue(inst.actual) self.assertEqual(inst.characteristic[0].code.coding[0].code, "attributed-to") self.assertEqual(inst.characteristic[0].code.coding[0].system, "http://example.org") @@ -101,39 +136,4 @@ def implGroup3(self, inst): self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.text.status, "additional") self.assertEqual(inst.type, "person") - - def testGroup4(self): - inst = self.instantiate_from("group-example-herd1.json") - self.assertIsNotNone(inst, "Must have instantiated a Group instance") - self.implGroup4(inst) - - js = inst.as_json() - self.assertEqual("Group", js["resourceType"]) - inst2 = group.Group(js) - self.implGroup4(inst2) - - def implGroup4(self, inst): - self.assertTrue(inst.active) - self.assertTrue(inst.actual) - self.assertEqual(inst.characteristic[0].code.text, "gender") - self.assertFalse(inst.characteristic[0].exclude) - self.assertEqual(inst.characteristic[0].valueCodeableConcept.text, "female") - self.assertEqual(inst.code.coding[0].code, "388393002") - self.assertEqual(inst.code.coding[0].display, "Genus Sus (organism)") - self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.code.coding[1].code, "POR") - self.assertEqual(inst.code.coding[1].display, "porcine") - self.assertEqual(inst.code.coding[1].system, "https://www.aphis.usda.gov") - self.assertEqual(inst.code.text, "Porcine") - self.assertEqual(inst.extension[0].url, "http://example.org/fhir/StructureDefinition/owner") - self.assertEqual(inst.id, "herd1") - self.assertEqual(inst.identifier[0].system, "https://vetmed.iastate.edu/vdl") - self.assertEqual(inst.identifier[0].value, "20171120-1234") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "Breeding herd") - self.assertEqual(inst.quantity, 2500) - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type, "animal") diff --git a/fhirclient/models/guidanceresponse.py b/fhirclient/models/guidanceresponse.py index 9cf35993c..8a60d8637 100644 --- a/fhirclient/models/guidanceresponse.py +++ b/fhirclient/models/guidanceresponse.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/GuidanceResponse) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/GuidanceResponse) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/guidanceresponse_tests.py b/fhirclient/models/guidanceresponse_tests.py index d53054eb0..fcc7a05bb 100644 --- a/fhirclient/models/guidanceresponse_tests.py +++ b/fhirclient/models/guidanceresponse_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/healthcareservice.py b/fhirclient/models/healthcareservice.py index 08be149b9..61794cbef 100644 --- a/fhirclient/models/healthcareservice.py +++ b/fhirclient/models/healthcareservice.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/HealthcareService) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/HealthcareService) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/healthcareservice_tests.py b/fhirclient/models/healthcareservice_tests.py index e1825fd65..0d2f6de00 100644 --- a/fhirclient/models/healthcareservice_tests.py +++ b/fhirclient/models/healthcareservice_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/humanname.py b/fhirclient/models/humanname.py index 18b0d0d78..1d8426c58 100644 --- a/fhirclient/models/humanname.py +++ b/fhirclient/models/humanname.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/HumanName) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/HumanName) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/identifier.py b/fhirclient/models/identifier.py index 4cb86f75a..80a1e9fde 100644 --- a/fhirclient/models/identifier.py +++ b/fhirclient/models/identifier.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Identifier) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Identifier) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/imagingstudy.py b/fhirclient/models/imagingstudy.py index e73275e44..ad3273cd8 100644 --- a/fhirclient/models/imagingstudy.py +++ b/fhirclient/models/imagingstudy.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ImagingStudy) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ImagingStudy) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/imagingstudy_tests.py b/fhirclient/models/imagingstudy_tests.py index e4cbf30fb..042b8552e 100644 --- a/fhirclient/models/imagingstudy_tests.py +++ b/fhirclient/models/imagingstudy_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return imagingstudy.ImagingStudy(js) def testImagingStudy1(self): - inst = self.instantiate_from("imagingstudy-example-xr.json") + inst = self.instantiate_from("imagingstudy-example.json") self.assertIsNotNone(inst, "Must have instantiated a ImagingStudy instance") self.implImagingStudy1(inst) @@ -32,6 +32,44 @@ def testImagingStudy1(self): self.implImagingStudy1(inst2) def implImagingStudy1(self, inst): + self.assertEqual(inst.id, "example") + self.assertEqual(inst.identifier[0].system, "urn:dicom:uid") + self.assertEqual(inst.identifier[0].value, "urn:oid:2.16.124.113543.6003.1154777499.30246.19789.3503430045") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.numberOfInstances, 1) + self.assertEqual(inst.numberOfSeries, 1) + self.assertEqual(inst.series[0].bodySite.code, "67734004") + self.assertEqual(inst.series[0].bodySite.display, "Upper Trunk Structure") + self.assertEqual(inst.series[0].bodySite.system, "http://snomed.info/sct") + self.assertEqual(inst.series[0].description, "CT Surview 180") + self.assertEqual(inst.series[0].instance[0].number, 1) + self.assertEqual(inst.series[0].instance[0].sopClass.code, "urn:oid:1.2.840.10008.5.1.4.1.1.2") + self.assertEqual(inst.series[0].instance[0].sopClass.system, "urn:ietf:rfc:3986") + self.assertEqual(inst.series[0].instance[0].uid, "2.16.124.113543.6003.189642796.63084.16748.2599092903") + self.assertEqual(inst.series[0].modality.code, "CT") + self.assertEqual(inst.series[0].modality.system, "http://dicom.nema.org/resources/ontology/DCM") + self.assertEqual(inst.series[0].number, 3) + self.assertEqual(inst.series[0].numberOfInstances, 1) + self.assertEqual(inst.series[0].uid, "2.16.124.113543.6003.2588828330.45298.17418.2723805630") + self.assertEqual(inst.started.date, FHIRDate("2011-01-01T11:01:20+03:00").date) + self.assertEqual(inst.started.as_json(), "2011-01-01T11:01:20+03:00") + self.assertEqual(inst.status, "available") + self.assertEqual(inst.text.div, "
CT Chest. John Smith (MRN: 09236). Accession: W12342398. Performed: 2011-01-01. 3 series, 12 images.
") + self.assertEqual(inst.text.status, "generated") + + def testImagingStudy2(self): + inst = self.instantiate_from("imagingstudy-example-xr.json") + self.assertIsNotNone(inst, "Must have instantiated a ImagingStudy instance") + self.implImagingStudy2(inst) + + js = inst.as_json() + self.assertEqual("ImagingStudy", js["resourceType"]) + inst2 = imagingstudy.ImagingStudy(js) + self.implImagingStudy2(inst2) + + def implImagingStudy2(self, inst): self.assertEqual(inst.id, "example-xr") self.assertEqual(inst.identifier[0].system, "urn:dicom:uid") self.assertEqual(inst.identifier[0].use, "official") @@ -88,42 +126,4 @@ def implImagingStudy1(self, inst): self.assertEqual(inst.status, "available") self.assertEqual(inst.text.div, "
XR Wrist 3+ Views. John Smith (MRN: 09236). Accession: W12342398. Performed: 2017-01-01. 1 series, 2 images.
") self.assertEqual(inst.text.status, "generated") - - def testImagingStudy2(self): - inst = self.instantiate_from("imagingstudy-example.json") - self.assertIsNotNone(inst, "Must have instantiated a ImagingStudy instance") - self.implImagingStudy2(inst) - - js = inst.as_json() - self.assertEqual("ImagingStudy", js["resourceType"]) - inst2 = imagingstudy.ImagingStudy(js) - self.implImagingStudy2(inst2) - - def implImagingStudy2(self, inst): - self.assertEqual(inst.id, "example") - self.assertEqual(inst.identifier[0].system, "urn:dicom:uid") - self.assertEqual(inst.identifier[0].value, "urn:oid:2.16.124.113543.6003.1154777499.30246.19789.3503430045") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.numberOfInstances, 1) - self.assertEqual(inst.numberOfSeries, 1) - self.assertEqual(inst.series[0].bodySite.code, "67734004") - self.assertEqual(inst.series[0].bodySite.display, "Upper Trunk Structure") - self.assertEqual(inst.series[0].bodySite.system, "http://snomed.info/sct") - self.assertEqual(inst.series[0].description, "CT Surview 180") - self.assertEqual(inst.series[0].instance[0].number, 1) - self.assertEqual(inst.series[0].instance[0].sopClass.code, "urn:oid:1.2.840.10008.5.1.4.1.1.2") - self.assertEqual(inst.series[0].instance[0].sopClass.system, "urn:ietf:rfc:3986") - self.assertEqual(inst.series[0].instance[0].uid, "2.16.124.113543.6003.189642796.63084.16748.2599092903") - self.assertEqual(inst.series[0].modality.code, "CT") - self.assertEqual(inst.series[0].modality.system, "http://dicom.nema.org/resources/ontology/DCM") - self.assertEqual(inst.series[0].number, 3) - self.assertEqual(inst.series[0].numberOfInstances, 1) - self.assertEqual(inst.series[0].uid, "2.16.124.113543.6003.2588828330.45298.17418.2723805630") - self.assertEqual(inst.started.date, FHIRDate("2011-01-01T11:01:20+03:00").date) - self.assertEqual(inst.started.as_json(), "2011-01-01T11:01:20+03:00") - self.assertEqual(inst.status, "available") - self.assertEqual(inst.text.div, "
CT Chest. John Smith (MRN: 09236). Accession: W12342398. Performed: 2011-01-01. 3 series, 12 images.
") - self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/immunization.py b/fhirclient/models/immunization.py index 1c693f2ff..f94259696 100644 --- a/fhirclient/models/immunization.py +++ b/fhirclient/models/immunization.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Immunization) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Immunization) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/immunization_tests.py b/fhirclient/models/immunization_tests.py index 5359747b4..68ac1a55d 100644 --- a/fhirclient/models/immunization_tests.py +++ b/fhirclient/models/immunization_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return immunization.Immunization(js) def testImmunization1(self): - inst = self.instantiate_from("immunization-example.json") + inst = self.instantiate_from("immunization-example-protocol.json") self.assertIsNotNone(inst, "Must have instantiated a Immunization instance") self.implImmunization1(inst) @@ -35,26 +35,20 @@ def implImmunization1(self, inst): self.assertEqual(inst.doseQuantity.code, "mg") self.assertEqual(inst.doseQuantity.system, "http://unitsofmeasure.org") self.assertEqual(inst.doseQuantity.value, 5) - self.assertEqual(inst.education[0].documentType, "253088698300010311120702") - self.assertEqual(inst.education[0].presentationDate.date, FHIRDate("2013-01-10").date) - self.assertEqual(inst.education[0].presentationDate.as_json(), "2013-01-10") - self.assertEqual(inst.education[0].publicationDate.date, FHIRDate("2012-07-02").date) - self.assertEqual(inst.education[0].publicationDate.as_json(), "2012-07-02") - self.assertEqual(inst.expirationDate.date, FHIRDate("2015-02-15").date) - self.assertEqual(inst.expirationDate.as_json(), "2015-02-15") + self.assertEqual(inst.expirationDate.date, FHIRDate("2018-12-15").date) + self.assertEqual(inst.expirationDate.as_json(), "2018-12-15") self.assertEqual(inst.fundingSource.coding[0].code, "private") self.assertEqual(inst.fundingSource.coding[0].system, "http://terminology.hl7.org/CodeSystem/immunization-funding-source") - self.assertEqual(inst.id, "example") + self.assertEqual(inst.id, "protocol") self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") self.assertEqual(inst.identifier[0].value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234") - self.assertTrue(inst.isSubpotent) - self.assertEqual(inst.lotNumber, "AAJN11K") + self.assertFalse(inst.isSubpotent) + self.assertEqual(inst.lotNumber, "PT123F") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.note[0].text, "Notes on adminstration of vaccine") - self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2013-01-10").date) - self.assertEqual(inst.occurrenceDateTime.as_json(), "2013-01-10") + self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2018-06-18").date) + self.assertEqual(inst.occurrenceDateTime.as_json(), "2018-06-18") self.assertEqual(inst.performer[0].function.coding[0].code, "OP") self.assertEqual(inst.performer[0].function.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0443") self.assertEqual(inst.performer[1].function.coding[0].code, "AP") @@ -62,8 +56,14 @@ def implImmunization1(self, inst): self.assertTrue(inst.primarySource) self.assertEqual(inst.programEligibility[0].coding[0].code, "ineligible") self.assertEqual(inst.programEligibility[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/immunization-program-eligibility") - self.assertEqual(inst.reasonCode[0].coding[0].code, "429060002") - self.assertEqual(inst.reasonCode[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.protocolApplied[0].doseNumberPositiveInt, 1) + self.assertEqual(inst.protocolApplied[0].series, "2-dose") + self.assertEqual(inst.protocolApplied[0].targetDisease[0].coding[0].code, "40468003") + self.assertEqual(inst.protocolApplied[0].targetDisease[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.protocolApplied[1].doseNumberPositiveInt, 2) + self.assertEqual(inst.protocolApplied[1].series, "3-dose") + self.assertEqual(inst.protocolApplied[1].targetDisease[0].coding[0].code, "66071002") + self.assertEqual(inst.protocolApplied[1].targetDisease[0].coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.route.coding[0].code, "IM") self.assertEqual(inst.route.coding[0].display, "Injection, intramuscular") self.assertEqual(inst.route.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration") @@ -72,12 +72,12 @@ def implImmunization1(self, inst): self.assertEqual(inst.site.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActSite") self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.vaccineCode.coding[0].code, "FLUVAX") - self.assertEqual(inst.vaccineCode.coding[0].system, "urn:oid:1.2.36.1.2001.1005.17") - self.assertEqual(inst.vaccineCode.text, "Fluvax (Influenza)") + self.assertEqual(inst.vaccineCode.coding[0].code, "104") + self.assertEqual(inst.vaccineCode.coding[0].system, "http://hl7.org/fhir/sid/cvx") + self.assertEqual(inst.vaccineCode.text, "Twinrix (HepA/HepB)") def testImmunization2(self): - inst = self.instantiate_from("immunization-example-historical.json") + inst = self.instantiate_from("immunization-example-subpotent.json") self.assertIsNotNone(inst, "Must have instantiated a Immunization instance") self.implImmunization2(inst) @@ -87,52 +87,29 @@ def testImmunization2(self): self.implImmunization2(inst2) def implImmunization2(self, inst): - self.assertEqual(inst.id, "historical") - self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") - self.assertEqual(inst.identifier[0].value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.note[0].text, "Notes on adminstration of a historical vaccine") - self.assertEqual(inst.occurrenceString, "January 2012") - self.assertFalse(inst.primarySource) - self.assertEqual(inst.reportOrigin.coding[0].code, "record") - self.assertEqual(inst.reportOrigin.coding[0].system, "http://terminology.hl7.org/CodeSystem/immunization-origin") - self.assertEqual(inst.reportOrigin.text, "Written Record") - self.assertEqual(inst.status, "completed") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.vaccineCode.coding[0].code, "GNFLU") - self.assertEqual(inst.vaccineCode.coding[0].system, "urn:oid:1.2.36.1.2001.1005.17") - self.assertEqual(inst.vaccineCode.text, "Influenza") - - def testImmunization3(self): - inst = self.instantiate_from("immunization-example-protocol.json") - self.assertIsNotNone(inst, "Must have instantiated a Immunization instance") - self.implImmunization3(inst) - - js = inst.as_json() - self.assertEqual("Immunization", js["resourceType"]) - inst2 = immunization.Immunization(js) - self.implImmunization3(inst2) - - def implImmunization3(self, inst): - self.assertEqual(inst.doseQuantity.code, "mg") + self.assertEqual(inst.doseQuantity.code, "ml") self.assertEqual(inst.doseQuantity.system, "http://unitsofmeasure.org") - self.assertEqual(inst.doseQuantity.value, 5) - self.assertEqual(inst.expirationDate.date, FHIRDate("2018-12-15").date) - self.assertEqual(inst.expirationDate.as_json(), "2018-12-15") + self.assertEqual(inst.doseQuantity.value, 0.5) + self.assertEqual(inst.education[0].documentType, "253088698300010311120702") + self.assertEqual(inst.education[0].presentationDate.date, FHIRDate("2013-01-10").date) + self.assertEqual(inst.education[0].presentationDate.as_json(), "2013-01-10") + self.assertEqual(inst.education[0].publicationDate.date, FHIRDate("2012-07-02").date) + self.assertEqual(inst.education[0].publicationDate.as_json(), "2012-07-02") + self.assertEqual(inst.expirationDate.date, FHIRDate("2015-02-28").date) + self.assertEqual(inst.expirationDate.as_json(), "2015-02-28") self.assertEqual(inst.fundingSource.coding[0].code, "private") self.assertEqual(inst.fundingSource.coding[0].system, "http://terminology.hl7.org/CodeSystem/immunization-funding-source") - self.assertEqual(inst.id, "protocol") + self.assertEqual(inst.id, "subpotent") self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") self.assertEqual(inst.identifier[0].value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234") self.assertFalse(inst.isSubpotent) - self.assertEqual(inst.lotNumber, "PT123F") + self.assertEqual(inst.lotNumber, "AAJN11K") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2018-06-18").date) - self.assertEqual(inst.occurrenceDateTime.as_json(), "2018-06-18") + self.assertEqual(inst.note[0].text, "Notes on adminstration of vaccine") + self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2015-01-15").date) + self.assertEqual(inst.occurrenceDateTime.as_json(), "2015-01-15") self.assertEqual(inst.performer[0].function.coding[0].code, "OP") self.assertEqual(inst.performer[0].function.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0443") self.assertEqual(inst.performer[1].function.coding[0].code, "AP") @@ -140,37 +117,31 @@ def implImmunization3(self, inst): self.assertTrue(inst.primarySource) self.assertEqual(inst.programEligibility[0].coding[0].code, "ineligible") self.assertEqual(inst.programEligibility[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/immunization-program-eligibility") - self.assertEqual(inst.protocolApplied[0].doseNumberPositiveInt, 1) - self.assertEqual(inst.protocolApplied[0].series, "2-dose") - self.assertEqual(inst.protocolApplied[0].targetDisease[0].coding[0].code, "40468003") - self.assertEqual(inst.protocolApplied[0].targetDisease[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.protocolApplied[1].doseNumberPositiveInt, 2) - self.assertEqual(inst.protocolApplied[1].series, "3-dose") - self.assertEqual(inst.protocolApplied[1].targetDisease[0].coding[0].code, "66071002") - self.assertEqual(inst.protocolApplied[1].targetDisease[0].coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.route.coding[0].code, "IM") self.assertEqual(inst.route.coding[0].display, "Injection, intramuscular") self.assertEqual(inst.route.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration") - self.assertEqual(inst.site.coding[0].code, "LA") - self.assertEqual(inst.site.coding[0].display, "left arm") + self.assertEqual(inst.site.coding[0].code, "LT") + self.assertEqual(inst.site.coding[0].display, "left thigh") self.assertEqual(inst.site.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActSite") self.assertEqual(inst.status, "completed") + self.assertEqual(inst.subpotentReason[0].coding[0].code, "partial") + self.assertEqual(inst.subpotentReason[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/immunization-subpotent-reason") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.vaccineCode.coding[0].code, "104") - self.assertEqual(inst.vaccineCode.coding[0].system, "http://hl7.org/fhir/sid/cvx") - self.assertEqual(inst.vaccineCode.text, "Twinrix (HepA/HepB)") + self.assertEqual(inst.vaccineCode.coding[0].code, "GNHEP") + self.assertEqual(inst.vaccineCode.coding[0].system, "urn:oid:1.2.36.1.2001.1005.17") + self.assertEqual(inst.vaccineCode.text, "Hepatitis B") - def testImmunization4(self): + def testImmunization3(self): inst = self.instantiate_from("immunization-example-refused.json") self.assertIsNotNone(inst, "Must have instantiated a Immunization instance") - self.implImmunization4(inst) + self.implImmunization3(inst) js = inst.as_json() self.assertEqual("Immunization", js["resourceType"]) inst2 = immunization.Immunization(js) - self.implImmunization4(inst2) + self.implImmunization3(inst2) - def implImmunization4(self, inst): + def implImmunization3(self, inst): self.assertEqual(inst.id, "notGiven") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") @@ -187,8 +158,37 @@ def implImmunization4(self, inst): self.assertEqual(inst.vaccineCode.coding[0].display, "DTP") self.assertEqual(inst.vaccineCode.coding[0].system, "http://hl7.org/fhir/sid/cvx") + def testImmunization4(self): + inst = self.instantiate_from("immunization-example-historical.json") + self.assertIsNotNone(inst, "Must have instantiated a Immunization instance") + self.implImmunization4(inst) + + js = inst.as_json() + self.assertEqual("Immunization", js["resourceType"]) + inst2 = immunization.Immunization(js) + self.implImmunization4(inst2) + + def implImmunization4(self, inst): + self.assertEqual(inst.id, "historical") + self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") + self.assertEqual(inst.identifier[0].value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.note[0].text, "Notes on adminstration of a historical vaccine") + self.assertEqual(inst.occurrenceString, "January 2012") + self.assertFalse(inst.primarySource) + self.assertEqual(inst.reportOrigin.coding[0].code, "record") + self.assertEqual(inst.reportOrigin.coding[0].system, "http://terminology.hl7.org/CodeSystem/immunization-origin") + self.assertEqual(inst.reportOrigin.text, "Written Record") + self.assertEqual(inst.status, "completed") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.vaccineCode.coding[0].code, "GNFLU") + self.assertEqual(inst.vaccineCode.coding[0].system, "urn:oid:1.2.36.1.2001.1005.17") + self.assertEqual(inst.vaccineCode.text, "Influenza") + def testImmunization5(self): - inst = self.instantiate_from("immunization-example-subpotent.json") + inst = self.instantiate_from("immunization-example.json") self.assertIsNotNone(inst, "Must have instantiated a Immunization instance") self.implImmunization5(inst) @@ -198,29 +198,29 @@ def testImmunization5(self): self.implImmunization5(inst2) def implImmunization5(self, inst): - self.assertEqual(inst.doseQuantity.code, "ml") + self.assertEqual(inst.doseQuantity.code, "mg") self.assertEqual(inst.doseQuantity.system, "http://unitsofmeasure.org") - self.assertEqual(inst.doseQuantity.value, 0.5) + self.assertEqual(inst.doseQuantity.value, 5) self.assertEqual(inst.education[0].documentType, "253088698300010311120702") self.assertEqual(inst.education[0].presentationDate.date, FHIRDate("2013-01-10").date) self.assertEqual(inst.education[0].presentationDate.as_json(), "2013-01-10") self.assertEqual(inst.education[0].publicationDate.date, FHIRDate("2012-07-02").date) self.assertEqual(inst.education[0].publicationDate.as_json(), "2012-07-02") - self.assertEqual(inst.expirationDate.date, FHIRDate("2015-02-28").date) - self.assertEqual(inst.expirationDate.as_json(), "2015-02-28") + self.assertEqual(inst.expirationDate.date, FHIRDate("2015-02-15").date) + self.assertEqual(inst.expirationDate.as_json(), "2015-02-15") self.assertEqual(inst.fundingSource.coding[0].code, "private") self.assertEqual(inst.fundingSource.coding[0].system, "http://terminology.hl7.org/CodeSystem/immunization-funding-source") - self.assertEqual(inst.id, "subpotent") + self.assertEqual(inst.id, "example") self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") self.assertEqual(inst.identifier[0].value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234") - self.assertFalse(inst.isSubpotent) + self.assertTrue(inst.isSubpotent) self.assertEqual(inst.lotNumber, "AAJN11K") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.note[0].text, "Notes on adminstration of vaccine") - self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2015-01-15").date) - self.assertEqual(inst.occurrenceDateTime.as_json(), "2015-01-15") + self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2013-01-10").date) + self.assertEqual(inst.occurrenceDateTime.as_json(), "2013-01-10") self.assertEqual(inst.performer[0].function.coding[0].code, "OP") self.assertEqual(inst.performer[0].function.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0443") self.assertEqual(inst.performer[1].function.coding[0].code, "AP") @@ -228,17 +228,17 @@ def implImmunization5(self, inst): self.assertTrue(inst.primarySource) self.assertEqual(inst.programEligibility[0].coding[0].code, "ineligible") self.assertEqual(inst.programEligibility[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/immunization-program-eligibility") + self.assertEqual(inst.reasonCode[0].coding[0].code, "429060002") + self.assertEqual(inst.reasonCode[0].coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.route.coding[0].code, "IM") self.assertEqual(inst.route.coding[0].display, "Injection, intramuscular") self.assertEqual(inst.route.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration") - self.assertEqual(inst.site.coding[0].code, "LT") - self.assertEqual(inst.site.coding[0].display, "left thigh") + self.assertEqual(inst.site.coding[0].code, "LA") + self.assertEqual(inst.site.coding[0].display, "left arm") self.assertEqual(inst.site.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActSite") self.assertEqual(inst.status, "completed") - self.assertEqual(inst.subpotentReason[0].coding[0].code, "partial") - self.assertEqual(inst.subpotentReason[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/immunization-subpotent-reason") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.vaccineCode.coding[0].code, "GNHEP") + self.assertEqual(inst.vaccineCode.coding[0].code, "FLUVAX") self.assertEqual(inst.vaccineCode.coding[0].system, "urn:oid:1.2.36.1.2001.1005.17") - self.assertEqual(inst.vaccineCode.text, "Hepatitis B") + self.assertEqual(inst.vaccineCode.text, "Fluvax (Influenza)") diff --git a/fhirclient/models/immunizationevaluation.py b/fhirclient/models/immunizationevaluation.py index e0961c28a..8dd8d8b1a 100644 --- a/fhirclient/models/immunizationevaluation.py +++ b/fhirclient/models/immunizationevaluation.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/immunizationevaluation_tests.py b/fhirclient/models/immunizationevaluation_tests.py index 8d810ec25..c108189b8 100644 --- a/fhirclient/models/immunizationevaluation_tests.py +++ b/fhirclient/models/immunizationevaluation_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return immunizationevaluation.ImmunizationEvaluation(js) def testImmunizationEvaluation1(self): - inst = self.instantiate_from("immunizationevaluation-example.json") + inst = self.instantiate_from("immunizationevaluation-example-notvalid.json") self.assertIsNotNone(inst, "Must have instantiated a ImmunizationEvaluation instance") self.implImmunizationEvaluation1(inst) @@ -34,11 +34,14 @@ def testImmunizationEvaluation1(self): def implImmunizationEvaluation1(self, inst): self.assertEqual(inst.date.date, FHIRDate("2013-01-10").date) self.assertEqual(inst.date.as_json(), "2013-01-10") - self.assertEqual(inst.doseNumberPositiveInt, 1) - self.assertEqual(inst.doseStatus.coding[0].code, "valid") - self.assertEqual(inst.doseStatus.coding[0].display, "Valid") + self.assertEqual(inst.doseNumberPositiveInt, 2) + self.assertEqual(inst.doseStatus.coding[0].code, "notvalid") + self.assertEqual(inst.doseStatus.coding[0].display, "Not Valid") self.assertEqual(inst.doseStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status") - self.assertEqual(inst.id, "example") + self.assertEqual(inst.doseStatusReason[0].coding[0].code, "outsidesched") + self.assertEqual(inst.doseStatusReason[0].coding[0].display, "Administered outside recommended schedule") + self.assertEqual(inst.doseStatusReason[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status-reason") + self.assertEqual(inst.id, "notValid") self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") self.assertEqual(inst.identifier[0].value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234") self.assertEqual(inst.meta.tag[0].code, "HTEST") @@ -52,7 +55,7 @@ def implImmunizationEvaluation1(self, inst): self.assertEqual(inst.text.status, "generated") def testImmunizationEvaluation2(self): - inst = self.instantiate_from("immunizationevaluation-example-notvalid.json") + inst = self.instantiate_from("immunizationevaluation-example.json") self.assertIsNotNone(inst, "Must have instantiated a ImmunizationEvaluation instance") self.implImmunizationEvaluation2(inst) @@ -64,14 +67,11 @@ def testImmunizationEvaluation2(self): def implImmunizationEvaluation2(self, inst): self.assertEqual(inst.date.date, FHIRDate("2013-01-10").date) self.assertEqual(inst.date.as_json(), "2013-01-10") - self.assertEqual(inst.doseNumberPositiveInt, 2) - self.assertEqual(inst.doseStatus.coding[0].code, "notvalid") - self.assertEqual(inst.doseStatus.coding[0].display, "Not Valid") + self.assertEqual(inst.doseNumberPositiveInt, 1) + self.assertEqual(inst.doseStatus.coding[0].code, "valid") + self.assertEqual(inst.doseStatus.coding[0].display, "Valid") self.assertEqual(inst.doseStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status") - self.assertEqual(inst.doseStatusReason[0].coding[0].code, "outsidesched") - self.assertEqual(inst.doseStatusReason[0].coding[0].display, "Administered outside recommended schedule") - self.assertEqual(inst.doseStatusReason[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/immunization-evaluation-dose-status-reason") - self.assertEqual(inst.id, "notValid") + self.assertEqual(inst.id, "example") self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") self.assertEqual(inst.identifier[0].value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234") self.assertEqual(inst.meta.tag[0].code, "HTEST") diff --git a/fhirclient/models/immunizationrecommendation.py b/fhirclient/models/immunizationrecommendation.py index 17d5cf7b4..5d39e23c1 100644 --- a/fhirclient/models/immunizationrecommendation.py +++ b/fhirclient/models/immunizationrecommendation.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/immunizationrecommendation_tests.py b/fhirclient/models/immunizationrecommendation_tests.py index 5088fd49f..1299e02e7 100644 --- a/fhirclient/models/immunizationrecommendation_tests.py +++ b/fhirclient/models/immunizationrecommendation_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/implementationguide.py b/fhirclient/models/implementationguide.py index c6aa1c2fc..0f00ff465 100644 --- a/fhirclient/models/implementationguide.py +++ b/fhirclient/models/implementationguide.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ImplementationGuide) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ImplementationGuide) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/implementationguide_tests.py b/fhirclient/models/implementationguide_tests.py index 3b920a0b9..716f096ea 100644 --- a/fhirclient/models/implementationguide_tests.py +++ b/fhirclient/models/implementationguide_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -56,7 +56,7 @@ def implImplementationGuide1(self, inst): self.assertEqual(inst.definition.resource[0].name, "Test Example") self.assertEqual(inst.dependsOn[0].uri, "http://hl7.org/fhir/ImplementationGuide/uscore") self.assertFalse(inst.experimental) - self.assertEqual(inst.fhirVersion[0], "4.0.0") + self.assertEqual(inst.fhirVersion[0], "4.0.1") self.assertEqual(inst.global_fhir[0].profile, "http://hl7.org/fhir/us/core/StructureDefinition/patient") self.assertEqual(inst.global_fhir[0].type, "Patient") self.assertEqual(inst.id, "example") diff --git a/fhirclient/models/insuranceplan.py b/fhirclient/models/insuranceplan.py index 70cc6d240..05f7e68ec 100644 --- a/fhirclient/models/insuranceplan.py +++ b/fhirclient/models/insuranceplan.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/InsurancePlan) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/InsurancePlan) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/insuranceplan_tests.py b/fhirclient/models/insuranceplan_tests.py index 2160ce856..a9d206ad9 100644 --- a/fhirclient/models/insuranceplan_tests.py +++ b/fhirclient/models/insuranceplan_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/invoice.py b/fhirclient/models/invoice.py index 98962fb28..29f108870 100644 --- a/fhirclient/models/invoice.py +++ b/fhirclient/models/invoice.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Invoice) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Invoice) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/invoice_tests.py b/fhirclient/models/invoice_tests.py index 04e419bf1..164dfca6e 100644 --- a/fhirclient/models/invoice_tests.py +++ b/fhirclient/models/invoice_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/library.py b/fhirclient/models/library.py index 54600d37e..8db48d47e 100644 --- a/fhirclient/models/library.py +++ b/fhirclient/models/library.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Library) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Library) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/library_tests.py b/fhirclient/models/library_tests.py index 6449f1c48..41b8a954e 100644 --- a/fhirclient/models/library_tests.py +++ b/fhirclient/models/library_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return library.Library(js) def testLibrary1(self): - inst = self.instantiate_from("library-predecessor-example.json") + inst = self.instantiate_from("library-cms146-example.json") self.assertIsNotNone(inst, "Must have instantiated a Library instance") self.implLibrary1(inst) @@ -32,41 +32,6 @@ def testLibrary1(self): self.implLibrary1(inst2) def implLibrary1(self, inst): - self.assertEqual(inst.content[0].contentType, "text/cql") - self.assertEqual(inst.content[0].title, "FHIR Helpers") - self.assertEqual(inst.content[0].url, "library-fhir-helpers-content.cql") - self.assertEqual(inst.date.date, FHIRDate("2016-11-14").date) - self.assertEqual(inst.date.as_json(), "2016-11-14") - self.assertEqual(inst.description, "FHIR Helpers") - self.assertTrue(inst.experimental) - self.assertEqual(inst.id, "library-fhir-helpers-predecessor") - self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "FHIRHelpers") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.relatedArtifact[0].resource, "Library/fhir-model-definition") - self.assertEqual(inst.relatedArtifact[0].type, "depends-on") - self.assertEqual(inst.relatedArtifact[1].resource, "Library/library-fhir-helpers") - self.assertEqual(inst.relatedArtifact[1].type, "successor") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.title, "FHIR Helpers") - self.assertEqual(inst.topic[0].text, "FHIR Helpers") - self.assertEqual(inst.type.coding[0].code, "logic-library") - self.assertEqual(inst.version, "1.6") - - def testLibrary2(self): - inst = self.instantiate_from("library-cms146-example.json") - self.assertIsNotNone(inst, "Must have instantiated a Library instance") - self.implLibrary2(inst) - - js = inst.as_json() - self.assertEqual("Library", js["resourceType"]) - inst2 = library.Library(js) - self.implLibrary2(inst2) - - def implLibrary2(self, inst): self.assertEqual(inst.content[0].contentType, "text/cql") self.assertEqual(inst.content[0].url, "library-cms146-example-content.cql") self.assertEqual(inst.dataRequirement[0].type, "Patient") @@ -124,51 +89,52 @@ def implLibrary2(self, inst): self.assertEqual(inst.type.coding[0].code, "logic-library") self.assertEqual(inst.version, "2.0.0") - def testLibrary3(self): - inst = self.instantiate_from("library-example.json") + def testLibrary2(self): + inst = self.instantiate_from("library-predecessor-example.json") self.assertIsNotNone(inst, "Must have instantiated a Library instance") - self.implLibrary3(inst) + self.implLibrary2(inst) js = inst.as_json() self.assertEqual("Library", js["resourceType"]) inst2 = library.Library(js) - self.implLibrary3(inst2) + self.implLibrary2(inst2) - def implLibrary3(self, inst): + def implLibrary2(self, inst): self.assertEqual(inst.content[0].contentType, "text/cql") - self.assertEqual(inst.content[0].url, "library-example-content.cql") - self.assertEqual(inst.dataRequirement[0].codeFilter[0].path, "code") - self.assertEqual(inst.dataRequirement[0].codeFilter[0].valueSet, "urn:oid:2.16.840.1.113883.3.464.1003.111.12.1006") - self.assertEqual(inst.dataRequirement[0].type, "Condition") - self.assertEqual(inst.date.date, FHIRDate("2015-07-22").date) - self.assertEqual(inst.date.as_json(), "2015-07-22") - self.assertEqual(inst.description, "Common Logic for adherence to Chlamydia Screening guidelines") - self.assertEqual(inst.id, "example") + self.assertEqual(inst.content[0].title, "FHIR Helpers") + self.assertEqual(inst.content[0].url, "library-fhir-helpers-content.cql") + self.assertEqual(inst.date.date, FHIRDate("2016-11-14").date) + self.assertEqual(inst.date.as_json(), "2016-11-14") + self.assertEqual(inst.description, "FHIR Helpers") + self.assertTrue(inst.experimental) + self.assertEqual(inst.id, "library-fhir-helpers-predecessor") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "ChalmydiaScreening_Common") + self.assertEqual(inst.identifier[0].value, "FHIRHelpers") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.relatedArtifact[0].resource, "Library/library-quick-model-definition") + self.assertEqual(inst.relatedArtifact[0].resource, "Library/fhir-model-definition") self.assertEqual(inst.relatedArtifact[0].type, "depends-on") - self.assertEqual(inst.status, "draft") + self.assertEqual(inst.relatedArtifact[1].resource, "Library/library-fhir-helpers") + self.assertEqual(inst.relatedArtifact[1].type, "successor") + self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.title, "Chlamydia Screening Common Library") - self.assertEqual(inst.topic[0].text, "Chlamydia Screening") + self.assertEqual(inst.title, "FHIR Helpers") + self.assertEqual(inst.topic[0].text, "FHIR Helpers") self.assertEqual(inst.type.coding[0].code, "logic-library") - self.assertEqual(inst.version, "2.0.0") + self.assertEqual(inst.version, "1.6") - def testLibrary4(self): + def testLibrary3(self): inst = self.instantiate_from("library-composition-example.json") self.assertIsNotNone(inst, "Must have instantiated a Library instance") - self.implLibrary4(inst) + self.implLibrary3(inst) js = inst.as_json() self.assertEqual("Library", js["resourceType"]) inst2 = library.Library(js) - self.implLibrary4(inst2) + self.implLibrary3(inst2) - def implLibrary4(self, inst): + def implLibrary3(self, inst): self.assertEqual(inst.date.date, FHIRDate("2017-03-10").date) self.assertEqual(inst.date.as_json(), "2017-03-10") self.assertEqual(inst.description, "Artifacts required for implementation of Zika Virus Management") @@ -199,4 +165,38 @@ def implLibrary4(self, inst): self.assertEqual(inst.topic[0].text, "Zika Virus Management") self.assertEqual(inst.type.coding[0].code, "asset-collection") self.assertEqual(inst.version, "1.0.0") + + def testLibrary4(self): + inst = self.instantiate_from("library-example.json") + self.assertIsNotNone(inst, "Must have instantiated a Library instance") + self.implLibrary4(inst) + + js = inst.as_json() + self.assertEqual("Library", js["resourceType"]) + inst2 = library.Library(js) + self.implLibrary4(inst2) + + def implLibrary4(self, inst): + self.assertEqual(inst.content[0].contentType, "text/cql") + self.assertEqual(inst.content[0].url, "library-example-content.cql") + self.assertEqual(inst.dataRequirement[0].codeFilter[0].path, "code") + self.assertEqual(inst.dataRequirement[0].codeFilter[0].valueSet, "urn:oid:2.16.840.1.113883.3.464.1003.111.12.1006") + self.assertEqual(inst.dataRequirement[0].type, "Condition") + self.assertEqual(inst.date.date, FHIRDate("2015-07-22").date) + self.assertEqual(inst.date.as_json(), "2015-07-22") + self.assertEqual(inst.description, "Common Logic for adherence to Chlamydia Screening guidelines") + self.assertEqual(inst.id, "example") + self.assertEqual(inst.identifier[0].use, "official") + self.assertEqual(inst.identifier[0].value, "ChalmydiaScreening_Common") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.relatedArtifact[0].resource, "Library/library-quick-model-definition") + self.assertEqual(inst.relatedArtifact[0].type, "depends-on") + self.assertEqual(inst.status, "draft") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.title, "Chlamydia Screening Common Library") + self.assertEqual(inst.topic[0].text, "Chlamydia Screening") + self.assertEqual(inst.type.coding[0].code, "logic-library") + self.assertEqual(inst.version, "2.0.0") diff --git a/fhirclient/models/linkage.py b/fhirclient/models/linkage.py index bd8584bab..fb5cf6cd1 100644 --- a/fhirclient/models/linkage.py +++ b/fhirclient/models/linkage.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Linkage) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Linkage) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/linkage_tests.py b/fhirclient/models/linkage_tests.py index 1af98ddb5..cc21c7b1c 100644 --- a/fhirclient/models/linkage_tests.py +++ b/fhirclient/models/linkage_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/list.py b/fhirclient/models/list.py index 2da478c93..5af5d84a3 100644 --- a/fhirclient/models/list.py +++ b/fhirclient/models/list.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/List) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/List) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/list_tests.py b/fhirclient/models/list_tests.py index c25ae0ca0..a01efde46 100644 --- a/fhirclient/models/list_tests.py +++ b/fhirclient/models/list_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return list.List(js) def testList1(self): - inst = self.instantiate_from("list-example-medlist.json") + inst = self.instantiate_from("list-example-familyhistory-genetics-profile.json") self.assertIsNotNone(inst, "Must have instantiated a List instance") self.implList1(inst) @@ -32,29 +32,27 @@ def testList1(self): self.implList1(inst2) def implList1(self, inst): - self.assertEqual(inst.code.coding[0].code, "182836005") - self.assertEqual(inst.code.coding[0].display, "Review of medication") - self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.code.text, "Medication Review") - self.assertEqual(inst.date.date, FHIRDate("2013-11-20T23:10:23+11:00").date) - self.assertEqual(inst.date.as_json(), "2013-11-20T23:10:23+11:00") - self.assertEqual(inst.entry[0].flag.coding[0].code, "01") - self.assertEqual(inst.entry[0].flag.coding[0].display, "Prescribed") - self.assertEqual(inst.entry[0].flag.coding[0].system, "http://nehta.gov.au/codes/medications/changetype") - self.assertTrue(inst.entry[1].deleted) - self.assertEqual(inst.entry[1].flag.coding[0].code, "02") - self.assertEqual(inst.entry[1].flag.coding[0].display, "Cancelled") - self.assertEqual(inst.entry[1].flag.coding[0].system, "http://nehta.gov.au/codes/medications/changetype") - self.assertEqual(inst.id, "med-list") + self.assertEqual(inst.code.coding[0].code, "8670-2") + self.assertEqual(inst.code.coding[0].display, "History of family member diseases") + self.assertEqual(inst.code.coding[0].system, "http://loinc.org") + self.assertEqual(inst.contained[0].id, "1") + self.assertEqual(inst.contained[1].id, "2") + self.assertEqual(inst.contained[2].id, "3") + self.assertEqual(inst.contained[3].id, "4") + self.assertEqual(inst.contained[4].id, "5") + self.assertEqual(inst.contained[5].id, "6") + self.assertEqual(inst.contained[6].id, "7") + self.assertEqual(inst.contained[7].id, "8") + self.assertEqual(inst.id, "genetic") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.mode, "changes") + self.assertEqual(inst.mode, "snapshot") self.assertEqual(inst.status, "current") self.assertEqual(inst.text.status, "generated") def testList2(self): - inst = self.instantiate_from("list-example-familyhistory-genetics-profile-annie.json") + inst = self.instantiate_from("list-example-familyhistory-f201-roel.json") self.assertIsNotNone(inst, "Must have instantiated a List instance") self.implList2(inst) @@ -67,26 +65,19 @@ def implList2(self, inst): self.assertEqual(inst.code.coding[0].code, "8670-2") self.assertEqual(inst.code.coding[0].display, "History of family member diseases") self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.contained[0].id, "image") - self.assertEqual(inst.contained[1].id, "1") - self.assertEqual(inst.contained[2].id, "2") - self.assertEqual(inst.contained[3].id, "3") - self.assertEqual(inst.contained[4].id, "4") - self.assertEqual(inst.contained[5].id, "5") - self.assertEqual(inst.contained[6].id, "6") - self.assertEqual(inst.contained[7].id, "7") - self.assertEqual(inst.contained[8].id, "8") - self.assertEqual(inst.contained[9].id, "9") - self.assertEqual(inst.id, "prognosis") + self.assertEqual(inst.contained[0].id, "fmh-1") + self.assertEqual(inst.contained[1].id, "fmh-2") + self.assertEqual(inst.id, "f201") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.mode, "snapshot") + self.assertEqual(inst.note[0].text, "Both parents, both brothers and both children (twin) are still alive.") self.assertEqual(inst.status, "current") self.assertEqual(inst.text.status, "generated") def testList3(self): - inst = self.instantiate_from("list-example-simple-empty.json") + inst = self.instantiate_from("list-example-double-cousin-relationship-pedigree.json") self.assertIsNotNone(inst, "Must have instantiated a List instance") self.implList3(inst) @@ -96,12 +87,17 @@ def testList3(self): self.implList3(inst2) def implList3(self, inst): - self.assertEqual(inst.code.coding[0].code, "346638") - self.assertEqual(inst.code.coding[0].display, "Patient Admission List") - self.assertEqual(inst.code.coding[0].system, "http://acme.com/list-codes") - self.assertEqual(inst.date.date, FHIRDate("2016-07-14T11:54:05+10:00").date) - self.assertEqual(inst.date.as_json(), "2016-07-14T11:54:05+10:00") - self.assertEqual(inst.id, "example-simple-empty") + self.assertEqual(inst.code.coding[0].code, "80738-8") + self.assertEqual(inst.code.coding[0].display, "TPMT gene mutations found [Identifier] in Blood or Tissue by Sequencing Nominal") + self.assertEqual(inst.code.coding[0].system, "http://loinc.org") + self.assertEqual(inst.code.text, "TPMT gene mutations found [Identifier] in Blood or Tissue by Sequencing Nominal") + self.assertEqual(inst.contained[0].id, "1") + self.assertEqual(inst.contained[1].id, "2") + self.assertEqual(inst.contained[2].id, "3") + self.assertEqual(inst.contained[3].id, "4") + self.assertEqual(inst.contained[4].id, "5") + self.assertEqual(inst.contained[5].id, "6") + self.assertEqual(inst.id, "example-double-cousin-relationship") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") @@ -110,7 +106,7 @@ def implList3(self, inst): self.assertEqual(inst.text.status, "generated") def testList4(self): - inst = self.instantiate_from("list-example-empty.json") + inst = self.instantiate_from("list-example-simple-empty.json") self.assertIsNotNone(inst, "Must have instantiated a List instance") self.implList4(inst) @@ -120,17 +116,12 @@ def testList4(self): self.implList4(inst2) def implList4(self, inst): - self.assertEqual(inst.code.coding[0].code, "182836005") - self.assertEqual(inst.code.coding[0].display, "Review of medication") - self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.code.text, "Medication Review") - self.assertEqual(inst.date.date, FHIRDate("2012-11-26T07:30:23+11:00").date) - self.assertEqual(inst.date.as_json(), "2012-11-26T07:30:23+11:00") - self.assertEqual(inst.emptyReason.coding[0].code, "nilknown") - self.assertEqual(inst.emptyReason.coding[0].display, "Nil Known") - self.assertEqual(inst.emptyReason.coding[0].system, "http://terminology.hl7.org/CodeSystem/list-empty-reason") - self.assertEqual(inst.emptyReason.text, "The patient is not on any medications") - self.assertEqual(inst.id, "example-empty") + self.assertEqual(inst.code.coding[0].code, "346638") + self.assertEqual(inst.code.coding[0].display, "Patient Admission List") + self.assertEqual(inst.code.coding[0].system, "http://acme.com/list-codes") + self.assertEqual(inst.date.date, FHIRDate("2016-07-14T11:54:05+10:00").date) + self.assertEqual(inst.date.as_json(), "2016-07-14T11:54:05+10:00") + self.assertEqual(inst.id, "example-simple-empty") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") @@ -139,7 +130,7 @@ def implList4(self, inst): self.assertEqual(inst.text.status, "generated") def testList5(self): - inst = self.instantiate_from("list-example-familyhistory-genetics-profile.json") + inst = self.instantiate_from("list-example-long.json") self.assertIsNotNone(inst, "Must have instantiated a List instance") self.implList5(inst) @@ -149,27 +140,18 @@ def testList5(self): self.implList5(inst2) def implList5(self, inst): - self.assertEqual(inst.code.coding[0].code, "8670-2") - self.assertEqual(inst.code.coding[0].display, "History of family member diseases") - self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.contained[0].id, "1") - self.assertEqual(inst.contained[1].id, "2") - self.assertEqual(inst.contained[2].id, "3") - self.assertEqual(inst.contained[3].id, "4") - self.assertEqual(inst.contained[4].id, "5") - self.assertEqual(inst.contained[5].id, "6") - self.assertEqual(inst.contained[6].id, "7") - self.assertEqual(inst.contained[7].id, "8") - self.assertEqual(inst.id, "genetic") + self.assertEqual(inst.date.date, FHIRDate("2018-02-21T12:17:00+11:00").date) + self.assertEqual(inst.date.as_json(), "2018-02-21T12:17:00+11:00") + self.assertEqual(inst.id, "long") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.mode, "snapshot") + self.assertEqual(inst.mode, "changes") self.assertEqual(inst.status, "current") self.assertEqual(inst.text.status, "generated") def testList6(self): - inst = self.instantiate_from("list-example-familyhistory-f201-roel.json") + inst = self.instantiate_from("list-example.json") self.assertIsNotNone(inst, "Must have instantiated a List instance") self.implList6(inst) @@ -179,22 +161,23 @@ def testList6(self): self.implList6(inst2) def implList6(self, inst): - self.assertEqual(inst.code.coding[0].code, "8670-2") - self.assertEqual(inst.code.coding[0].display, "History of family member diseases") - self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.contained[0].id, "fmh-1") - self.assertEqual(inst.contained[1].id, "fmh-2") - self.assertEqual(inst.id, "f201") + self.assertEqual(inst.date.date, FHIRDate("2012-11-25T22:17:00+11:00").date) + self.assertEqual(inst.date.as_json(), "2012-11-25T22:17:00+11:00") + self.assertTrue(inst.entry[0].deleted) + self.assertEqual(inst.entry[0].flag.text, "Deleted due to error") + self.assertEqual(inst.entry[1].flag.text, "Added") + self.assertEqual(inst.id, "example") + self.assertEqual(inst.identifier[0].system, "urn:uuid:a9fcea7c-fcdf-4d17-a5e0-f26dda030b59") + self.assertEqual(inst.identifier[0].value, "23974652") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.mode, "snapshot") - self.assertEqual(inst.note[0].text, "Both parents, both brothers and both children (twin) are still alive.") + self.assertEqual(inst.mode, "changes") self.assertEqual(inst.status, "current") self.assertEqual(inst.text.status, "generated") def testList7(self): - inst = self.instantiate_from("list-example.json") + inst = self.instantiate_from("list-example-empty.json") self.assertIsNotNone(inst, "Must have instantiated a List instance") self.implList7(inst) @@ -204,23 +187,26 @@ def testList7(self): self.implList7(inst2) def implList7(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2012-11-25T22:17:00+11:00").date) - self.assertEqual(inst.date.as_json(), "2012-11-25T22:17:00+11:00") - self.assertTrue(inst.entry[0].deleted) - self.assertEqual(inst.entry[0].flag.text, "Deleted due to error") - self.assertEqual(inst.entry[1].flag.text, "Added") - self.assertEqual(inst.id, "example") - self.assertEqual(inst.identifier[0].system, "urn:uuid:a9fcea7c-fcdf-4d17-a5e0-f26dda030b59") - self.assertEqual(inst.identifier[0].value, "23974652") + self.assertEqual(inst.code.coding[0].code, "182836005") + self.assertEqual(inst.code.coding[0].display, "Review of medication") + self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.code.text, "Medication Review") + self.assertEqual(inst.date.date, FHIRDate("2012-11-26T07:30:23+11:00").date) + self.assertEqual(inst.date.as_json(), "2012-11-26T07:30:23+11:00") + self.assertEqual(inst.emptyReason.coding[0].code, "nilknown") + self.assertEqual(inst.emptyReason.coding[0].display, "Nil Known") + self.assertEqual(inst.emptyReason.coding[0].system, "http://terminology.hl7.org/CodeSystem/list-empty-reason") + self.assertEqual(inst.emptyReason.text, "The patient is not on any medications") + self.assertEqual(inst.id, "example-empty") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.mode, "changes") + self.assertEqual(inst.mode, "snapshot") self.assertEqual(inst.status, "current") self.assertEqual(inst.text.status, "generated") def testList8(self): - inst = self.instantiate_from("list-example-allergies.json") + inst = self.instantiate_from("list-example-medlist.json") self.assertIsNotNone(inst, "Must have instantiated a List instance") self.implList8(inst) @@ -230,25 +216,29 @@ def testList8(self): self.implList8(inst2) def implList8(self, inst): - self.assertEqual(inst.code.coding[0].code, "52472-8") - self.assertEqual(inst.code.coding[0].display, "Allergies and Adverse Drug Reactions") - self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.code.text, "Current Allergy List") - self.assertEqual(inst.date.date, FHIRDate("2015-07-14T23:10:23+11:00").date) - self.assertEqual(inst.date.as_json(), "2015-07-14T23:10:23+11:00") - self.assertEqual(inst.id, "current-allergies") + self.assertEqual(inst.code.coding[0].code, "182836005") + self.assertEqual(inst.code.coding[0].display, "Review of medication") + self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.code.text, "Medication Review") + self.assertEqual(inst.date.date, FHIRDate("2013-11-20T23:10:23+11:00").date) + self.assertEqual(inst.date.as_json(), "2013-11-20T23:10:23+11:00") + self.assertEqual(inst.entry[0].flag.coding[0].code, "01") + self.assertEqual(inst.entry[0].flag.coding[0].display, "Prescribed") + self.assertEqual(inst.entry[0].flag.coding[0].system, "http://nehta.gov.au/codes/medications/changetype") + self.assertTrue(inst.entry[1].deleted) + self.assertEqual(inst.entry[1].flag.coding[0].code, "02") + self.assertEqual(inst.entry[1].flag.coding[0].display, "Cancelled") + self.assertEqual(inst.entry[1].flag.coding[0].system, "http://nehta.gov.au/codes/medications/changetype") + self.assertEqual(inst.id, "med-list") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.mode, "working") - self.assertEqual(inst.orderedBy.coding[0].code, "entry-date") - self.assertEqual(inst.orderedBy.coding[0].system, "http://terminology.hl7.org/CodeSystem/list-order") + self.assertEqual(inst.mode, "changes") self.assertEqual(inst.status, "current") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.title, "Current Allergy List") def testList9(self): - inst = self.instantiate_from("list-example-double-cousin-relationship-pedigree.json") + inst = self.instantiate_from("list-example-familyhistory-genetics-profile-annie.json") self.assertIsNotNone(inst, "Must have instantiated a List instance") self.implList9(inst) @@ -258,17 +248,20 @@ def testList9(self): self.implList9(inst2) def implList9(self, inst): - self.assertEqual(inst.code.coding[0].code, "80738-8") - self.assertEqual(inst.code.coding[0].display, "TPMT gene mutations found [Identifier] in Blood or Tissue by Sequencing Nominal") + self.assertEqual(inst.code.coding[0].code, "8670-2") + self.assertEqual(inst.code.coding[0].display, "History of family member diseases") self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.code.text, "TPMT gene mutations found [Identifier] in Blood or Tissue by Sequencing Nominal") - self.assertEqual(inst.contained[0].id, "1") - self.assertEqual(inst.contained[1].id, "2") - self.assertEqual(inst.contained[2].id, "3") - self.assertEqual(inst.contained[3].id, "4") - self.assertEqual(inst.contained[4].id, "5") - self.assertEqual(inst.contained[5].id, "6") - self.assertEqual(inst.id, "example-double-cousin-relationship") + self.assertEqual(inst.contained[0].id, "image") + self.assertEqual(inst.contained[1].id, "1") + self.assertEqual(inst.contained[2].id, "2") + self.assertEqual(inst.contained[3].id, "3") + self.assertEqual(inst.contained[4].id, "4") + self.assertEqual(inst.contained[5].id, "5") + self.assertEqual(inst.contained[6].id, "6") + self.assertEqual(inst.contained[7].id, "7") + self.assertEqual(inst.contained[8].id, "8") + self.assertEqual(inst.contained[9].id, "9") + self.assertEqual(inst.id, "prognosis") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") @@ -277,7 +270,7 @@ def implList9(self, inst): self.assertEqual(inst.text.status, "generated") def testList10(self): - inst = self.instantiate_from("list-example-long.json") + inst = self.instantiate_from("list-example-allergies.json") self.assertIsNotNone(inst, "Must have instantiated a List instance") self.implList10(inst) @@ -287,13 +280,20 @@ def testList10(self): self.implList10(inst2) def implList10(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2018-02-21T12:17:00+11:00").date) - self.assertEqual(inst.date.as_json(), "2018-02-21T12:17:00+11:00") - self.assertEqual(inst.id, "long") + self.assertEqual(inst.code.coding[0].code, "52472-8") + self.assertEqual(inst.code.coding[0].display, "Allergies and Adverse Drug Reactions") + self.assertEqual(inst.code.coding[0].system, "http://loinc.org") + self.assertEqual(inst.code.text, "Current Allergy List") + self.assertEqual(inst.date.date, FHIRDate("2015-07-14T23:10:23+11:00").date) + self.assertEqual(inst.date.as_json(), "2015-07-14T23:10:23+11:00") + self.assertEqual(inst.id, "current-allergies") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.mode, "changes") + self.assertEqual(inst.mode, "working") + self.assertEqual(inst.orderedBy.coding[0].code, "entry-date") + self.assertEqual(inst.orderedBy.coding[0].system, "http://terminology.hl7.org/CodeSystem/list-order") self.assertEqual(inst.status, "current") self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.title, "Current Allergy List") diff --git a/fhirclient/models/location.py b/fhirclient/models/location.py index e0e662105..ca58e9adc 100644 --- a/fhirclient/models/location.py +++ b/fhirclient/models/location.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Location) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Location) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/location_tests.py b/fhirclient/models/location_tests.py index 6d108e5ad..8eb2c94f8 100644 --- a/fhirclient/models/location_tests.py +++ b/fhirclient/models/location_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -69,7 +69,7 @@ def implLocation1(self, inst): self.assertEqual(inst.text.status, "generated") def testLocation2(self): - inst = self.instantiate_from("location-example-room.json") + inst = self.instantiate_from("location-example-ambulance.json") self.assertIsNotNone(inst, "Must have instantiated a Location instance") self.implLocation2(inst) @@ -79,33 +79,28 @@ def testLocation2(self): self.implLocation2(inst2) def implLocation2(self, inst): - self.assertEqual(inst.alias[0], "South Wing OR 5") - self.assertEqual(inst.alias[1], "Main Wing OR 2") - self.assertEqual(inst.description, "Old South Wing, Neuro Radiology Operation Room 1 on second floor") - self.assertEqual(inst.id, "2") - self.assertEqual(inst.identifier[0].value, "B1-S.F2.1.00") + self.assertEqual(inst.description, "Ambulance provided by Burgers University Medical Center") + self.assertEqual(inst.id, "amb") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.mode, "instance") - self.assertEqual(inst.name, "South Wing Neuro OR 1") - self.assertEqual(inst.operationalStatus.code, "H") - self.assertEqual(inst.operationalStatus.display, "Housekeeping") - self.assertEqual(inst.operationalStatus.system, "http://terminology.hl7.org/CodeSystem/v2-0116") - self.assertEqual(inst.physicalType.coding[0].code, "ro") - self.assertEqual(inst.physicalType.coding[0].display, "Room") + self.assertEqual(inst.mode, "kind") + self.assertEqual(inst.name, "BUMC Ambulance") + self.assertEqual(inst.physicalType.coding[0].code, "ve") + self.assertEqual(inst.physicalType.coding[0].display, "Vehicle") self.assertEqual(inst.physicalType.coding[0].system, "http://terminology.hl7.org/CodeSystem/location-physical-type") - self.assertEqual(inst.status, "suspended") + self.assertEqual(inst.status, "active") self.assertEqual(inst.telecom[0].system, "phone") + self.assertEqual(inst.telecom[0].use, "mobile") self.assertEqual(inst.telecom[0].value, "2329") - self.assertEqual(inst.text.div, "
Burgers UMC, South Wing, second floor, Neuro Radiology Operation Room 1
") + self.assertEqual(inst.text.div, "
Mobile Clinic
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type[0].coding[0].code, "RNEU") - self.assertEqual(inst.type[0].coding[0].display, "Neuroradiology unit") + self.assertEqual(inst.type[0].coding[0].code, "AMB") + self.assertEqual(inst.type[0].coding[0].display, "Ambulance") self.assertEqual(inst.type[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-RoleCode") def testLocation3(self): - inst = self.instantiate_from("location-example-ambulance.json") + inst = self.instantiate_from("location-example-hl7hq.json") self.assertIsNotNone(inst, "Must have instantiated a Location instance") self.implLocation3(inst) @@ -115,28 +110,37 @@ def testLocation3(self): self.implLocation3(inst2) def implLocation3(self, inst): - self.assertEqual(inst.description, "Ambulance provided by Burgers University Medical Center") - self.assertEqual(inst.id, "amb") + self.assertEqual(inst.address.city, "Ann Arbor") + self.assertEqual(inst.address.country, "USA") + self.assertEqual(inst.address.line[0], "3300 Washtenaw Avenue, Suite 227") + self.assertEqual(inst.address.postalCode, "48104") + self.assertEqual(inst.address.state, "MI") + self.assertEqual(inst.description, "HL7 Headquarters") + self.assertEqual(inst.id, "hl7") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.mode, "kind") - self.assertEqual(inst.name, "BUMC Ambulance") - self.assertEqual(inst.physicalType.coding[0].code, "ve") - self.assertEqual(inst.physicalType.coding[0].display, "Vehicle") + self.assertEqual(inst.mode, "instance") + self.assertEqual(inst.name, "Health Level Seven International") + self.assertEqual(inst.physicalType.coding[0].code, "bu") + self.assertEqual(inst.physicalType.coding[0].display, "Building") self.assertEqual(inst.physicalType.coding[0].system, "http://terminology.hl7.org/CodeSystem/location-physical-type") + self.assertEqual(inst.position.latitude, -83.69471) + self.assertEqual(inst.position.longitude, 42.2565) self.assertEqual(inst.status, "active") self.assertEqual(inst.telecom[0].system, "phone") - self.assertEqual(inst.telecom[0].use, "mobile") - self.assertEqual(inst.telecom[0].value, "2329") - self.assertEqual(inst.text.div, "
Mobile Clinic
") + self.assertEqual(inst.telecom[0].value, "(+1) 734-677-7777") + self.assertEqual(inst.telecom[1].system, "fax") + self.assertEqual(inst.telecom[1].value, "(+1) 734-677-6622") + self.assertEqual(inst.telecom[2].system, "email") + self.assertEqual(inst.telecom[2].value, "hq@HL7.org") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type[0].coding[0].code, "AMB") - self.assertEqual(inst.type[0].coding[0].display, "Ambulance") + self.assertEqual(inst.type[0].coding[0].code, "SLEEP") + self.assertEqual(inst.type[0].coding[0].display, "Sleep disorders unit") self.assertEqual(inst.type[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-RoleCode") def testLocation4(self): - inst = self.instantiate_from("location-example-ukpharmacy.json") + inst = self.instantiate_from("location-example-room.json") self.assertIsNotNone(inst, "Must have instantiated a Location instance") self.implLocation4(inst) @@ -146,21 +150,29 @@ def testLocation4(self): self.implLocation4(inst2) def implLocation4(self, inst): - self.assertEqual(inst.description, "All Pharmacies in the United Kingdom covered by the National Pharmacy Association") - self.assertEqual(inst.id, "ukp") + self.assertEqual(inst.alias[0], "South Wing OR 5") + self.assertEqual(inst.alias[1], "Main Wing OR 2") + self.assertEqual(inst.description, "Old South Wing, Neuro Radiology Operation Room 1 on second floor") + self.assertEqual(inst.id, "2") + self.assertEqual(inst.identifier[0].value, "B1-S.F2.1.00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.mode, "kind") - self.assertEqual(inst.name, "UK Pharmacies") - self.assertEqual(inst.physicalType.coding[0].code, "jdn") - self.assertEqual(inst.physicalType.coding[0].display, "Jurisdiction") + self.assertEqual(inst.mode, "instance") + self.assertEqual(inst.name, "South Wing Neuro OR 1") + self.assertEqual(inst.operationalStatus.code, "H") + self.assertEqual(inst.operationalStatus.display, "Housekeeping") + self.assertEqual(inst.operationalStatus.system, "http://terminology.hl7.org/CodeSystem/v2-0116") + self.assertEqual(inst.physicalType.coding[0].code, "ro") + self.assertEqual(inst.physicalType.coding[0].display, "Room") self.assertEqual(inst.physicalType.coding[0].system, "http://terminology.hl7.org/CodeSystem/location-physical-type") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.div, "
UK Pharmacies
") + self.assertEqual(inst.status, "suspended") + self.assertEqual(inst.telecom[0].system, "phone") + self.assertEqual(inst.telecom[0].value, "2329") + self.assertEqual(inst.text.div, "
Burgers UMC, South Wing, second floor, Neuro Radiology Operation Room 1
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type[0].coding[0].code, "PHARM") - self.assertEqual(inst.type[0].coding[0].display, "Pharmacy") + self.assertEqual(inst.type[0].coding[0].code, "RNEU") + self.assertEqual(inst.type[0].coding[0].display, "Neuroradiology unit") self.assertEqual(inst.type[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-RoleCode") def testLocation5(self): @@ -192,7 +204,7 @@ def implLocation5(self, inst): self.assertEqual(inst.type[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-RoleCode") def testLocation6(self): - inst = self.instantiate_from("location-example-hl7hq.json") + inst = self.instantiate_from("location-example-ukpharmacy.json") self.assertIsNotNone(inst, "Must have instantiated a Location instance") self.implLocation6(inst) @@ -202,32 +214,20 @@ def testLocation6(self): self.implLocation6(inst2) def implLocation6(self, inst): - self.assertEqual(inst.address.city, "Ann Arbor") - self.assertEqual(inst.address.country, "USA") - self.assertEqual(inst.address.line[0], "3300 Washtenaw Avenue, Suite 227") - self.assertEqual(inst.address.postalCode, "48104") - self.assertEqual(inst.address.state, "MI") - self.assertEqual(inst.description, "HL7 Headquarters") - self.assertEqual(inst.id, "hl7") + self.assertEqual(inst.description, "All Pharmacies in the United Kingdom covered by the National Pharmacy Association") + self.assertEqual(inst.id, "ukp") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.mode, "instance") - self.assertEqual(inst.name, "Health Level Seven International") - self.assertEqual(inst.physicalType.coding[0].code, "bu") - self.assertEqual(inst.physicalType.coding[0].display, "Building") + self.assertEqual(inst.mode, "kind") + self.assertEqual(inst.name, "UK Pharmacies") + self.assertEqual(inst.physicalType.coding[0].code, "jdn") + self.assertEqual(inst.physicalType.coding[0].display, "Jurisdiction") self.assertEqual(inst.physicalType.coding[0].system, "http://terminology.hl7.org/CodeSystem/location-physical-type") - self.assertEqual(inst.position.latitude, -83.69471) - self.assertEqual(inst.position.longitude, 42.2565) self.assertEqual(inst.status, "active") - self.assertEqual(inst.telecom[0].system, "phone") - self.assertEqual(inst.telecom[0].value, "(+1) 734-677-7777") - self.assertEqual(inst.telecom[1].system, "fax") - self.assertEqual(inst.telecom[1].value, "(+1) 734-677-6622") - self.assertEqual(inst.telecom[2].system, "email") - self.assertEqual(inst.telecom[2].value, "hq@HL7.org") + self.assertEqual(inst.text.div, "
UK Pharmacies
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type[0].coding[0].code, "SLEEP") - self.assertEqual(inst.type[0].coding[0].display, "Sleep disorders unit") + self.assertEqual(inst.type[0].coding[0].code, "PHARM") + self.assertEqual(inst.type[0].coding[0].display, "Pharmacy") self.assertEqual(inst.type[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-RoleCode") diff --git a/fhirclient/models/marketingstatus.py b/fhirclient/models/marketingstatus.py index 8450885b8..d0f178bc7 100644 --- a/fhirclient/models/marketingstatus.py +++ b/fhirclient/models/marketingstatus.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MarketingStatus) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MarketingStatus) on 2024-07-15. +# 2024, SMART Health IT. from . import backboneelement diff --git a/fhirclient/models/measure.py b/fhirclient/models/measure.py index 848ad69db..853ac0746 100644 --- a/fhirclient/models/measure.py +++ b/fhirclient/models/measure.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Measure) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Measure) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/measure_tests.py b/fhirclient/models/measure_tests.py index ea8fdd011..c285fdca0 100644 --- a/fhirclient/models/measure_tests.py +++ b/fhirclient/models/measure_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -52,7 +52,7 @@ def implMeasure1(self, inst): self.assertEqual(inst.title, "Screening for Depression") def testMeasure2(self): - inst = self.instantiate_from("measure-predecessor-example.json") + inst = self.instantiate_from("measure-cms146-example.json") self.assertIsNotNone(inst, "Must have instantiated a Measure instance") self.implMeasure2(inst) @@ -62,77 +62,6 @@ def testMeasure2(self): self.implMeasure2(inst2) def implMeasure2(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2014-03-08").date) - self.assertEqual(inst.date.as_json(), "2014-03-08") - self.assertEqual(inst.description, "Exclusive breastfeeding measure of outcomes for exclusive breastmilk feeding of newborns.") - self.assertEqual(inst.group[0].id, "PopulationGroup1") - self.assertEqual(inst.group[0].population[0].code.coding[0].code, "initial-population") - self.assertEqual(inst.group[0].population[0].criteria.expression, "InitialPopulation1") - self.assertEqual(inst.group[0].population[0].criteria.language, "text/cql") - self.assertEqual(inst.group[0].population[1].code.coding[0].code, "denominator") - self.assertEqual(inst.group[0].population[1].criteria.expression, "Denominator1") - self.assertEqual(inst.group[0].population[1].criteria.language, "text/cql") - self.assertEqual(inst.group[0].population[2].code.coding[0].code, "denominator-exclusions") - self.assertEqual(inst.group[0].population[2].criteria.expression, "DenominatorExclusions1") - self.assertEqual(inst.group[0].population[2].criteria.language, "text/cql") - self.assertEqual(inst.group[0].population[3].code.coding[0].code, "numerator") - self.assertEqual(inst.group[0].population[3].criteria.expression, "Numerator1") - self.assertEqual(inst.group[0].population[3].criteria.language, "text/cql") - self.assertEqual(inst.group[1].id, "PopulationGroup2") - self.assertEqual(inst.group[1].population[0].code.coding[0].code, "initial-population") - self.assertEqual(inst.group[1].population[0].criteria.expression, "InitialPopulation2") - self.assertEqual(inst.group[1].population[0].criteria.language, "text/cql") - self.assertEqual(inst.group[1].population[1].code.coding[0].code, "denominator") - self.assertEqual(inst.group[1].population[1].criteria.expression, "Denominator2") - self.assertEqual(inst.group[1].population[1].criteria.language, "text/cql") - self.assertEqual(inst.group[1].population[2].code.coding[0].code, "denominator-exclusion") - self.assertEqual(inst.group[1].population[2].criteria.expression, "DenominatorExclusions2") - self.assertEqual(inst.group[1].population[2].criteria.language, "text/cql") - self.assertEqual(inst.group[1].population[3].code.coding[0].code, "numerator") - self.assertEqual(inst.group[1].population[3].criteria.expression, "Numerator2") - self.assertEqual(inst.group[1].population[3].criteria.language, "text/cql") - self.assertEqual(inst.id, "measure-predecessor-example") - self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "exclusive-breastfeeding-measure") - self.assertEqual(inst.improvementNotation.coding[0].code, "increase") - self.assertEqual(inst.improvementNotation.coding[0].system, "http://terminology.hl7.org/CodeSystem/measure-improvement-notation") - self.assertEqual(inst.library[0], "Library/library-exclusive-breastfeeding-cqm-logic") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.purpose, "Measure of newborns who were fed breast milk only since birth") - self.assertEqual(inst.relatedArtifact[0].citation, "American Academy of Pediatrics. (2005). Section on Breastfeeding. Policy Statement:Breastfeeding and the Use of Human Milk. Pediatrics.115:496-506.") - self.assertEqual(inst.relatedArtifact[0].type, "documentation") - self.assertEqual(inst.relatedArtifact[1].type, "documentation") - self.assertEqual(inst.relatedArtifact[2].type, "documentation") - self.assertEqual(inst.relatedArtifact[3].type, "documentation") - self.assertEqual(inst.relatedArtifact[4].type, "documentation") - self.assertEqual(inst.relatedArtifact[5].type, "documentation") - self.assertEqual(inst.relatedArtifact[6].citation, "Kramer, M.S. & Kakuma, R. (2002).Optimal duration of exclusive breastfeeding. [107 refs] Cochrane Database of Systematic Reviews. (1):CD003517.") - self.assertEqual(inst.relatedArtifact[6].type, "documentation") - self.assertEqual(inst.relatedArtifact[7].citation, "Petrova, A., Hegyi, T., & Mehta, R. (2007). Maternal race/ethnicity and one-month exclusive breastfeeding in association with the in-hospital feeding modality. Breastfeeding Medicine. 2(2):92-8.") - self.assertEqual(inst.relatedArtifact[7].type, "documentation") - self.assertEqual(inst.relatedArtifact[8].type, "documentation") - self.assertEqual(inst.relatedArtifact[9].type, "documentation") - self.assertEqual(inst.scoring.coding[0].code, "proportion") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.title, "Exclusive Breastfeeding Measure") - self.assertEqual(inst.topic[0].text, "Exclusive Breastfeeding") - self.assertEqual(inst.type[0].coding[0].code, "process") - self.assertEqual(inst.version, "4.0.0") - - def testMeasure3(self): - inst = self.instantiate_from("measure-cms146-example.json") - self.assertIsNotNone(inst, "Must have instantiated a Measure instance") - self.implMeasure3(inst) - - js = inst.as_json() - self.assertEqual("Measure", js["resourceType"]) - inst2 = measure.Measure(js) - self.implMeasure3(inst2) - - def implMeasure3(self, inst): self.assertEqual(inst.approvalDate.date, FHIRDate("2016-01-01").date) self.assertEqual(inst.approvalDate.as_json(), "2016-01-01") self.assertEqual(inst.author[0].name, "National Committee for Quality Assurance") @@ -215,17 +144,17 @@ def implMeasure3(self, inst): self.assertEqual(inst.useContext[1].valueRange.low.value, 3) self.assertEqual(inst.version, "1.0.0") - def testMeasure4(self): + def testMeasure3(self): inst = self.instantiate_from("measure-component-a-example.json") self.assertIsNotNone(inst, "Must have instantiated a Measure instance") - self.implMeasure4(inst) + self.implMeasure3(inst) js = inst.as_json() self.assertEqual("Measure", js["resourceType"]) inst2 = measure.Measure(js) - self.implMeasure4(inst2) + self.implMeasure3(inst2) - def implMeasure4(self, inst): + def implMeasure3(self, inst): self.assertEqual(inst.group[0].id, "Main") self.assertEqual(inst.group[0].population[0].code.coding[0].code, "initial-population") self.assertEqual(inst.group[0].population[0].criteria.expression, "Initial Population") @@ -245,6 +174,77 @@ def implMeasure4(self, inst): self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.title, "Screening for Alcohol Misuse") + def testMeasure4(self): + inst = self.instantiate_from("measure-predecessor-example.json") + self.assertIsNotNone(inst, "Must have instantiated a Measure instance") + self.implMeasure4(inst) + + js = inst.as_json() + self.assertEqual("Measure", js["resourceType"]) + inst2 = measure.Measure(js) + self.implMeasure4(inst2) + + def implMeasure4(self, inst): + self.assertEqual(inst.date.date, FHIRDate("2014-03-08").date) + self.assertEqual(inst.date.as_json(), "2014-03-08") + self.assertEqual(inst.description, "Exclusive breastfeeding measure of outcomes for exclusive breastmilk feeding of newborns.") + self.assertEqual(inst.group[0].id, "PopulationGroup1") + self.assertEqual(inst.group[0].population[0].code.coding[0].code, "initial-population") + self.assertEqual(inst.group[0].population[0].criteria.expression, "InitialPopulation1") + self.assertEqual(inst.group[0].population[0].criteria.language, "text/cql") + self.assertEqual(inst.group[0].population[1].code.coding[0].code, "denominator") + self.assertEqual(inst.group[0].population[1].criteria.expression, "Denominator1") + self.assertEqual(inst.group[0].population[1].criteria.language, "text/cql") + self.assertEqual(inst.group[0].population[2].code.coding[0].code, "denominator-exclusions") + self.assertEqual(inst.group[0].population[2].criteria.expression, "DenominatorExclusions1") + self.assertEqual(inst.group[0].population[2].criteria.language, "text/cql") + self.assertEqual(inst.group[0].population[3].code.coding[0].code, "numerator") + self.assertEqual(inst.group[0].population[3].criteria.expression, "Numerator1") + self.assertEqual(inst.group[0].population[3].criteria.language, "text/cql") + self.assertEqual(inst.group[1].id, "PopulationGroup2") + self.assertEqual(inst.group[1].population[0].code.coding[0].code, "initial-population") + self.assertEqual(inst.group[1].population[0].criteria.expression, "InitialPopulation2") + self.assertEqual(inst.group[1].population[0].criteria.language, "text/cql") + self.assertEqual(inst.group[1].population[1].code.coding[0].code, "denominator") + self.assertEqual(inst.group[1].population[1].criteria.expression, "Denominator2") + self.assertEqual(inst.group[1].population[1].criteria.language, "text/cql") + self.assertEqual(inst.group[1].population[2].code.coding[0].code, "denominator-exclusion") + self.assertEqual(inst.group[1].population[2].criteria.expression, "DenominatorExclusions2") + self.assertEqual(inst.group[1].population[2].criteria.language, "text/cql") + self.assertEqual(inst.group[1].population[3].code.coding[0].code, "numerator") + self.assertEqual(inst.group[1].population[3].criteria.expression, "Numerator2") + self.assertEqual(inst.group[1].population[3].criteria.language, "text/cql") + self.assertEqual(inst.id, "measure-predecessor-example") + self.assertEqual(inst.identifier[0].use, "official") + self.assertEqual(inst.identifier[0].value, "exclusive-breastfeeding-measure") + self.assertEqual(inst.improvementNotation.coding[0].code, "increase") + self.assertEqual(inst.improvementNotation.coding[0].system, "http://terminology.hl7.org/CodeSystem/measure-improvement-notation") + self.assertEqual(inst.library[0], "Library/library-exclusive-breastfeeding-cqm-logic") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.purpose, "Measure of newborns who were fed breast milk only since birth") + self.assertEqual(inst.relatedArtifact[0].citation, "American Academy of Pediatrics. (2005). Section on Breastfeeding. Policy Statement:Breastfeeding and the Use of Human Milk. Pediatrics.115:496-506.") + self.assertEqual(inst.relatedArtifact[0].type, "documentation") + self.assertEqual(inst.relatedArtifact[1].type, "documentation") + self.assertEqual(inst.relatedArtifact[2].type, "documentation") + self.assertEqual(inst.relatedArtifact[3].type, "documentation") + self.assertEqual(inst.relatedArtifact[4].type, "documentation") + self.assertEqual(inst.relatedArtifact[5].type, "documentation") + self.assertEqual(inst.relatedArtifact[6].citation, "Kramer, M.S. & Kakuma, R. (2002).Optimal duration of exclusive breastfeeding. [107 refs] Cochrane Database of Systematic Reviews. (1):CD003517.") + self.assertEqual(inst.relatedArtifact[6].type, "documentation") + self.assertEqual(inst.relatedArtifact[7].citation, "Petrova, A., Hegyi, T., & Mehta, R. (2007). Maternal race/ethnicity and one-month exclusive breastfeeding in association with the in-hospital feeding modality. Breastfeeding Medicine. 2(2):92-8.") + self.assertEqual(inst.relatedArtifact[7].type, "documentation") + self.assertEqual(inst.relatedArtifact[8].type, "documentation") + self.assertEqual(inst.relatedArtifact[9].type, "documentation") + self.assertEqual(inst.scoring.coding[0].code, "proportion") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.title, "Exclusive Breastfeeding Measure") + self.assertEqual(inst.topic[0].text, "Exclusive Breastfeeding") + self.assertEqual(inst.type[0].coding[0].code, "process") + self.assertEqual(inst.version, "4.0.1") + def testMeasure5(self): inst = self.instantiate_from("measure-composite-example.json") self.assertIsNotNone(inst, "Must have instantiated a Measure instance") diff --git a/fhirclient/models/measurereport.py b/fhirclient/models/measurereport.py index b401e3ed8..9936f0128 100644 --- a/fhirclient/models/measurereport.py +++ b/fhirclient/models/measurereport.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MeasureReport) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MeasureReport) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/measurereport_tests.py b/fhirclient/models/measurereport_tests.py index 626a2abf8..e9cddae73 100644 --- a/fhirclient/models/measurereport_tests.py +++ b/fhirclient/models/measurereport_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/media.py b/fhirclient/models/media.py index 2be0cd63d..721406bbf 100644 --- a/fhirclient/models/media.py +++ b/fhirclient/models/media.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Media) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Media) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -95,7 +95,7 @@ def __init__(self, jsondict=None, strict=True): List of `CodeableConcept` items (represented as `dict` in JSON). """ self.status = None - """ preparation | in-progress | not-done | suspended | aborted | + """ preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown. Type `str`. """ diff --git a/fhirclient/models/media_tests.py b/fhirclient/models/media_tests.py index c20d3d9d1..c55736cfc 100644 --- a/fhirclient/models/media_tests.py +++ b/fhirclient/models/media_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return media.Media(js) def testMedia1(self): - inst = self.instantiate_from("media-example.json") + inst = self.instantiate_from("media-example-xray.json") self.assertIsNotNone(inst, "Must have instantiated a Media instance") self.implMedia1(inst) @@ -32,28 +32,28 @@ def testMedia1(self): self.implMedia1(inst2) def implMedia1(self, inst): - self.assertEqual(inst.content.contentType, "image/gif") - self.assertEqual(inst.content.creation.date, FHIRDate("2009-09-03").date) - self.assertEqual(inst.content.creation.as_json(), "2009-09-03") + self.assertEqual(inst.bodySite.coding[0].code, "85151006") + self.assertEqual(inst.bodySite.coding[0].display, "Structure of left hand (body structure)") + self.assertEqual(inst.bodySite.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.content.contentType, "image/jpeg") + self.assertEqual(inst.content.creation.date, FHIRDate("2016-03-15").date) + self.assertEqual(inst.content.creation.as_json(), "2016-03-15") self.assertEqual(inst.content.id, "a1") - self.assertEqual(inst.createdDateTime.date, FHIRDate("2017-12-17").date) - self.assertEqual(inst.createdDateTime.as_json(), "2017-12-17") - self.assertEqual(inst.frames, 1) - self.assertEqual(inst.height, 145) - self.assertEqual(inst.id, "example") - self.assertEqual(inst.issued.date, FHIRDate("2017-12-17T14:56:18Z").date) - self.assertEqual(inst.issued.as_json(), "2017-12-17T14:56:18Z") + self.assertEqual(inst.content.url, "http://someimagingcenter.org/fhir/Binary/A12345") + self.assertEqual(inst.createdDateTime.date, FHIRDate("2016-03-15").date) + self.assertEqual(inst.createdDateTime.as_json(), "2016-03-15") + self.assertEqual(inst.height, 432) + self.assertEqual(inst.id, "xray") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.modality.coding[0].code, "diagram") - self.assertEqual(inst.modality.coding[0].system, "http://terminology.hl7.org/CodeSystem/media-modality") + self.assertEqual(inst.modality.coding[0].code, "39714003") + self.assertEqual(inst.modality.coding[0].display, "Skeletal X-ray of wrist and hand") + self.assertEqual(inst.modality.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.status, "completed") + self.assertEqual(inst.text.div, "
Xray of left hand for Patient Henry Levin (MRN 12345) 2016-03-15
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.coding[0].code, "image") - self.assertEqual(inst.type.coding[0].display, "Image") - self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/media-type") - self.assertEqual(inst.width, 126) + self.assertEqual(inst.width, 640) def testMedia2(self): inst = self.instantiate_from("media-example-dicom.json") @@ -97,7 +97,7 @@ def implMedia2(self, inst): self.assertEqual(inst.width, 640) def testMedia3(self): - inst = self.instantiate_from("media-example-xray.json") + inst = self.instantiate_from("media-example.json") self.assertIsNotNone(inst, "Must have instantiated a Media instance") self.implMedia3(inst) @@ -107,28 +107,28 @@ def testMedia3(self): self.implMedia3(inst2) def implMedia3(self, inst): - self.assertEqual(inst.bodySite.coding[0].code, "85151006") - self.assertEqual(inst.bodySite.coding[0].display, "Structure of left hand (body structure)") - self.assertEqual(inst.bodySite.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.content.contentType, "image/jpeg") - self.assertEqual(inst.content.creation.date, FHIRDate("2016-03-15").date) - self.assertEqual(inst.content.creation.as_json(), "2016-03-15") + self.assertEqual(inst.content.contentType, "image/gif") + self.assertEqual(inst.content.creation.date, FHIRDate("2009-09-03").date) + self.assertEqual(inst.content.creation.as_json(), "2009-09-03") self.assertEqual(inst.content.id, "a1") - self.assertEqual(inst.content.url, "http://someimagingcenter.org/fhir/Binary/A12345") - self.assertEqual(inst.createdDateTime.date, FHIRDate("2016-03-15").date) - self.assertEqual(inst.createdDateTime.as_json(), "2016-03-15") - self.assertEqual(inst.height, 432) - self.assertEqual(inst.id, "xray") + self.assertEqual(inst.createdDateTime.date, FHIRDate("2017-12-17").date) + self.assertEqual(inst.createdDateTime.as_json(), "2017-12-17") + self.assertEqual(inst.frames, 1) + self.assertEqual(inst.height, 145) + self.assertEqual(inst.id, "example") + self.assertEqual(inst.issued.date, FHIRDate("2017-12-17T14:56:18Z").date) + self.assertEqual(inst.issued.as_json(), "2017-12-17T14:56:18Z") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.modality.coding[0].code, "39714003") - self.assertEqual(inst.modality.coding[0].display, "Skeletal X-ray of wrist and hand") - self.assertEqual(inst.modality.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.modality.coding[0].code, "diagram") + self.assertEqual(inst.modality.coding[0].system, "http://terminology.hl7.org/CodeSystem/media-modality") self.assertEqual(inst.status, "completed") - self.assertEqual(inst.text.div, "
Xray of left hand for Patient Henry Levin (MRN 12345) 2016-03-15
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.width, 640) + self.assertEqual(inst.type.coding[0].code, "image") + self.assertEqual(inst.type.coding[0].display, "Image") + self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/media-type") + self.assertEqual(inst.width, 126) def testMedia4(self): inst = self.instantiate_from("media-example-sound.json") diff --git a/fhirclient/models/medication.py b/fhirclient/models/medication.py index f32dead97..3c3137726 100644 --- a/fhirclient/models/medication.py +++ b/fhirclient/models/medication.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Medication) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Medication) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicationadministration.py b/fhirclient/models/medicationadministration.py index 8543c5611..93ac64f7f 100644 --- a/fhirclient/models/medicationadministration.py +++ b/fhirclient/models/medicationadministration.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicationAdministration) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicationAdministration) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicationdispense.py b/fhirclient/models/medicationdispense.py index b9b43753a..ddaa73c1d 100644 --- a/fhirclient/models/medicationdispense.py +++ b/fhirclient/models/medicationdispense.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicationDispense) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicationDispense) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -98,7 +98,7 @@ def __init__(self, jsondict=None, strict=True): self.status = None """ preparation | in-progress | cancelled | on-hold | completed | - entered-in-error | stopped | unknown. + entered-in-error | stopped | declined | unknown. Type `str`. """ self.statusReasonCodeableConcept = None diff --git a/fhirclient/models/medicationknowledge.py b/fhirclient/models/medicationknowledge.py index 9b6d37d24..93311c839 100644 --- a/fhirclient/models/medicationknowledge.py +++ b/fhirclient/models/medicationknowledge.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicationKnowledge) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicationKnowledge) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicationknowledge_tests.py b/fhirclient/models/medicationknowledge_tests.py index f591dc6d9..42a9727ff 100644 --- a/fhirclient/models/medicationknowledge_tests.py +++ b/fhirclient/models/medicationknowledge_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/medicationrequest.py b/fhirclient/models/medicationrequest.py index dd2889576..004d95c64 100644 --- a/fhirclient/models/medicationrequest.py +++ b/fhirclient/models/medicationrequest.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicationRequest) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicationRequest) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -89,7 +89,8 @@ def __init__(self, jsondict=None, strict=True): List of `FHIRReference` items (represented as `dict` in JSON). """ self.intent = None - """ proposal | plan | order | original-order | instance-order | option. + """ proposal | plan | order | original-order | reflex-order | filler- + order | instance-order | option. Type `str`. """ self.medicationCodeableConcept = None diff --git a/fhirclient/models/medicationstatement.py b/fhirclient/models/medicationstatement.py index 91ff6aead..793945c89 100644 --- a/fhirclient/models/medicationstatement.py +++ b/fhirclient/models/medicationstatement.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicationStatement) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicationStatement) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproduct.py b/fhirclient/models/medicinalproduct.py index 4c80f4132..df0e5dffa 100644 --- a/fhirclient/models/medicinalproduct.py +++ b/fhirclient/models/medicinalproduct.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicinalProduct) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProduct) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproduct_tests.py b/fhirclient/models/medicinalproduct_tests.py index 44ad5b778..4f33a322c 100644 --- a/fhirclient/models/medicinalproduct_tests.py +++ b/fhirclient/models/medicinalproduct_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/medicinalproductauthorization.py b/fhirclient/models/medicinalproductauthorization.py index 00c892210..d76bdd248 100644 --- a/fhirclient/models/medicinalproductauthorization.py +++ b/fhirclient/models/medicinalproductauthorization.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicinalProductAuthorization) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductAuthorization) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductauthorization_tests.py b/fhirclient/models/medicinalproductauthorization_tests.py index 06bfbe368..46057d911 100644 --- a/fhirclient/models/medicinalproductauthorization_tests.py +++ b/fhirclient/models/medicinalproductauthorization_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/medicinalproductcontraindication.py b/fhirclient/models/medicinalproductcontraindication.py index 6cb443b4a..e16b71025 100644 --- a/fhirclient/models/medicinalproductcontraindication.py +++ b/fhirclient/models/medicinalproductcontraindication.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicinalProductContraindication) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductContraindication) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductcontraindication_tests.py b/fhirclient/models/medicinalproductcontraindication_tests.py index 35880578a..bdd5d39c5 100644 --- a/fhirclient/models/medicinalproductcontraindication_tests.py +++ b/fhirclient/models/medicinalproductcontraindication_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/medicinalproductindication.py b/fhirclient/models/medicinalproductindication.py index 39b04a03b..8069a6fc8 100644 --- a/fhirclient/models/medicinalproductindication.py +++ b/fhirclient/models/medicinalproductindication.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicinalProductIndication) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductIndication) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductindication_tests.py b/fhirclient/models/medicinalproductindication_tests.py index 7fdccd884..9bf94fbb6 100644 --- a/fhirclient/models/medicinalproductindication_tests.py +++ b/fhirclient/models/medicinalproductindication_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/medicinalproductingredient.py b/fhirclient/models/medicinalproductingredient.py index 109b408fc..0958acb6e 100644 --- a/fhirclient/models/medicinalproductingredient.py +++ b/fhirclient/models/medicinalproductingredient.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicinalProductIngredient) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductIngredient) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductingredient_tests.py b/fhirclient/models/medicinalproductingredient_tests.py index 0d12ce536..c5cf1024c 100644 --- a/fhirclient/models/medicinalproductingredient_tests.py +++ b/fhirclient/models/medicinalproductingredient_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/medicinalproductinteraction.py b/fhirclient/models/medicinalproductinteraction.py index 7509dc063..b0c0dedca 100644 --- a/fhirclient/models/medicinalproductinteraction.py +++ b/fhirclient/models/medicinalproductinteraction.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicinalProductInteraction) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductInteraction) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductinteraction_tests.py b/fhirclient/models/medicinalproductinteraction_tests.py index 5b588b398..aad895136 100644 --- a/fhirclient/models/medicinalproductinteraction_tests.py +++ b/fhirclient/models/medicinalproductinteraction_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/medicinalproductmanufactured.py b/fhirclient/models/medicinalproductmanufactured.py index 7c41b0165..cc884e5ff 100644 --- a/fhirclient/models/medicinalproductmanufactured.py +++ b/fhirclient/models/medicinalproductmanufactured.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicinalProductManufactured) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductManufactured) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductmanufactured_tests.py b/fhirclient/models/medicinalproductmanufactured_tests.py index af54dfd0b..6dae02d82 100644 --- a/fhirclient/models/medicinalproductmanufactured_tests.py +++ b/fhirclient/models/medicinalproductmanufactured_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/medicinalproductpackaged.py b/fhirclient/models/medicinalproductpackaged.py index 3af1de8a1..3216a35a4 100644 --- a/fhirclient/models/medicinalproductpackaged.py +++ b/fhirclient/models/medicinalproductpackaged.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicinalProductPackaged) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductPackaged) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductpackaged_tests.py b/fhirclient/models/medicinalproductpackaged_tests.py index 4fa5bf77e..0884cfe1d 100644 --- a/fhirclient/models/medicinalproductpackaged_tests.py +++ b/fhirclient/models/medicinalproductpackaged_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/medicinalproductpharmaceutical.py b/fhirclient/models/medicinalproductpharmaceutical.py index b4f9363d0..0cc7544a9 100644 --- a/fhirclient/models/medicinalproductpharmaceutical.py +++ b/fhirclient/models/medicinalproductpharmaceutical.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicinalProductPharmaceutical) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductPharmaceutical) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductpharmaceutical_tests.py b/fhirclient/models/medicinalproductpharmaceutical_tests.py index 1d7376a7f..568a94bef 100644 --- a/fhirclient/models/medicinalproductpharmaceutical_tests.py +++ b/fhirclient/models/medicinalproductpharmaceutical_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/medicinalproductundesirableeffect.py b/fhirclient/models/medicinalproductundesirableeffect.py index 6b9b8119d..ba7c57e66 100644 --- a/fhirclient/models/medicinalproductundesirableeffect.py +++ b/fhirclient/models/medicinalproductundesirableeffect.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MedicinalProductUndesirableEffect) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductUndesirableEffect) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductundesirableeffect_tests.py b/fhirclient/models/medicinalproductundesirableeffect_tests.py index 018715ea0..92254a7c9 100644 --- a/fhirclient/models/medicinalproductundesirableeffect_tests.py +++ b/fhirclient/models/medicinalproductundesirableeffect_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/messagedefinition.py b/fhirclient/models/messagedefinition.py index 965528a11..cbfc5f53b 100644 --- a/fhirclient/models/messagedefinition.py +++ b/fhirclient/models/messagedefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MessageDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MessageDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/messagedefinition_tests.py b/fhirclient/models/messagedefinition_tests.py index ac42936ad..287751133 100644 --- a/fhirclient/models/messagedefinition_tests.py +++ b/fhirclient/models/messagedefinition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/messageheader.py b/fhirclient/models/messageheader.py index 9940371c5..8bbef6ec7 100644 --- a/fhirclient/models/messageheader.py +++ b/fhirclient/models/messageheader.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MessageHeader) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MessageHeader) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/messageheader_tests.py b/fhirclient/models/messageheader_tests.py index f16e4d6e5..a7d39f99c 100644 --- a/fhirclient/models/messageheader_tests.py +++ b/fhirclient/models/messageheader_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/meta.py b/fhirclient/models/meta.py index dcad7467c..33fa0790a 100644 --- a/fhirclient/models/meta.py +++ b/fhirclient/models/meta.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Meta) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Meta) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/metadataresource.py b/fhirclient/models/metadataresource.py index 174f94fb1..b2a25e8d5 100644 --- a/fhirclient/models/metadataresource.py +++ b/fhirclient/models/metadataresource.py @@ -1,13 +1,11 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MetadataResource) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MetadataResource) on 2024-07-15. +# 2024, SMART Health IT. -from . import domainresource - -class MetadataResource(domainresource.DomainResource): +class MetadataResource(object): """ Common Ancestor declaration for definitional resources. Common Ancestor declaration for conformance and knowledge artifact diff --git a/fhirclient/models/molecularsequence.py b/fhirclient/models/molecularsequence.py index f881a1d06..a58e5ae4b 100644 --- a/fhirclient/models/molecularsequence.py +++ b/fhirclient/models/molecularsequence.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MolecularSequence) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MolecularSequence) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/molecularsequence_tests.py b/fhirclient/models/molecularsequence_tests.py index 49da9068b..a16c79897 100644 --- a/fhirclient/models/molecularsequence_tests.py +++ b/fhirclient/models/molecularsequence_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return molecularsequence.MolecularSequence(js) def testMolecularSequence1(self): - inst = self.instantiate_from("sequence-genetics-example-breastcancer.json") + inst = self.instantiate_from("sequence-graphic-example-2.json") self.assertIsNotNone(inst, "Must have instantiated a MolecularSequence instance") self.implMolecularSequence1(inst) @@ -33,24 +33,19 @@ def testMolecularSequence1(self): def implMolecularSequence1(self, inst): self.assertEqual(inst.coordinateSystem, 0) - self.assertEqual(inst.id, "breastcancer") + self.assertEqual(inst.id, "graphic-example-2") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].code, "NM_000059.3") - self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].display, "Homo sapiens BRCA2, DNA repair associated (BRCA2), mRNA") - self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].system, "http://www.ncbi.nlm.nih.gov/nuccore/") - self.assertEqual(inst.referenceSeq.windowEnd, 101499444) - self.assertEqual(inst.referenceSeq.windowStart, 101488058) + self.assertEqual(inst.referenceSeq.referenceSeqString, "CGCCATTG") + self.assertEqual(inst.referenceSeq.strand, "watson") + self.assertEqual(inst.referenceSeq.windowEnd, 8) + self.assertEqual(inst.referenceSeq.windowStart, 0) self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type, "rna") - self.assertEqual(inst.variant[0].end, 32316187) - self.assertEqual(inst.variant[0].observedAllele, "A") - self.assertEqual(inst.variant[0].referenceAllele, "C") - self.assertEqual(inst.variant[0].start, 32316186) + self.assertEqual(inst.type, "dna") def testMolecularSequence2(self): - inst = self.instantiate_from("sequence-graphic-example-1.json") + inst = self.instantiate_from("sequence-genetics-example-breastcancer.json") self.assertIsNotNone(inst, "Must have instantiated a MolecularSequence instance") self.implMolecularSequence2(inst) @@ -61,25 +56,24 @@ def testMolecularSequence2(self): def implMolecularSequence2(self, inst): self.assertEqual(inst.coordinateSystem, 0) - self.assertEqual(inst.id, "graphic-example-1") + self.assertEqual(inst.id, "breastcancer") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].code, "NC_000002.12") - self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].system, "http://www.ncbi.nlm.nih.gov/nuccore") - self.assertEqual(inst.referenceSeq.strand, "watson") - self.assertEqual(inst.referenceSeq.windowEnd, 128273732) - self.assertEqual(inst.referenceSeq.windowStart, 128273724) + self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].code, "NM_000059.3") + self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].display, "Homo sapiens BRCA2, DNA repair associated (BRCA2), mRNA") + self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].system, "http://www.ncbi.nlm.nih.gov/nuccore/") + self.assertEqual(inst.referenceSeq.windowEnd, 101499444) + self.assertEqual(inst.referenceSeq.windowStart, 101488058) self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type, "dna") - self.assertEqual(inst.variant[0].cigar, "1M") - self.assertEqual(inst.variant[0].end, 128273726) - self.assertEqual(inst.variant[0].observedAllele, "G") - self.assertEqual(inst.variant[0].referenceAllele, "T") - self.assertEqual(inst.variant[0].start, 128273725) + self.assertEqual(inst.type, "rna") + self.assertEqual(inst.variant[0].end, 32316187) + self.assertEqual(inst.variant[0].observedAllele, "A") + self.assertEqual(inst.variant[0].referenceAllele, "C") + self.assertEqual(inst.variant[0].start, 32316186) def testMolecularSequence3(self): - inst = self.instantiate_from("sequence-example-fda-vcfeval.json") + inst = self.instantiate_from("sequence-graphic-example-5.json") self.assertIsNotNone(inst, "Must have instantiated a MolecularSequence instance") self.implMolecularSequence3(inst) @@ -89,55 +83,21 @@ def testMolecularSequence3(self): self.implMolecularSequence3(inst2) def implMolecularSequence3(self, inst): - self.assertEqual(inst.coordinateSystem, 1) - self.assertEqual(inst.id, "fda-vcfeval-comparison") + self.assertEqual(inst.coordinateSystem, 0) + self.assertEqual(inst.id, "graphic-example-5") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.quality[0].end, 101770080) - self.assertEqual(inst.quality[0].gtFP, 2186) - self.assertEqual(inst.quality[0].method.coding[0].code, "app-BxfGF8j02pBZzZxbzZxP725P") - self.assertEqual(inst.quality[0].method.coding[0].system, "https://precision.fda.gov/apps/") - self.assertEqual(inst.quality[0].method.text, "Vcfeval + Hap.py Comparison") - self.assertEqual(inst.quality[0].precision, 0.428005) - self.assertEqual(inst.quality[0].queryFP, 10670) - self.assertEqual(inst.quality[0].recall, 0.752111) - self.assertEqual(inst.quality[0].standardSequence.coding[0].code, "file-BkZxBZ00bpJVk2q6x43b1YBx") - self.assertEqual(inst.quality[0].standardSequence.coding[0].system, "https://precision.fda.gov/files/") - self.assertEqual(inst.quality[0].start, 10453) - self.assertEqual(inst.quality[0].truthFN, 2554) - self.assertEqual(inst.quality[0].truthTP, 7749) - self.assertEqual(inst.quality[0].type, "indel") - self.assertEqual(inst.quality[1].end, 101770080) - self.assertEqual(inst.quality[1].gtFP, 493) - self.assertEqual(inst.quality[1].method.coding[0].code, "app-BxfGF8j02pBZzZxbzZxP725P") - self.assertEqual(inst.quality[1].method.coding[0].system, "https://precision.fda.gov/apps/") - self.assertEqual(inst.quality[1].method.text, "Vcfeval + Hap.py Comparison") - self.assertEqual(inst.quality[1].precision, 0.808602) - self.assertEqual(inst.quality[1].queryFP, 21744) - self.assertEqual(inst.quality[1].recall, 0.986642) - self.assertEqual(inst.quality[1].standardSequence.coding[0].code, "file-BkZxBZ00bpJVk2q6x43b1YBx") - self.assertEqual(inst.quality[1].standardSequence.coding[0].system, "https://precision.fda.gov/files/") - self.assertEqual(inst.quality[1].start, 10453) - self.assertEqual(inst.quality[1].truthFN, 1247) - self.assertEqual(inst.quality[1].truthTP, 92106) - self.assertEqual(inst.quality[1].type, "snp") - self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].code, "NC_000001.11") + self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].code, "NC_000002.12") self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].system, "http://www.ncbi.nlm.nih.gov/nuccore") self.assertEqual(inst.referenceSeq.strand, "watson") - self.assertEqual(inst.referenceSeq.windowEnd, 101770080) - self.assertEqual(inst.referenceSeq.windowStart, 10453) - self.assertEqual(inst.repository[0].name, "FDA") - self.assertEqual(inst.repository[0].type, "login") - self.assertEqual(inst.repository[0].url, "https://precision.fda.gov/jobs/job-ByxYPx809jFVy21KJG74Jg3Y") + self.assertEqual(inst.referenceSeq.windowEnd, 128273736) + self.assertEqual(inst.referenceSeq.windowStart, 128273732) self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.variant[0].end, 13117) - self.assertEqual(inst.variant[0].observedAllele, "T") - self.assertEqual(inst.variant[0].referenceAllele, "G") - self.assertEqual(inst.variant[0].start, 13116) + self.assertEqual(inst.type, "dna") def testMolecularSequence4(self): - inst = self.instantiate_from("sequence-example-TPMT-one.json") + inst = self.instantiate_from("sequence-graphic-example-3.json") self.assertIsNotNone(inst, "Must have instantiated a MolecularSequence instance") self.implMolecularSequence4(inst) @@ -147,26 +107,24 @@ def testMolecularSequence4(self): self.implMolecularSequence4(inst2) def implMolecularSequence4(self, inst): - self.assertEqual(inst.coordinateSystem, 1) - self.assertEqual(inst.id, "example-TPMT-one") + self.assertEqual(inst.coordinateSystem, 0) + self.assertEqual(inst.id, "graphic-example-3") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.observedSeq, "T-C-C-C-A-C-C-C") - self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].code, "NT_007592.15") - self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].system, "http://www.ncbi.nlm.nih.gov/nuccore") self.assertEqual(inst.referenceSeq.strand, "watson") - self.assertEqual(inst.referenceSeq.windowEnd, 18143955) - self.assertEqual(inst.referenceSeq.windowStart, 18130918) + self.assertEqual(inst.referenceSeq.windowEnd, 128273736) + self.assertEqual(inst.referenceSeq.windowStart, 128273732) self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type, "dna") - self.assertEqual(inst.variant[0].end, 18139214) - self.assertEqual(inst.variant[0].observedAllele, "A") - self.assertEqual(inst.variant[0].referenceAllele, "G") - self.assertEqual(inst.variant[0].start, 18139214) + self.assertEqual(inst.variant[0].cigar, "2M") + self.assertEqual(inst.variant[0].end, 128273736) + self.assertEqual(inst.variant[0].observedAllele, "GA") + self.assertEqual(inst.variant[0].referenceAllele, "AT") + self.assertEqual(inst.variant[0].start, 1282737234) def testMolecularSequence5(self): - inst = self.instantiate_from("sequence-example-pgx-2.json") + inst = self.instantiate_from("coord-1base-example.json") self.assertIsNotNone(inst, "Must have instantiated a MolecularSequence instance") self.implMolecularSequence5(inst) @@ -176,26 +134,36 @@ def testMolecularSequence5(self): self.implMolecularSequence5(inst2) def implMolecularSequence5(self, inst): - self.assertEqual(inst.coordinateSystem, 0) - self.assertEqual(inst.id, "example-pgx-2") + self.assertEqual(inst.coordinateSystem, 1) + self.assertEqual(inst.id, "coord-1-base") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.referenceSeq.orientation, "sense") - self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].code, "NG_007726.3") - self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].system, "http://www.ncbi.nlm.nih.gov/nuccore") + self.assertEqual(inst.observedSeq, "ACATGGTAGC") + self.assertEqual(inst.referenceSeq.referenceSeqString, "ACGTAGTC") self.assertEqual(inst.referenceSeq.strand, "watson") - self.assertEqual(inst.referenceSeq.windowEnd, 55227980) - self.assertEqual(inst.referenceSeq.windowStart, 55227970) + self.assertEqual(inst.referenceSeq.windowEnd, 8) + self.assertEqual(inst.referenceSeq.windowStart, 1) self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type, "dna") - self.assertEqual(inst.variant[0].end, 55227979) - self.assertEqual(inst.variant[0].observedAllele, "G") - self.assertEqual(inst.variant[0].referenceAllele, "T") - self.assertEqual(inst.variant[0].start, 55227978) + self.assertEqual(inst.variant[0].cigar, "3I") + self.assertEqual(inst.variant[0].end, 3) + self.assertEqual(inst.variant[0].observedAllele, "ATG") + self.assertEqual(inst.variant[0].referenceAllele, "-") + self.assertEqual(inst.variant[0].start, 2) + self.assertEqual(inst.variant[1].cigar, "3I") + self.assertEqual(inst.variant[1].end, 5) + self.assertEqual(inst.variant[1].observedAllele, "T") + self.assertEqual(inst.variant[1].referenceAllele, "A") + self.assertEqual(inst.variant[1].start, 5) + self.assertEqual(inst.variant[2].cigar, "1D") + self.assertEqual(inst.variant[2].end, 7) + self.assertEqual(inst.variant[2].observedAllele, "-") + self.assertEqual(inst.variant[2].referenceAllele, "T") + self.assertEqual(inst.variant[2].start, 7) def testMolecularSequence6(self): - inst = self.instantiate_from("molecularsequence-example.json") + inst = self.instantiate_from("sequence-graphic-example-4.json") self.assertIsNotNone(inst, "Must have instantiated a MolecularSequence instance") self.implMolecularSequence6(inst) @@ -206,28 +174,22 @@ def testMolecularSequence6(self): def implMolecularSequence6(self, inst): self.assertEqual(inst.coordinateSystem, 0) - self.assertEqual(inst.id, "example") + self.assertEqual(inst.id, "graphic-example-4") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].code, "NC_000009.11") - self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].system, "http://www.ncbi.nlm.nih.gov/nuccore") + self.assertEqual(inst.referenceSeq.chromosome.coding[0].code, "2") + self.assertEqual(inst.referenceSeq.chromosome.coding[0].display, "chromosome 2") + self.assertEqual(inst.referenceSeq.chromosome.coding[0].system, "http://terminology.hl7.org/CodeSystem/chromosome-human") + self.assertEqual(inst.referenceSeq.genomeBuild, "GRCh 38") self.assertEqual(inst.referenceSeq.strand, "watson") - self.assertEqual(inst.referenceSeq.windowEnd, 22125510) - self.assertEqual(inst.referenceSeq.windowStart, 22125500) - self.assertEqual(inst.repository[0].name, "GA4GH API") - self.assertEqual(inst.repository[0].type, "openapi") - self.assertEqual(inst.repository[0].url, "http://grch37.rest.ensembl.org/ga4gh/variants/3:rs1333049?content-type=application/json") - self.assertEqual(inst.repository[0].variantsetId, "3:rs1333049") + self.assertEqual(inst.referenceSeq.windowEnd, 128273740) + self.assertEqual(inst.referenceSeq.windowStart, 128273736) self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type, "dna") - self.assertEqual(inst.variant[0].end, 22125504) - self.assertEqual(inst.variant[0].observedAllele, "C") - self.assertEqual(inst.variant[0].referenceAllele, "G") - self.assertEqual(inst.variant[0].start, 22125503) def testMolecularSequence7(self): - inst = self.instantiate_from("sequence-example-fda.json") + inst = self.instantiate_from("sequence-example-TPMT-one.json") self.assertIsNotNone(inst, "Must have instantiated a MolecularSequence instance") self.implMolecularSequence7(inst) @@ -238,44 +200,25 @@ def testMolecularSequence7(self): def implMolecularSequence7(self, inst): self.assertEqual(inst.coordinateSystem, 1) - self.assertEqual(inst.id, "fda-example") + self.assertEqual(inst.id, "example-TPMT-one") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.quality[0].end, 101770080) - self.assertEqual(inst.quality[0].fScore, 0.545551) - self.assertEqual(inst.quality[0].gtFP, 2186) - self.assertEqual(inst.quality[0].method.coding[0].code, "job-ByxYPx809jFVy21KJG74Jg3Y") - self.assertEqual(inst.quality[0].method.coding[0].system, "https://precision.fda.gov/jobs/") - self.assertEqual(inst.quality[0].method.text, "Vcfeval + Hap.py Comparison") - self.assertEqual(inst.quality[0].precision, 0.428005) - self.assertEqual(inst.quality[0].queryFP, 10670) - self.assertEqual(inst.quality[0].queryTP, 7984) - self.assertEqual(inst.quality[0].recall, 0.752111) - self.assertEqual(inst.quality[0].standardSequence.coding[0].code, "file-Bk50V4Q0qVb65P0v2VPbfYPZ") - self.assertEqual(inst.quality[0].standardSequence.coding[0].system, "https://precision.fda.gov/files/") - self.assertEqual(inst.quality[0].start, 10453) - self.assertEqual(inst.quality[0].truthFN, 2554) - self.assertEqual(inst.quality[0].truthTP, 7749) - self.assertEqual(inst.quality[0].type, "snp") - self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].code, "NC_000001.11") + self.assertEqual(inst.observedSeq, "T-C-C-C-A-C-C-C") + self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].code, "NT_007592.15") self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].system, "http://www.ncbi.nlm.nih.gov/nuccore") self.assertEqual(inst.referenceSeq.strand, "watson") - self.assertEqual(inst.referenceSeq.windowEnd, 101770080) - self.assertEqual(inst.referenceSeq.windowStart, 10453) - self.assertEqual(inst.repository[0].name, "FDA") - self.assertEqual(inst.repository[0].type, "login") - self.assertEqual(inst.repository[0].url, "https://precision.fda.gov/files/file-Bx37ZK009P4bX5g3qjkFZV38") - self.assertEqual(inst.repository[0].variantsetId, "file-Bx37ZK009P4bX5g3qjkFZV38") + self.assertEqual(inst.referenceSeq.windowEnd, 18143955) + self.assertEqual(inst.referenceSeq.windowStart, 18130918) self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type, "dna") - self.assertEqual(inst.variant[0].end, 13117) - self.assertEqual(inst.variant[0].observedAllele, "T") + self.assertEqual(inst.variant[0].end, 18139214) + self.assertEqual(inst.variant[0].observedAllele, "A") self.assertEqual(inst.variant[0].referenceAllele, "G") - self.assertEqual(inst.variant[0].start, 13116) + self.assertEqual(inst.variant[0].start, 18139214) def testMolecularSequence8(self): - inst = self.instantiate_from("coord-1base-example.json") + inst = self.instantiate_from("sequence-graphic-example-1.json") self.assertIsNotNone(inst, "Must have instantiated a MolecularSequence instance") self.implMolecularSequence8(inst) @@ -285,36 +228,26 @@ def testMolecularSequence8(self): self.implMolecularSequence8(inst2) def implMolecularSequence8(self, inst): - self.assertEqual(inst.coordinateSystem, 1) - self.assertEqual(inst.id, "coord-1-base") + self.assertEqual(inst.coordinateSystem, 0) + self.assertEqual(inst.id, "graphic-example-1") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.observedSeq, "ACATGGTAGC") - self.assertEqual(inst.referenceSeq.referenceSeqString, "ACGTAGTC") + self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].code, "NC_000002.12") + self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].system, "http://www.ncbi.nlm.nih.gov/nuccore") self.assertEqual(inst.referenceSeq.strand, "watson") - self.assertEqual(inst.referenceSeq.windowEnd, 8) - self.assertEqual(inst.referenceSeq.windowStart, 1) + self.assertEqual(inst.referenceSeq.windowEnd, 128273732) + self.assertEqual(inst.referenceSeq.windowStart, 128273724) self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type, "dna") - self.assertEqual(inst.variant[0].cigar, "3I") - self.assertEqual(inst.variant[0].end, 3) - self.assertEqual(inst.variant[0].observedAllele, "ATG") - self.assertEqual(inst.variant[0].referenceAllele, "-") - self.assertEqual(inst.variant[0].start, 2) - self.assertEqual(inst.variant[1].cigar, "3I") - self.assertEqual(inst.variant[1].end, 5) - self.assertEqual(inst.variant[1].observedAllele, "T") - self.assertEqual(inst.variant[1].referenceAllele, "A") - self.assertEqual(inst.variant[1].start, 5) - self.assertEqual(inst.variant[2].cigar, "1D") - self.assertEqual(inst.variant[2].end, 7) - self.assertEqual(inst.variant[2].observedAllele, "-") - self.assertEqual(inst.variant[2].referenceAllele, "T") - self.assertEqual(inst.variant[2].start, 7) + self.assertEqual(inst.variant[0].cigar, "1M") + self.assertEqual(inst.variant[0].end, 128273726) + self.assertEqual(inst.variant[0].observedAllele, "G") + self.assertEqual(inst.variant[0].referenceAllele, "T") + self.assertEqual(inst.variant[0].start, 128273725) def testMolecularSequence9(self): - inst = self.instantiate_from("sequence-graphic-example-4.json") + inst = self.instantiate_from("sequence-example-fda.json") self.assertIsNotNone(inst, "Must have instantiated a MolecularSequence instance") self.implMolecularSequence9(inst) @@ -324,23 +257,45 @@ def testMolecularSequence9(self): self.implMolecularSequence9(inst2) def implMolecularSequence9(self, inst): - self.assertEqual(inst.coordinateSystem, 0) - self.assertEqual(inst.id, "graphic-example-4") + self.assertEqual(inst.coordinateSystem, 1) + self.assertEqual(inst.id, "fda-example") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.referenceSeq.chromosome.coding[0].code, "2") - self.assertEqual(inst.referenceSeq.chromosome.coding[0].display, "chromosome 2") - self.assertEqual(inst.referenceSeq.chromosome.coding[0].system, "http://terminology.hl7.org/CodeSystem/chromosome-human") - self.assertEqual(inst.referenceSeq.genomeBuild, "GRCh 38") + self.assertEqual(inst.quality[0].end, 101770080) + self.assertEqual(inst.quality[0].fScore, 0.545551) + self.assertEqual(inst.quality[0].gtFP, 2186) + self.assertEqual(inst.quality[0].method.coding[0].code, "job-ByxYPx809jFVy21KJG74Jg3Y") + self.assertEqual(inst.quality[0].method.coding[0].system, "https://precision.fda.gov/jobs/") + self.assertEqual(inst.quality[0].method.text, "Vcfeval + Hap.py Comparison") + self.assertEqual(inst.quality[0].precision, 0.428005) + self.assertEqual(inst.quality[0].queryFP, 10670) + self.assertEqual(inst.quality[0].queryTP, 7984) + self.assertEqual(inst.quality[0].recall, 0.752111) + self.assertEqual(inst.quality[0].standardSequence.coding[0].code, "file-Bk50V4Q0qVb65P0v2VPbfYPZ") + self.assertEqual(inst.quality[0].standardSequence.coding[0].system, "https://precision.fda.gov/files/") + self.assertEqual(inst.quality[0].start, 10453) + self.assertEqual(inst.quality[0].truthFN, 2554) + self.assertEqual(inst.quality[0].truthTP, 7749) + self.assertEqual(inst.quality[0].type, "snp") + self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].code, "NC_000001.11") + self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].system, "http://www.ncbi.nlm.nih.gov/nuccore") self.assertEqual(inst.referenceSeq.strand, "watson") - self.assertEqual(inst.referenceSeq.windowEnd, 128273740) - self.assertEqual(inst.referenceSeq.windowStart, 128273736) + self.assertEqual(inst.referenceSeq.windowEnd, 101770080) + self.assertEqual(inst.referenceSeq.windowStart, 10453) + self.assertEqual(inst.repository[0].name, "FDA") + self.assertEqual(inst.repository[0].type, "login") + self.assertEqual(inst.repository[0].url, "https://precision.fda.gov/files/file-Bx37ZK009P4bX5g3qjkFZV38") + self.assertEqual(inst.repository[0].variantsetId, "file-Bx37ZK009P4bX5g3qjkFZV38") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type, "dna") + self.assertEqual(inst.variant[0].end, 13117) + self.assertEqual(inst.variant[0].observedAllele, "T") + self.assertEqual(inst.variant[0].referenceAllele, "G") + self.assertEqual(inst.variant[0].start, 13116) def testMolecularSequence10(self): - inst = self.instantiate_from("sequence-graphic-example-5.json") + inst = self.instantiate_from("molecularsequence-example.json") self.assertIsNotNone(inst, "Must have instantiated a MolecularSequence instance") self.implMolecularSequence10(inst) @@ -351,15 +306,23 @@ def testMolecularSequence10(self): def implMolecularSequence10(self, inst): self.assertEqual(inst.coordinateSystem, 0) - self.assertEqual(inst.id, "graphic-example-5") + self.assertEqual(inst.id, "example") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].code, "NC_000002.12") + self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].code, "NC_000009.11") self.assertEqual(inst.referenceSeq.referenceSeqId.coding[0].system, "http://www.ncbi.nlm.nih.gov/nuccore") self.assertEqual(inst.referenceSeq.strand, "watson") - self.assertEqual(inst.referenceSeq.windowEnd, 128273736) - self.assertEqual(inst.referenceSeq.windowStart, 128273732) + self.assertEqual(inst.referenceSeq.windowEnd, 22125510) + self.assertEqual(inst.referenceSeq.windowStart, 22125500) + self.assertEqual(inst.repository[0].name, "GA4GH API") + self.assertEqual(inst.repository[0].type, "openapi") + self.assertEqual(inst.repository[0].url, "http://grch37.rest.ensembl.org/ga4gh/variants/3:rs1333049?content-type=application/json") + self.assertEqual(inst.repository[0].variantsetId, "3:rs1333049") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type, "dna") + self.assertEqual(inst.variant[0].end, 22125504) + self.assertEqual(inst.variant[0].observedAllele, "C") + self.assertEqual(inst.variant[0].referenceAllele, "G") + self.assertEqual(inst.variant[0].start, 22125503) diff --git a/fhirclient/models/money.py b/fhirclient/models/money.py index 2d54db884..7967da5d8 100644 --- a/fhirclient/models/money.py +++ b/fhirclient/models/money.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Money) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Money) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/namingsystem.py b/fhirclient/models/namingsystem.py index 6f283ef77..ea51a590f 100644 --- a/fhirclient/models/namingsystem.py +++ b/fhirclient/models/namingsystem.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/NamingSystem) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/NamingSystem) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/namingsystem_tests.py b/fhirclient/models/namingsystem_tests.py index 378dc8154..4df87388d 100644 --- a/fhirclient/models/namingsystem_tests.py +++ b/fhirclient/models/namingsystem_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return namingsystem.NamingSystem(js) def testNamingSystem1(self): - inst = self.instantiate_from("namingsystem-example-id.json") + inst = self.instantiate_from("namingsystem-example.json") self.assertIsNotNone(inst, "Must have instantiated a NamingSystem instance") self.implNamingSystem1(inst) @@ -32,6 +32,38 @@ def testNamingSystem1(self): self.implNamingSystem1(inst2) def implNamingSystem1(self, inst): + self.assertEqual(inst.contact[0].name, "FHIR project team") + self.assertEqual(inst.contact[0].telecom[0].system, "url") + self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org/fhir") + self.assertEqual(inst.date.date, FHIRDate("2014-12-13").date) + self.assertEqual(inst.date.as_json(), "2014-12-13") + self.assertEqual(inst.id, "example") + self.assertEqual(inst.kind, "codesystem") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.name, "SNOMED CT") + self.assertEqual(inst.publisher, "HL7 International on behalf of IHTSDO") + self.assertEqual(inst.responsible, "IHTSDO & affiliates") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.uniqueId[0].type, "oid") + self.assertEqual(inst.uniqueId[0].value, "2.16.840.1.113883.6.96") + self.assertTrue(inst.uniqueId[1].preferred) + self.assertEqual(inst.uniqueId[1].type, "uri") + self.assertEqual(inst.uniqueId[1].value, "http://snomed.info/sct") + + def testNamingSystem2(self): + inst = self.instantiate_from("namingsystem-example-id.json") + self.assertIsNotNone(inst, "Must have instantiated a NamingSystem instance") + self.implNamingSystem2(inst) + + js = inst.as_json() + self.assertEqual("NamingSystem", js["resourceType"]) + inst2 = namingsystem.NamingSystem(js) + self.implNamingSystem2(inst2) + + def implNamingSystem2(self, inst): self.assertEqual(inst.contact[0].name, "HL7 Australia FHIR Team") self.assertEqual(inst.contact[0].telecom[0].system, "url") self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7-australia.wikispaces.com/FHIR+Australia") @@ -63,36 +95,4 @@ def implNamingSystem1(self, inst): self.assertEqual(inst.uniqueId[1].type, "uri") self.assertEqual(inst.uniqueId[1].value, "http://ns.electronichealth.net.au/id/hi/ihi/1.0") self.assertEqual(inst.usage, "Used in Australia for identifying patients") - - def testNamingSystem2(self): - inst = self.instantiate_from("namingsystem-example.json") - self.assertIsNotNone(inst, "Must have instantiated a NamingSystem instance") - self.implNamingSystem2(inst) - - js = inst.as_json() - self.assertEqual("NamingSystem", js["resourceType"]) - inst2 = namingsystem.NamingSystem(js) - self.implNamingSystem2(inst2) - - def implNamingSystem2(self, inst): - self.assertEqual(inst.contact[0].name, "FHIR project team") - self.assertEqual(inst.contact[0].telecom[0].system, "url") - self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org/fhir") - self.assertEqual(inst.date.date, FHIRDate("2014-12-13").date) - self.assertEqual(inst.date.as_json(), "2014-12-13") - self.assertEqual(inst.id, "example") - self.assertEqual(inst.kind, "codesystem") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "SNOMED CT") - self.assertEqual(inst.publisher, "HL7 International on behalf of IHTSDO") - self.assertEqual(inst.responsible, "IHTSDO & affiliates") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.uniqueId[0].type, "oid") - self.assertEqual(inst.uniqueId[0].value, "2.16.840.1.113883.6.96") - self.assertTrue(inst.uniqueId[1].preferred) - self.assertEqual(inst.uniqueId[1].type, "uri") - self.assertEqual(inst.uniqueId[1].value, "http://snomed.info/sct") diff --git a/fhirclient/models/narrative.py b/fhirclient/models/narrative.py index 6c19f60c6..dfa9d0506 100644 --- a/fhirclient/models/narrative.py +++ b/fhirclient/models/narrative.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Narrative) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Narrative) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/nutritionorder.py b/fhirclient/models/nutritionorder.py index 93d365623..2129b1895 100644 --- a/fhirclient/models/nutritionorder.py +++ b/fhirclient/models/nutritionorder.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/NutritionOrder) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/NutritionOrder) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -67,7 +67,8 @@ def __init__(self, jsondict=None, strict=True): List of `str` items. """ self.intent = None - """ proposal | plan | order. + """ proposal | plan | directive | order | original-order | reflex-order + | filler-order | instance-order | option. Type `str`. """ self.note = None @@ -87,8 +88,8 @@ def __init__(self, jsondict=None, strict=True): Type `FHIRReference` (represented as `dict` in JSON). """ self.status = None - """ proposed | draft | planned | requested | active | on-hold | - completed | cancelled | entered-in-error. + """ draft | active | on-hold | revoked | completed | entered-in-error | + unknown. Type `str`. """ self.supplement = None diff --git a/fhirclient/models/nutritionorder_tests.py b/fhirclient/models/nutritionorder_tests.py index 13c57493b..5fe7c29ea 100644 --- a/fhirclient/models/nutritionorder_tests.py +++ b/fhirclient/models/nutritionorder_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return nutritionorder.NutritionOrder(js) def testNutritionOrder1(self): - inst = self.instantiate_from("nutritionorder-example-diabeticsupplement.json") + inst = self.instantiate_from("nutritionorder-example-texture-modified.json") self.assertIsNotNone(inst, "Must have instantiated a NutritionOrder instance") self.implNutritionOrder1(inst) @@ -32,6 +32,49 @@ def testNutritionOrder1(self): self.implNutritionOrder1(inst2) def implNutritionOrder1(self, inst): + self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) + self.assertEqual(inst.dateTime.as_json(), "2014-09-17") + self.assertEqual(inst.id, "texturemodified") + self.assertEqual(inst.identifier[0].system, "http://goodhealthhospital.org/nutrition-requests") + self.assertEqual(inst.identifier[0].value, "123") + self.assertEqual(inst.intent, "order") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.oralDiet.schedule[0].repeat.boundsPeriod.start.date, FHIRDate("2015-02-10").date) + self.assertEqual(inst.oralDiet.schedule[0].repeat.boundsPeriod.start.as_json(), "2015-02-10") + self.assertEqual(inst.oralDiet.schedule[0].repeat.frequency, 3) + self.assertEqual(inst.oralDiet.schedule[0].repeat.period, 1) + self.assertEqual(inst.oralDiet.schedule[0].repeat.periodUnit, "d") + self.assertEqual(inst.oralDiet.texture[0].foodType.coding[0].code, "28647000") + self.assertEqual(inst.oralDiet.texture[0].foodType.coding[0].display, "Meat") + self.assertEqual(inst.oralDiet.texture[0].foodType.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.oralDiet.texture[0].foodType.text, "Regular, Chopped Meat") + self.assertEqual(inst.oralDiet.texture[0].modifier.coding[0].code, "228049004") + self.assertEqual(inst.oralDiet.texture[0].modifier.coding[0].display, "Chopped food") + self.assertEqual(inst.oralDiet.texture[0].modifier.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.oralDiet.texture[0].modifier.text, "Regular, Chopped Meat") + self.assertEqual(inst.oralDiet.type[0].coding[0].code, "435801000124108") + self.assertEqual(inst.oralDiet.type[0].coding[0].display, "Texture modified diet") + self.assertEqual(inst.oralDiet.type[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.oralDiet.type[0].coding[1].code, "1010") + self.assertEqual(inst.oralDiet.type[0].coding[1].display, "Texture modified diet") + self.assertEqual(inst.oralDiet.type[0].coding[1].system, "http://goodhealthhospital.org/diet-type-codes") + self.assertEqual(inst.oralDiet.type[0].text, "Texture modified diet") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.status, "generated") + + def testNutritionOrder2(self): + inst = self.instantiate_from("nutritionorder-example-diabeticsupplement.json") + self.assertIsNotNone(inst, "Must have instantiated a NutritionOrder instance") + self.implNutritionOrder2(inst) + + js = inst.as_json() + self.assertEqual("NutritionOrder", js["resourceType"]) + inst2 = nutritionorder.NutritionOrder(js) + self.implNutritionOrder2(inst2) + + def implNutritionOrder2(self, inst): self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) self.assertEqual(inst.dateTime.as_json(), "2014-09-17") self.assertEqual(inst.excludeFoodModifier[0].coding[0].code, "227493005") @@ -68,75 +111,114 @@ def implNutritionOrder1(self, inst): self.assertEqual(inst.supplement[0].type.text, "Adult diabetic formula") self.assertEqual(inst.text.status, "generated") - def testNutritionOrder2(self): - inst = self.instantiate_from("nutritionorder-example-enteralbolus.json") + def testNutritionOrder3(self): + inst = self.instantiate_from("nutritionorder-example-proteinsupplement.json") self.assertIsNotNone(inst, "Must have instantiated a NutritionOrder instance") - self.implNutritionOrder2(inst) + self.implNutritionOrder3(inst) js = inst.as_json() self.assertEqual("NutritionOrder", js["resourceType"]) inst2 = nutritionorder.NutritionOrder(js) - self.implNutritionOrder2(inst2) + self.implNutritionOrder3(inst2) - def implNutritionOrder2(self, inst): + def implNutritionOrder3(self, inst): + self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) + self.assertEqual(inst.dateTime.as_json(), "2014-09-17") + self.assertEqual(inst.id, "proteinsupplement") + self.assertEqual(inst.identifier[0].system, "http://goodhealthhospital.org/nutrition-requests") + self.assertEqual(inst.identifier[0].value, "123") + self.assertEqual(inst.intent, "order") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.supplement[0].instruction, "Beneprotein 1 scoop TID with meal.starting on 2015-02-10") + self.assertEqual(inst.supplement[0].productName, "Beneprotein") + self.assertEqual(inst.supplement[0].quantity.code, "{scoop}") + self.assertEqual(inst.supplement[0].quantity.system, "http://unitsofmeasure.org") + self.assertEqual(inst.supplement[0].quantity.unit, "scoop") + self.assertEqual(inst.supplement[0].quantity.value, 1) + self.assertEqual(inst.supplement[0].schedule[0].repeat.boundsPeriod.start.date, FHIRDate("2015-02-10").date) + self.assertEqual(inst.supplement[0].schedule[0].repeat.boundsPeriod.start.as_json(), "2015-02-10") + self.assertEqual(inst.supplement[0].schedule[0].repeat.when[0], "C") + self.assertEqual(inst.supplement[0].type.coding[0].code, "442991000124104") + self.assertEqual(inst.supplement[0].type.coding[0].display, "Adult high protein formula") + self.assertEqual(inst.supplement[0].type.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.supplement[0].type.coding[1].code, "1000") + self.assertEqual(inst.supplement[0].type.coding[1].display, "High Protein Powder") + self.assertEqual(inst.supplement[0].type.coding[1].system, "http://goodhealthhospital.org/supplement-type-codes") + self.assertEqual(inst.supplement[0].type.text, "High Protein Powder") + self.assertEqual(inst.text.status, "generated") + + def testNutritionOrder4(self): + inst = self.instantiate_from("nutritionorder-example-cardiacdiet.json") + self.assertIsNotNone(inst, "Must have instantiated a NutritionOrder instance") + self.implNutritionOrder4(inst) + + js = inst.as_json() + self.assertEqual("NutritionOrder", js["resourceType"]) + inst2 = nutritionorder.NutritionOrder(js) + self.implNutritionOrder4(inst2) + + def implNutritionOrder4(self, inst): self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) self.assertEqual(inst.dateTime.as_json(), "2014-09-17") - self.assertEqual(inst.enteralFormula.additiveProductName, "Acme Lipid Additive") - self.assertEqual(inst.enteralFormula.additiveType.coding[0].code, "lipid") - self.assertEqual(inst.enteralFormula.additiveType.coding[0].display, "Lipid") - self.assertEqual(inst.enteralFormula.additiveType.coding[0].system, "http://terminology.hl7.org/CodeSystem/entformula-additive") - self.assertEqual(inst.enteralFormula.administrationInstruction, "240 mls every 4hrs ") - self.assertEqual(inst.enteralFormula.administration[0].quantity.code, "mL") - self.assertEqual(inst.enteralFormula.administration[0].quantity.system, "http://unitsofmeasure.org") - self.assertEqual(inst.enteralFormula.administration[0].quantity.unit, "milliliters") - self.assertEqual(inst.enteralFormula.administration[0].quantity.value, 240) - self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.boundsPeriod.start.date, FHIRDate("2014-09-17T16:00:00Z").date) - self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.boundsPeriod.start.as_json(), "2014-09-17T16:00:00Z") - self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.frequency, 1) - self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.period, 4) - self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.periodUnit, "h") - self.assertEqual(inst.enteralFormula.baseFormulaProductName, "Acme High Protein Formula") - self.assertEqual(inst.enteralFormula.baseFormulaType.coding[0].code, "442991000124104") - self.assertEqual(inst.enteralFormula.baseFormulaType.coding[0].display, "Adult high protein formula") - self.assertEqual(inst.enteralFormula.baseFormulaType.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.enteralFormula.caloricDensity.code, "cal/mL") - self.assertEqual(inst.enteralFormula.caloricDensity.system, "http://unitsofmeasure.org") - self.assertEqual(inst.enteralFormula.caloricDensity.unit, "calories per milliliter") - self.assertEqual(inst.enteralFormula.caloricDensity.value, 1.5) - self.assertEqual(inst.enteralFormula.maxVolumeToDeliver.code, "mL/d") - self.assertEqual(inst.enteralFormula.maxVolumeToDeliver.system, "http://unitsofmeasure.org") - self.assertEqual(inst.enteralFormula.maxVolumeToDeliver.unit, "milliliter/day") - self.assertEqual(inst.enteralFormula.maxVolumeToDeliver.value, 1440) - self.assertEqual(inst.enteralFormula.routeofAdministration.coding[0].code, "GT") - self.assertEqual(inst.enteralFormula.routeofAdministration.coding[0].display, "Instillation, gastrostomy tube") - self.assertEqual(inst.enteralFormula.routeofAdministration.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration") self.assertEqual(inst.excludeFoodModifier[0].coding[0].code, "227493005") self.assertEqual(inst.excludeFoodModifier[0].coding[0].display, "Cashew Nut") self.assertEqual(inst.excludeFoodModifier[0].coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.excludeFoodModifier[0].coding[0].version, "20140730") self.assertEqual(inst.foodPreferenceModifier[0].coding[0].code, "dairy-free") self.assertEqual(inst.foodPreferenceModifier[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/diet") - self.assertEqual(inst.id, "enteralbolus") - self.assertEqual(inst.identifier[0].system, "http://www.acme.org/nutritionorders") + self.assertEqual(inst.id, "cardiacdiet") + self.assertEqual(inst.identifier[0].system, "http://goodhealthhospital.org/nutrition-requests") self.assertEqual(inst.identifier[0].value, "123") self.assertEqual(inst.intent, "order") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.oralDiet.instruction, "Starting on 2/10 breakfast, maximum 400 ml fluids per meal") + self.assertEqual(inst.oralDiet.nutrient[0].amount.code, "g") + self.assertEqual(inst.oralDiet.nutrient[0].amount.system, "http://unitsofmeasure.org") + self.assertEqual(inst.oralDiet.nutrient[0].amount.unit, "grams") + self.assertEqual(inst.oralDiet.nutrient[0].amount.value, 2) + self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].code, "39972003") + self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].display, "Sodium") + self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.oralDiet.nutrient[1].amount.code, "mL") + self.assertEqual(inst.oralDiet.nutrient[1].amount.system, "http://unitsofmeasure.org") + self.assertEqual(inst.oralDiet.nutrient[1].amount.unit, "milliliter") + self.assertEqual(inst.oralDiet.nutrient[1].amount.value, 1500) + self.assertEqual(inst.oralDiet.nutrient[1].modifier.coding[0].code, "33463005") + self.assertEqual(inst.oralDiet.nutrient[1].modifier.coding[0].display, "Fluid") + self.assertEqual(inst.oralDiet.nutrient[1].modifier.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.oralDiet.type[0].coding[0].code, "386619000") + self.assertEqual(inst.oralDiet.type[0].coding[0].display, "Low sodium diet") + self.assertEqual(inst.oralDiet.type[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.oralDiet.type[0].coding[1].code, "1040") + self.assertEqual(inst.oralDiet.type[0].coding[1].display, "Low Sodium Diet") + self.assertEqual(inst.oralDiet.type[0].coding[1].system, "http://goodhealthhospital.org/diet-type-codes") + self.assertEqual(inst.oralDiet.type[0].text, "Low sodium diet") + self.assertEqual(inst.oralDiet.type[1].coding[0].code, "226208002") + self.assertEqual(inst.oralDiet.type[1].coding[0].display, "Fluid restricted diet") + self.assertEqual(inst.oralDiet.type[1].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.oralDiet.type[1].coding[1].code, "1040") + self.assertEqual(inst.oralDiet.type[1].coding[1].display, "Fluid restricted diet") + self.assertEqual(inst.oralDiet.type[1].coding[1].system, "http://goodhealthhospital.org/diet-type-codes") + self.assertEqual(inst.oralDiet.type[1].text, "Fluid restricted diet") self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") - def testNutritionOrder3(self): - inst = self.instantiate_from("nutritionorder-example-fiberrestricteddiet.json") + def testNutritionOrder5(self): + inst = self.instantiate_from("nutritionorder-example-pureeddiet.json") self.assertIsNotNone(inst, "Must have instantiated a NutritionOrder instance") - self.implNutritionOrder3(inst) + self.implNutritionOrder5(inst) js = inst.as_json() self.assertEqual("NutritionOrder", js["resourceType"]) inst2 = nutritionorder.NutritionOrder(js) - self.implNutritionOrder3(inst2) + self.implNutritionOrder5(inst2) - def implNutritionOrder3(self, inst): + def implNutritionOrder5(self, inst): self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) self.assertEqual(inst.dateTime.as_json(), "2014-09-17") self.assertEqual(inst.excludeFoodModifier[0].coding[0].code, "227493005") @@ -145,181 +227,195 @@ def implNutritionOrder3(self, inst): self.assertEqual(inst.excludeFoodModifier[0].coding[0].version, "20140730") self.assertEqual(inst.foodPreferenceModifier[0].coding[0].code, "dairy-free") self.assertEqual(inst.foodPreferenceModifier[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/diet") - self.assertEqual(inst.id, "fiberrestricteddiet") + self.assertEqual(inst.id, "pureeddiet") self.assertEqual(inst.identifier[0].system, "http://goodhealthhospital.org/nutrition-requests") self.assertEqual(inst.identifier[0].value, "123") self.assertEqual(inst.intent, "order") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.oralDiet.nutrient[0].amount.code, "g") - self.assertEqual(inst.oralDiet.nutrient[0].amount.system, "http://unitsofmeasure.org") - self.assertEqual(inst.oralDiet.nutrient[0].amount.unit, "grams") - self.assertEqual(inst.oralDiet.nutrient[0].amount.value, 50) - self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].code, "256674009") - self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].display, "Fat") - self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.oralDiet.fluidConsistencyType[0].coding[0].code, "439021000124105") + self.assertEqual(inst.oralDiet.fluidConsistencyType[0].coding[0].display, "Dietary liquid consistency - nectar thick liquid") + self.assertEqual(inst.oralDiet.fluidConsistencyType[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.oralDiet.fluidConsistencyType[0].text, "Nectar thick liquids") self.assertEqual(inst.oralDiet.schedule[0].repeat.boundsPeriod.start.date, FHIRDate("2015-02-10").date) self.assertEqual(inst.oralDiet.schedule[0].repeat.boundsPeriod.start.as_json(), "2015-02-10") self.assertEqual(inst.oralDiet.schedule[0].repeat.frequency, 3) self.assertEqual(inst.oralDiet.schedule[0].repeat.period, 1) self.assertEqual(inst.oralDiet.schedule[0].repeat.periodUnit, "d") - self.assertEqual(inst.oralDiet.type[0].coding[0].code, "15108003") - self.assertEqual(inst.oralDiet.type[0].coding[0].display, "Restricted fiber diet") + self.assertEqual(inst.oralDiet.texture[0].modifier.coding[0].code, "228055009") + self.assertEqual(inst.oralDiet.texture[0].modifier.coding[0].display, "Liquidized food") + self.assertEqual(inst.oralDiet.texture[0].modifier.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.oralDiet.texture[0].modifier.text, "Pureed") + self.assertEqual(inst.oralDiet.type[0].coding[0].code, "226211001") + self.assertEqual(inst.oralDiet.type[0].coding[0].display, "Pureed diet") self.assertEqual(inst.oralDiet.type[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.oralDiet.type[0].coding[1].code, "1000") - self.assertEqual(inst.oralDiet.type[0].coding[1].display, "Fiber restricted") + self.assertEqual(inst.oralDiet.type[0].coding[1].code, "1010") + self.assertEqual(inst.oralDiet.type[0].coding[1].display, "Pureed diet") self.assertEqual(inst.oralDiet.type[0].coding[1].system, "http://goodhealthhospital.org/diet-type-codes") - self.assertEqual(inst.oralDiet.type[0].text, "Fiber restricted diet") - self.assertEqual(inst.oralDiet.type[1].coding[0].code, "16208003") - self.assertEqual(inst.oralDiet.type[1].coding[0].display, "Low fat diet") - self.assertEqual(inst.oralDiet.type[1].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.oralDiet.type[1].coding[1].code, "1100") - self.assertEqual(inst.oralDiet.type[1].coding[1].display, "Low Fat") - self.assertEqual(inst.oralDiet.type[1].coding[1].system, "http://goodhealthhospital.org/diet-type-codes") - self.assertEqual(inst.oralDiet.type[1].text, "Low fat diet") + self.assertEqual(inst.oralDiet.type[0].text, "Pureed diet") self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") - def testNutritionOrder4(self): - inst = self.instantiate_from("nutritionorder-example-texture-modified.json") + def testNutritionOrder6(self): + inst = self.instantiate_from("nutritionorder-example-diabeticdiet.json") self.assertIsNotNone(inst, "Must have instantiated a NutritionOrder instance") - self.implNutritionOrder4(inst) + self.implNutritionOrder6(inst) js = inst.as_json() self.assertEqual("NutritionOrder", js["resourceType"]) inst2 = nutritionorder.NutritionOrder(js) - self.implNutritionOrder4(inst2) + self.implNutritionOrder6(inst2) - def implNutritionOrder4(self, inst): + def implNutritionOrder6(self, inst): self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) self.assertEqual(inst.dateTime.as_json(), "2014-09-17") - self.assertEqual(inst.id, "texturemodified") + self.assertEqual(inst.excludeFoodModifier[0].coding[0].code, "227493005") + self.assertEqual(inst.excludeFoodModifier[0].coding[0].display, "Cashew Nut") + self.assertEqual(inst.excludeFoodModifier[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.excludeFoodModifier[0].coding[0].version, "20140730") + self.assertEqual(inst.foodPreferenceModifier[0].coding[0].code, "dairy-free") + self.assertEqual(inst.foodPreferenceModifier[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/diet") + self.assertEqual(inst.id, "diabeticdiet") self.assertEqual(inst.identifier[0].system, "http://goodhealthhospital.org/nutrition-requests") self.assertEqual(inst.identifier[0].value, "123") self.assertEqual(inst.intent, "order") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.oralDiet.nutrient[0].amount.code, "g") + self.assertEqual(inst.oralDiet.nutrient[0].amount.system, "http://unitsofmeasure.org") + self.assertEqual(inst.oralDiet.nutrient[0].amount.unit, "grams") + self.assertEqual(inst.oralDiet.nutrient[0].amount.value, 75) + self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].code, "2331003") + self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].display, "Carbohydrate") + self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.oralDiet.schedule[0].repeat.boundsPeriod.start.date, FHIRDate("2015-02-10").date) self.assertEqual(inst.oralDiet.schedule[0].repeat.boundsPeriod.start.as_json(), "2015-02-10") self.assertEqual(inst.oralDiet.schedule[0].repeat.frequency, 3) self.assertEqual(inst.oralDiet.schedule[0].repeat.period, 1) self.assertEqual(inst.oralDiet.schedule[0].repeat.periodUnit, "d") - self.assertEqual(inst.oralDiet.texture[0].foodType.coding[0].code, "28647000") - self.assertEqual(inst.oralDiet.texture[0].foodType.coding[0].display, "Meat") - self.assertEqual(inst.oralDiet.texture[0].foodType.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.oralDiet.texture[0].foodType.text, "Regular, Chopped Meat") - self.assertEqual(inst.oralDiet.texture[0].modifier.coding[0].code, "228049004") - self.assertEqual(inst.oralDiet.texture[0].modifier.coding[0].display, "Chopped food") - self.assertEqual(inst.oralDiet.texture[0].modifier.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.oralDiet.texture[0].modifier.text, "Regular, Chopped Meat") - self.assertEqual(inst.oralDiet.type[0].coding[0].code, "435801000124108") - self.assertEqual(inst.oralDiet.type[0].coding[0].display, "Texture modified diet") + self.assertEqual(inst.oralDiet.type[0].coding[0].code, "160670007") + self.assertEqual(inst.oralDiet.type[0].coding[0].display, "Diabetic diet") self.assertEqual(inst.oralDiet.type[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.oralDiet.type[0].coding[1].code, "1010") - self.assertEqual(inst.oralDiet.type[0].coding[1].display, "Texture modified diet") + self.assertEqual(inst.oralDiet.type[0].coding[1].code, "1030") + self.assertEqual(inst.oralDiet.type[0].coding[1].display, "DD - Diabetic diet") self.assertEqual(inst.oralDiet.type[0].coding[1].system, "http://goodhealthhospital.org/diet-type-codes") - self.assertEqual(inst.oralDiet.type[0].text, "Texture modified diet") + self.assertEqual(inst.oralDiet.type[0].text, "DD - Diabetic diet") self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") - def testNutritionOrder5(self): - inst = self.instantiate_from("nutritionorder-example-pureeddiet-simple.json") + def testNutritionOrder7(self): + inst = self.instantiate_from("nutritionorder-example-renaldiet.json") self.assertIsNotNone(inst, "Must have instantiated a NutritionOrder instance") - self.implNutritionOrder5(inst) + self.implNutritionOrder7(inst) js = inst.as_json() self.assertEqual("NutritionOrder", js["resourceType"]) inst2 = nutritionorder.NutritionOrder(js) - self.implNutritionOrder5(inst2) + self.implNutritionOrder7(inst2) - def implNutritionOrder5(self, inst): + def implNutritionOrder7(self, inst): self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) self.assertEqual(inst.dateTime.as_json(), "2014-09-17") - self.assertEqual(inst.id, "pureeddiet-simple") + self.assertEqual(inst.excludeFoodModifier[0].coding[0].code, "227493005") + self.assertEqual(inst.excludeFoodModifier[0].coding[0].display, "Cashew Nut") + self.assertEqual(inst.excludeFoodModifier[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.excludeFoodModifier[0].coding[0].version, "20140730") + self.assertEqual(inst.foodPreferenceModifier[0].coding[0].code, "dairy-free") + self.assertEqual(inst.foodPreferenceModifier[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/diet") + self.assertEqual(inst.id, "renaldiet") self.assertEqual(inst.identifier[0].system, "http://goodhealthhospital.org/nutrition-requests") self.assertEqual(inst.identifier[0].value, "123") self.assertEqual(inst.intent, "order") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.oralDiet.fluidConsistencyType[0].coding[0].code, "439021000124105") - self.assertEqual(inst.oralDiet.fluidConsistencyType[0].coding[0].display, "Dietary liquid consistency - nectar thick liquid") - self.assertEqual(inst.oralDiet.fluidConsistencyType[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.oralDiet.fluidConsistencyType[0].text, "Nectar thick liquids") + self.assertEqual(inst.oralDiet.nutrient[0].amount.code, "g") + self.assertEqual(inst.oralDiet.nutrient[0].amount.system, "http://unitsofmeasure.org") + self.assertEqual(inst.oralDiet.nutrient[0].amount.unit, "grams") + self.assertEqual(inst.oralDiet.nutrient[0].amount.value, 2) + self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].code, "39972003") + self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].display, "Sodium") + self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.oralDiet.nutrient[1].amount.code, "mg") + self.assertEqual(inst.oralDiet.nutrient[1].amount.system, "http://unitsofmeasure.org") + self.assertEqual(inst.oralDiet.nutrient[1].amount.unit, "milligrams") + self.assertEqual(inst.oralDiet.nutrient[1].amount.value, 1000) + self.assertEqual(inst.oralDiet.nutrient[1].modifier.coding[0].code, "30820000") + self.assertEqual(inst.oralDiet.nutrient[1].modifier.coding[0].display, "Phosphorus") + self.assertEqual(inst.oralDiet.nutrient[1].modifier.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.oralDiet.nutrient[2].amount.code, "g") + self.assertEqual(inst.oralDiet.nutrient[2].amount.system, "http://unitsofmeasure.org") + self.assertEqual(inst.oralDiet.nutrient[2].amount.unit, "grams") + self.assertEqual(inst.oralDiet.nutrient[2].amount.value, 2) + self.assertEqual(inst.oralDiet.nutrient[2].modifier.coding[0].code, "88480006") + self.assertEqual(inst.oralDiet.nutrient[2].modifier.coding[0].display, "Potassium") + self.assertEqual(inst.oralDiet.nutrient[2].modifier.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.oralDiet.schedule[0].repeat.boundsPeriod.start.date, FHIRDate("2015-02-10").date) self.assertEqual(inst.oralDiet.schedule[0].repeat.boundsPeriod.start.as_json(), "2015-02-10") self.assertEqual(inst.oralDiet.schedule[0].repeat.frequency, 3) self.assertEqual(inst.oralDiet.schedule[0].repeat.period, 1) self.assertEqual(inst.oralDiet.schedule[0].repeat.periodUnit, "d") - self.assertEqual(inst.oralDiet.texture[0].modifier.coding[0].code, "228055009") - self.assertEqual(inst.oralDiet.texture[0].modifier.coding[0].display, "Liquidized food") - self.assertEqual(inst.oralDiet.texture[0].modifier.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.oralDiet.texture[0].modifier.text, "Pureed") - self.assertEqual(inst.oralDiet.type[0].coding[0].code, "226211001") - self.assertEqual(inst.oralDiet.type[0].coding[0].display, "Pureed diet") + self.assertEqual(inst.oralDiet.type[0].coding[0].code, "33489005") + self.assertEqual(inst.oralDiet.type[0].coding[0].display, "Renal diet") self.assertEqual(inst.oralDiet.type[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.oralDiet.type[0].coding[1].code, "1010") - self.assertEqual(inst.oralDiet.type[0].coding[1].display, "Pureed diet") + self.assertEqual(inst.oralDiet.type[0].coding[1].code, "1050") + self.assertEqual(inst.oralDiet.type[0].coding[1].display, "Renal") self.assertEqual(inst.oralDiet.type[0].coding[1].system, "http://goodhealthhospital.org/diet-type-codes") - self.assertEqual(inst.oralDiet.type[0].text, "Pureed diet") + self.assertEqual(inst.oralDiet.type[0].text, "Renal Diet") self.assertEqual(inst.status, "active") - self.assertEqual(inst.supplement[0].instruction, "Ensure Pudding at breakfast, lunch, supper") - self.assertEqual(inst.supplement[0].productName, "Ensure Pudding 4 oz container") - self.assertEqual(inst.supplement[0].type.coding[0].code, "442971000124100") - self.assertEqual(inst.supplement[0].type.coding[0].display, "Adult high energy formula") - self.assertEqual(inst.supplement[0].type.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.supplement[0].type.coding[1].code, "1040") - self.assertEqual(inst.supplement[0].type.coding[1].display, "Adult high energy pudding") - self.assertEqual(inst.supplement[0].type.coding[1].system, "http://goodhealthhospital.org/supplement-type-codes") - self.assertEqual(inst.supplement[0].type.text, "Adult high energy pudding") self.assertEqual(inst.text.status, "generated") - def testNutritionOrder6(self): - inst = self.instantiate_from("nutritionorder-example-infantenteral.json") + def testNutritionOrder8(self): + inst = self.instantiate_from("nutritionorder-example-enteralbolus.json") self.assertIsNotNone(inst, "Must have instantiated a NutritionOrder instance") - self.implNutritionOrder6(inst) + self.implNutritionOrder8(inst) js = inst.as_json() self.assertEqual("NutritionOrder", js["resourceType"]) inst2 = nutritionorder.NutritionOrder(js) - self.implNutritionOrder6(inst2) + self.implNutritionOrder8(inst2) - def implNutritionOrder6(self, inst): + def implNutritionOrder8(self, inst): self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) self.assertEqual(inst.dateTime.as_json(), "2014-09-17") - self.assertEqual(inst.enteralFormula.additiveProductName, "Acme High Carbohydrate Additive") - self.assertEqual(inst.enteralFormula.additiveType.coding[0].code, "carbohydrate") - self.assertEqual(inst.enteralFormula.additiveType.coding[0].display, "Carbohydrate") + self.assertEqual(inst.enteralFormula.additiveProductName, "Acme Lipid Additive") + self.assertEqual(inst.enteralFormula.additiveType.coding[0].code, "lipid") + self.assertEqual(inst.enteralFormula.additiveType.coding[0].display, "Lipid") self.assertEqual(inst.enteralFormula.additiveType.coding[0].system, "http://terminology.hl7.org/CodeSystem/entformula-additive") - self.assertEqual(inst.enteralFormula.administrationInstruction, "Add high calorie high carbohydrate additive to increase cal/oz from 24 cal/oz to 27 cal/oz.") - self.assertEqual(inst.enteralFormula.administration[0].quantity.code, "[foz_us]") + self.assertEqual(inst.enteralFormula.administrationInstruction, "240 mls every 4hrs ") + self.assertEqual(inst.enteralFormula.administration[0].quantity.code, "mL") self.assertEqual(inst.enteralFormula.administration[0].quantity.system, "http://unitsofmeasure.org") - self.assertEqual(inst.enteralFormula.administration[0].quantity.unit, "ounces") - self.assertEqual(inst.enteralFormula.administration[0].quantity.value, 4) - self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.boundsPeriod.start.date, FHIRDate("2014-09-17").date) - self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.boundsPeriod.start.as_json(), "2014-09-17") + self.assertEqual(inst.enteralFormula.administration[0].quantity.unit, "milliliters") + self.assertEqual(inst.enteralFormula.administration[0].quantity.value, 240) + self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.boundsPeriod.start.date, FHIRDate("2014-09-17T16:00:00Z").date) + self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.boundsPeriod.start.as_json(), "2014-09-17T16:00:00Z") self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.frequency, 1) - self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.period, 3) + self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.period, 4) self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.periodUnit, "h") - self.assertEqual(inst.enteralFormula.baseFormulaProductName, "Acme Infant Formula + Iron") - self.assertEqual(inst.enteralFormula.baseFormulaType.coding[0].code, "412414007") - self.assertEqual(inst.enteralFormula.baseFormulaType.coding[0].display, "infant formula + iron") + self.assertEqual(inst.enteralFormula.baseFormulaProductName, "Acme High Protein Formula") + self.assertEqual(inst.enteralFormula.baseFormulaType.coding[0].code, "442991000124104") + self.assertEqual(inst.enteralFormula.baseFormulaType.coding[0].display, "Adult high protein formula") self.assertEqual(inst.enteralFormula.baseFormulaType.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.enteralFormula.caloricDensity.code, "cal/[foz_us]") + self.assertEqual(inst.enteralFormula.caloricDensity.code, "cal/mL") self.assertEqual(inst.enteralFormula.caloricDensity.system, "http://unitsofmeasure.org") - self.assertEqual(inst.enteralFormula.caloricDensity.unit, "calories per ounce") - self.assertEqual(inst.enteralFormula.caloricDensity.value, 20) - self.assertEqual(inst.enteralFormula.maxVolumeToDeliver.code, "[foz_us]") + self.assertEqual(inst.enteralFormula.caloricDensity.unit, "calories per milliliter") + self.assertEqual(inst.enteralFormula.caloricDensity.value, 1.5) + self.assertEqual(inst.enteralFormula.maxVolumeToDeliver.code, "mL/d") self.assertEqual(inst.enteralFormula.maxVolumeToDeliver.system, "http://unitsofmeasure.org") - self.assertEqual(inst.enteralFormula.maxVolumeToDeliver.unit, "ounces") - self.assertEqual(inst.enteralFormula.maxVolumeToDeliver.value, 32) - self.assertEqual(inst.enteralFormula.routeofAdministration.coding[0].code, "PO") - self.assertEqual(inst.enteralFormula.routeofAdministration.coding[0].display, "Swallow, oral") + self.assertEqual(inst.enteralFormula.maxVolumeToDeliver.unit, "milliliter/day") + self.assertEqual(inst.enteralFormula.maxVolumeToDeliver.value, 1440) + self.assertEqual(inst.enteralFormula.routeofAdministration.coding[0].code, "GT") + self.assertEqual(inst.enteralFormula.routeofAdministration.coding[0].display, "Instillation, gastrostomy tube") self.assertEqual(inst.enteralFormula.routeofAdministration.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration") - self.assertTrue(inst.enteralFormula.routeofAdministration.coding[0].userSelected) - self.assertEqual(inst.id, "infantenteral") + self.assertEqual(inst.excludeFoodModifier[0].coding[0].code, "227493005") + self.assertEqual(inst.excludeFoodModifier[0].coding[0].display, "Cashew Nut") + self.assertEqual(inst.excludeFoodModifier[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.excludeFoodModifier[0].coding[0].version, "20140730") + self.assertEqual(inst.foodPreferenceModifier[0].coding[0].code, "dairy-free") + self.assertEqual(inst.foodPreferenceModifier[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/diet") + self.assertEqual(inst.id, "enteralbolus") self.assertEqual(inst.identifier[0].system, "http://www.acme.org/nutritionorders") self.assertEqual(inst.identifier[0].value, "123") self.assertEqual(inst.intent, "order") @@ -329,17 +425,17 @@ def implNutritionOrder6(self, inst): self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") - def testNutritionOrder7(self): + def testNutritionOrder9(self): inst = self.instantiate_from("nutritionorder-example-enteralcontinuous.json") self.assertIsNotNone(inst, "Must have instantiated a NutritionOrder instance") - self.implNutritionOrder7(inst) + self.implNutritionOrder9(inst) js = inst.as_json() self.assertEqual("NutritionOrder", js["resourceType"]) inst2 = nutritionorder.NutritionOrder(js) - self.implNutritionOrder7(inst2) + self.implNutritionOrder9(inst2) - def implNutritionOrder7(self, inst): + def implNutritionOrder9(self, inst): self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) self.assertEqual(inst.dateTime.as_json(), "2014-09-17") self.assertEqual(inst.enteralFormula.administrationInstruction, "Hold feedings from 7 pm to 7 am. Add MCT oil to increase calories from 1.0 cal/mL to 1.5 cal/mL") @@ -386,84 +482,20 @@ def implNutritionOrder7(self, inst): self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") - def testNutritionOrder8(self): - inst = self.instantiate_from("nutritionorder-example-cardiacdiet.json") - self.assertIsNotNone(inst, "Must have instantiated a NutritionOrder instance") - self.implNutritionOrder8(inst) - - js = inst.as_json() - self.assertEqual("NutritionOrder", js["resourceType"]) - inst2 = nutritionorder.NutritionOrder(js) - self.implNutritionOrder8(inst2) - - def implNutritionOrder8(self, inst): - self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) - self.assertEqual(inst.dateTime.as_json(), "2014-09-17") - self.assertEqual(inst.excludeFoodModifier[0].coding[0].code, "227493005") - self.assertEqual(inst.excludeFoodModifier[0].coding[0].display, "Cashew Nut") - self.assertEqual(inst.excludeFoodModifier[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.excludeFoodModifier[0].coding[0].version, "20140730") - self.assertEqual(inst.foodPreferenceModifier[0].coding[0].code, "dairy-free") - self.assertEqual(inst.foodPreferenceModifier[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/diet") - self.assertEqual(inst.id, "cardiacdiet") - self.assertEqual(inst.identifier[0].system, "http://goodhealthhospital.org/nutrition-requests") - self.assertEqual(inst.identifier[0].value, "123") - self.assertEqual(inst.intent, "order") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.oralDiet.instruction, "Starting on 2/10 breakfast, maximum 400 ml fluids per meal") - self.assertEqual(inst.oralDiet.nutrient[0].amount.code, "g") - self.assertEqual(inst.oralDiet.nutrient[0].amount.system, "http://unitsofmeasure.org") - self.assertEqual(inst.oralDiet.nutrient[0].amount.unit, "grams") - self.assertEqual(inst.oralDiet.nutrient[0].amount.value, 2) - self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].code, "39972003") - self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].display, "Sodium") - self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.oralDiet.nutrient[1].amount.code, "mL") - self.assertEqual(inst.oralDiet.nutrient[1].amount.system, "http://unitsofmeasure.org") - self.assertEqual(inst.oralDiet.nutrient[1].amount.unit, "milliliter") - self.assertEqual(inst.oralDiet.nutrient[1].amount.value, 1500) - self.assertEqual(inst.oralDiet.nutrient[1].modifier.coding[0].code, "33463005") - self.assertEqual(inst.oralDiet.nutrient[1].modifier.coding[0].display, "Fluid") - self.assertEqual(inst.oralDiet.nutrient[1].modifier.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.oralDiet.type[0].coding[0].code, "386619000") - self.assertEqual(inst.oralDiet.type[0].coding[0].display, "Low sodium diet") - self.assertEqual(inst.oralDiet.type[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.oralDiet.type[0].coding[1].code, "1040") - self.assertEqual(inst.oralDiet.type[0].coding[1].display, "Low Sodium Diet") - self.assertEqual(inst.oralDiet.type[0].coding[1].system, "http://goodhealthhospital.org/diet-type-codes") - self.assertEqual(inst.oralDiet.type[0].text, "Low sodium diet") - self.assertEqual(inst.oralDiet.type[1].coding[0].code, "226208002") - self.assertEqual(inst.oralDiet.type[1].coding[0].display, "Fluid restricted diet") - self.assertEqual(inst.oralDiet.type[1].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.oralDiet.type[1].coding[1].code, "1040") - self.assertEqual(inst.oralDiet.type[1].coding[1].display, "Fluid restricted diet") - self.assertEqual(inst.oralDiet.type[1].coding[1].system, "http://goodhealthhospital.org/diet-type-codes") - self.assertEqual(inst.oralDiet.type[1].text, "Fluid restricted diet") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "generated") - - def testNutritionOrder9(self): - inst = self.instantiate_from("nutritionorder-example-pureeddiet.json") + def testNutritionOrder10(self): + inst = self.instantiate_from("nutritionorder-example-pureeddiet-simple.json") self.assertIsNotNone(inst, "Must have instantiated a NutritionOrder instance") - self.implNutritionOrder9(inst) + self.implNutritionOrder10(inst) js = inst.as_json() self.assertEqual("NutritionOrder", js["resourceType"]) inst2 = nutritionorder.NutritionOrder(js) - self.implNutritionOrder9(inst2) + self.implNutritionOrder10(inst2) - def implNutritionOrder9(self, inst): + def implNutritionOrder10(self, inst): self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) self.assertEqual(inst.dateTime.as_json(), "2014-09-17") - self.assertEqual(inst.excludeFoodModifier[0].coding[0].code, "227493005") - self.assertEqual(inst.excludeFoodModifier[0].coding[0].display, "Cashew Nut") - self.assertEqual(inst.excludeFoodModifier[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.excludeFoodModifier[0].coding[0].version, "20140730") - self.assertEqual(inst.foodPreferenceModifier[0].coding[0].code, "dairy-free") - self.assertEqual(inst.foodPreferenceModifier[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/diet") - self.assertEqual(inst.id, "pureeddiet") + self.assertEqual(inst.id, "pureeddiet-simple") self.assertEqual(inst.identifier[0].system, "http://goodhealthhospital.org/nutrition-requests") self.assertEqual(inst.identifier[0].value, "123") self.assertEqual(inst.intent, "order") @@ -491,53 +523,14 @@ def implNutritionOrder9(self, inst): self.assertEqual(inst.oralDiet.type[0].coding[1].system, "http://goodhealthhospital.org/diet-type-codes") self.assertEqual(inst.oralDiet.type[0].text, "Pureed diet") self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "generated") - - def testNutritionOrder10(self): - inst = self.instantiate_from("nutritionorder-example-diabeticdiet.json") - self.assertIsNotNone(inst, "Must have instantiated a NutritionOrder instance") - self.implNutritionOrder10(inst) - - js = inst.as_json() - self.assertEqual("NutritionOrder", js["resourceType"]) - inst2 = nutritionorder.NutritionOrder(js) - self.implNutritionOrder10(inst2) - - def implNutritionOrder10(self, inst): - self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) - self.assertEqual(inst.dateTime.as_json(), "2014-09-17") - self.assertEqual(inst.excludeFoodModifier[0].coding[0].code, "227493005") - self.assertEqual(inst.excludeFoodModifier[0].coding[0].display, "Cashew Nut") - self.assertEqual(inst.excludeFoodModifier[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.excludeFoodModifier[0].coding[0].version, "20140730") - self.assertEqual(inst.foodPreferenceModifier[0].coding[0].code, "dairy-free") - self.assertEqual(inst.foodPreferenceModifier[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/diet") - self.assertEqual(inst.id, "diabeticdiet") - self.assertEqual(inst.identifier[0].system, "http://goodhealthhospital.org/nutrition-requests") - self.assertEqual(inst.identifier[0].value, "123") - self.assertEqual(inst.intent, "order") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.oralDiet.nutrient[0].amount.code, "g") - self.assertEqual(inst.oralDiet.nutrient[0].amount.system, "http://unitsofmeasure.org") - self.assertEqual(inst.oralDiet.nutrient[0].amount.unit, "grams") - self.assertEqual(inst.oralDiet.nutrient[0].amount.value, 75) - self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].code, "2331003") - self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].display, "Carbohydrate") - self.assertEqual(inst.oralDiet.nutrient[0].modifier.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.oralDiet.schedule[0].repeat.boundsPeriod.start.date, FHIRDate("2015-02-10").date) - self.assertEqual(inst.oralDiet.schedule[0].repeat.boundsPeriod.start.as_json(), "2015-02-10") - self.assertEqual(inst.oralDiet.schedule[0].repeat.frequency, 3) - self.assertEqual(inst.oralDiet.schedule[0].repeat.period, 1) - self.assertEqual(inst.oralDiet.schedule[0].repeat.periodUnit, "d") - self.assertEqual(inst.oralDiet.type[0].coding[0].code, "160670007") - self.assertEqual(inst.oralDiet.type[0].coding[0].display, "Diabetic diet") - self.assertEqual(inst.oralDiet.type[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.oralDiet.type[0].coding[1].code, "1030") - self.assertEqual(inst.oralDiet.type[0].coding[1].display, "DD - Diabetic diet") - self.assertEqual(inst.oralDiet.type[0].coding[1].system, "http://goodhealthhospital.org/diet-type-codes") - self.assertEqual(inst.oralDiet.type[0].text, "DD - Diabetic diet") - self.assertEqual(inst.status, "active") + self.assertEqual(inst.supplement[0].instruction, "Ensure Pudding at breakfast, lunch, supper") + self.assertEqual(inst.supplement[0].productName, "Ensure Pudding 4 oz container") + self.assertEqual(inst.supplement[0].type.coding[0].code, "442971000124100") + self.assertEqual(inst.supplement[0].type.coding[0].display, "Adult high energy formula") + self.assertEqual(inst.supplement[0].type.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.supplement[0].type.coding[1].code, "1040") + self.assertEqual(inst.supplement[0].type.coding[1].display, "Adult high energy pudding") + self.assertEqual(inst.supplement[0].type.coding[1].system, "http://goodhealthhospital.org/supplement-type-codes") + self.assertEqual(inst.supplement[0].type.text, "Adult high energy pudding") self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/observation.py b/fhirclient/models/observation.py index 7814cb68a..1e5d28c50 100644 --- a/fhirclient/models/observation.py +++ b/fhirclient/models/observation.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Observation) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Observation) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/observation_tests.py b/fhirclient/models/observation_tests.py index 11260390d..e095c6a32 100644 --- a/fhirclient/models/observation_tests.py +++ b/fhirclient/models/observation_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return observation.Observation(js) def testObservation1(self): - inst = self.instantiate_from("observation-example-genetics-1.json") + inst = self.instantiate_from("observation-example-body-temperature.json") self.assertIsNotNone(inst, "Must have instantiated a Observation instance") self.implObservation1(inst) @@ -32,33 +32,30 @@ def testObservation1(self): self.implObservation1(inst2) def implObservation1(self, inst): - self.assertEqual(inst.code.coding[0].code, "55233-1") - self.assertEqual(inst.code.coding[0].display, "Genetic analysis master panel-- This is the parent OBR for the panel holding all of the associated observations that can be reported with a molecular genetics analysis result.") + self.assertEqual(inst.category[0].coding[0].code, "vital-signs") + self.assertEqual(inst.category[0].coding[0].display, "Vital Signs") + self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/observation-category") + self.assertEqual(inst.category[0].text, "Vital Signs") + self.assertEqual(inst.code.coding[0].code, "8310-5") + self.assertEqual(inst.code.coding[0].display, "Body temperature") self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.extension[0].url, "http://hl7.org/fhir/StructureDefinition/observation-geneticsGene") - self.assertEqual(inst.extension[0].valueCodeableConcept.coding[0].code, "3236") - self.assertEqual(inst.extension[0].valueCodeableConcept.coding[0].display, "EGFR") - self.assertEqual(inst.extension[0].valueCodeableConcept.coding[0].system, "http://www.genenames.org") - self.assertEqual(inst.extension[1].url, "http://hl7.org/fhir/StructureDefinition/observation-geneticsDNARegionName") - self.assertEqual(inst.extension[1].valueString, "Exon 21") - self.assertEqual(inst.extension[2].url, "http://hl7.org/fhir/StructureDefinition/observation-geneticsGenomicSourceClass") - self.assertEqual(inst.extension[2].valueCodeableConcept.coding[0].code, "LA6684-0") - self.assertEqual(inst.extension[2].valueCodeableConcept.coding[0].display, "somatic") - self.assertEqual(inst.extension[2].valueCodeableConcept.coding[0].system, "http://loinc.org") - self.assertEqual(inst.id, "example-genetics-1") - self.assertEqual(inst.issued.date, FHIRDate("2013-04-03T15:30:10+01:00").date) - self.assertEqual(inst.issued.as_json(), "2013-04-03T15:30:10+01:00") + self.assertEqual(inst.code.text, "Body temperature") + self.assertEqual(inst.effectiveDateTime.date, FHIRDate("1999-07-02").date) + self.assertEqual(inst.effectiveDateTime.as_json(), "1999-07-02") + self.assertEqual(inst.id, "body-temperature") + self.assertEqual(inst.meta.profile[0], "http://hl7.org/fhir/StructureDefinition/vitalsigns") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.valueCodeableConcept.coding[0].code, "10828004") - self.assertEqual(inst.valueCodeableConcept.coding[0].display, "Positive") - self.assertEqual(inst.valueCodeableConcept.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.valueQuantity.code, "Cel") + self.assertEqual(inst.valueQuantity.system, "http://unitsofmeasure.org") + self.assertEqual(inst.valueQuantity.unit, "C") + self.assertEqual(inst.valueQuantity.value, 36.5) def testObservation2(self): - inst = self.instantiate_from("observation-example-bmd.json") + inst = self.instantiate_from("observation-example-bgpanel.json") self.assertIsNotNone(inst, "Must have instantiated a Observation instance") self.implObservation2(inst) @@ -68,26 +65,25 @@ def testObservation2(self): self.implObservation2(inst2) def implObservation2(self, inst): - self.assertEqual(inst.bodySite.coding[0].code, "71341001:272741003=7771000") - self.assertEqual(inst.bodySite.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.bodySite.text, "Left Femur") - self.assertEqual(inst.code.coding[0].code, "24701-5") - self.assertEqual(inst.code.coding[0].display, "Femur DXA Bone density") + self.assertEqual(inst.category[0].coding[0].code, "laboratory") + self.assertEqual(inst.category[0].coding[0].display, "Laboratory") + self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/observation-category") + self.assertEqual(inst.category[0].text, "Laboratory") + self.assertEqual(inst.code.coding[0].code, "34532-2") + self.assertEqual(inst.code.coding[0].display, " Blood type and Indirect antibody screen panel - Blood") self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.code.text, "BMD - Left Femur") - self.assertEqual(inst.id, "bmd") + self.assertEqual(inst.code.text, "Blood Group Panel") + self.assertEqual(inst.effectiveDateTime.date, FHIRDate("2018-03-11T16:07:54+00:00").date) + self.assertEqual(inst.effectiveDateTime.as_json(), "2018-03-11T16:07:54+00:00") + self.assertEqual(inst.id, "bgpanel") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.valueQuantity.code, "g/cm-2") - self.assertEqual(inst.valueQuantity.system, "http://unitsofmeasure.org") - self.assertEqual(inst.valueQuantity.unit, "g/cm²") - self.assertEqual(inst.valueQuantity.value, 0.887) def testObservation3(self): - inst = self.instantiate_from("observation-example-respiratory-rate.json") + inst = self.instantiate_from("observation-example-f002-excess.json") self.assertIsNotNone(inst, "Must have instantiated a Observation instance") self.implObservation3(inst) @@ -97,30 +93,42 @@ def testObservation3(self): self.implObservation3(inst2) def implObservation3(self, inst): - self.assertEqual(inst.category[0].coding[0].code, "vital-signs") - self.assertEqual(inst.category[0].coding[0].display, "Vital Signs") - self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/observation-category") - self.assertEqual(inst.category[0].text, "Vital Signs") - self.assertEqual(inst.code.coding[0].code, "9279-1") - self.assertEqual(inst.code.coding[0].display, "Respiratory rate") + self.assertEqual(inst.code.coding[0].code, "11555-0") + self.assertEqual(inst.code.coding[0].display, "Base excess in Blood by calculation") self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.code.text, "Respiratory rate") - self.assertEqual(inst.effectiveDateTime.date, FHIRDate("1999-07-02").date) - self.assertEqual(inst.effectiveDateTime.as_json(), "1999-07-02") - self.assertEqual(inst.id, "respiratory-rate") - self.assertEqual(inst.meta.profile[0], "http://hl7.org/fhir/StructureDefinition/vitalsigns") + self.assertEqual(inst.effectivePeriod.end.date, FHIRDate("2013-04-05T10:30:10+01:00").date) + self.assertEqual(inst.effectivePeriod.end.as_json(), "2013-04-05T10:30:10+01:00") + self.assertEqual(inst.effectivePeriod.start.date, FHIRDate("2013-04-02T10:30:10+01:00").date) + self.assertEqual(inst.effectivePeriod.start.as_json(), "2013-04-02T10:30:10+01:00") + self.assertEqual(inst.id, "f002") + self.assertEqual(inst.identifier[0].system, "http://www.bmc.nl/zorgportal/identifiers/observations") + self.assertEqual(inst.identifier[0].use, "official") + self.assertEqual(inst.identifier[0].value, "6324") + self.assertEqual(inst.interpretation[0].coding[0].code, "H") + self.assertEqual(inst.interpretation[0].coding[0].display, "High") + self.assertEqual(inst.interpretation[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation") + self.assertEqual(inst.issued.date, FHIRDate("2013-04-03T15:30:10+01:00").date) + self.assertEqual(inst.issued.as_json(), "2013-04-03T15:30:10+01:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.referenceRange[0].high.code, "mmol/L") + self.assertEqual(inst.referenceRange[0].high.system, "http://unitsofmeasure.org") + self.assertEqual(inst.referenceRange[0].high.unit, "mmol/l") + self.assertEqual(inst.referenceRange[0].high.value, 11.2) + self.assertEqual(inst.referenceRange[0].low.code, "mmol/L") + self.assertEqual(inst.referenceRange[0].low.system, "http://unitsofmeasure.org") + self.assertEqual(inst.referenceRange[0].low.unit, "mmol/l") + self.assertEqual(inst.referenceRange[0].low.value, 7.1) self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.valueQuantity.code, "/min") + self.assertEqual(inst.valueQuantity.code, "mmol/L") self.assertEqual(inst.valueQuantity.system, "http://unitsofmeasure.org") - self.assertEqual(inst.valueQuantity.unit, "breaths/minute") - self.assertEqual(inst.valueQuantity.value, 26) + self.assertEqual(inst.valueQuantity.unit, "mmol/l") + self.assertEqual(inst.valueQuantity.value, 12.6) def testObservation4(self): - inst = self.instantiate_from("observation-example.json") + inst = self.instantiate_from("observation-example-heart-rate.json") self.assertIsNotNone(inst, "Must have instantiated a Observation instance") self.implObservation4(inst) @@ -133,33 +141,27 @@ def implObservation4(self, inst): self.assertEqual(inst.category[0].coding[0].code, "vital-signs") self.assertEqual(inst.category[0].coding[0].display, "Vital Signs") self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/observation-category") - self.assertEqual(inst.code.coding[0].code, "29463-7") - self.assertEqual(inst.code.coding[0].display, "Body Weight") + self.assertEqual(inst.category[0].text, "Vital Signs") + self.assertEqual(inst.code.coding[0].code, "8867-4") + self.assertEqual(inst.code.coding[0].display, "Heart rate") self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.code.coding[1].code, "3141-9") - self.assertEqual(inst.code.coding[1].display, "Body weight Measured") - self.assertEqual(inst.code.coding[1].system, "http://loinc.org") - self.assertEqual(inst.code.coding[2].code, "27113001") - self.assertEqual(inst.code.coding[2].display, "Body weight") - self.assertEqual(inst.code.coding[2].system, "http://snomed.info/sct") - self.assertEqual(inst.code.coding[3].code, "body-weight") - self.assertEqual(inst.code.coding[3].display, "Body Weight") - self.assertEqual(inst.code.coding[3].system, "http://acme.org/devices/clinical-codes") - self.assertEqual(inst.effectiveDateTime.date, FHIRDate("2016-03-28").date) - self.assertEqual(inst.effectiveDateTime.as_json(), "2016-03-28") - self.assertEqual(inst.id, "example") + self.assertEqual(inst.code.text, "Heart rate") + self.assertEqual(inst.effectiveDateTime.date, FHIRDate("1999-07-02").date) + self.assertEqual(inst.effectiveDateTime.as_json(), "1999-07-02") + self.assertEqual(inst.id, "heart-rate") + self.assertEqual(inst.meta.profile[0], "http://hl7.org/fhir/StructureDefinition/vitalsigns") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.valueQuantity.code, "[lb_av]") + self.assertEqual(inst.valueQuantity.code, "/min") self.assertEqual(inst.valueQuantity.system, "http://unitsofmeasure.org") - self.assertEqual(inst.valueQuantity.unit, "lbs") - self.assertEqual(inst.valueQuantity.value, 185) + self.assertEqual(inst.valueQuantity.unit, "beats/minute") + self.assertEqual(inst.valueQuantity.value, 44) def testObservation5(self): - inst = self.instantiate_from("observation-example-haplotype2.json") + inst = self.instantiate_from("observation-example-secondsmoke.json") self.assertIsNotNone(inst, "Must have instantiated a Observation instance") self.implObservation5(inst) @@ -169,27 +171,32 @@ def testObservation5(self): self.implObservation5(inst2) def implObservation5(self, inst): - self.assertEqual(inst.code.coding[0].code, "55233-1") - self.assertEqual(inst.code.coding[0].display, "Genetic analysis master panel-- This is the parent OBR for the panel holding all of the associated observations that can be reported with a molecular genetics analysis result.") + self.assertEqual(inst.category[0].coding[0].code, "social-history") + self.assertEqual(inst.category[0].coding[0].display, "Social History") + self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/observation-category") + self.assertEqual(inst.category[0].text, "Social History") + self.assertEqual(inst.code.coding[0].code, "39243-1") + self.assertEqual(inst.code.coding[0].display, "Second hand smoke exposure CPHS") self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.extension[0].url, "http://hl7.org/fhir/StructureDefinition/observation-geneticsGene") - self.assertEqual(inst.extension[0].valueCodeableConcept.coding[0].code, "2623") - self.assertEqual(inst.extension[0].valueCodeableConcept.coding[0].display, "CYP2C9") - self.assertEqual(inst.extension[0].valueCodeableConcept.coding[0].system, "http://www.genenames.org") - self.assertEqual(inst.id, "example-haplotype2") - self.assertEqual(inst.issued.date, FHIRDate("2013-04-03T15:30:10+01:00").date) - self.assertEqual(inst.issued.as_json(), "2013-04-03T15:30:10+01:00") + self.assertEqual(inst.code.coding[1].code, "102409004") + self.assertEqual(inst.code.coding[1].display, "Second hand cigarette smoke (substance)") + self.assertEqual(inst.code.coding[1].system, "http://snomed.info/sct") + self.assertEqual(inst.code.text, "Second hand smoke exposure") + self.assertEqual(inst.effectiveDateTime.date, FHIRDate("2016-05-18T22:33:22Z").date) + self.assertEqual(inst.effectiveDateTime.as_json(), "2016-05-18T22:33:22Z") + self.assertEqual(inst.id, "secondsmoke") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.status, "unknown") + self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.valueCodeableConcept.coding[0].code, "PA16581679") - self.assertEqual(inst.valueCodeableConcept.coding[0].display, "*4") - self.assertEqual(inst.valueCodeableConcept.coding[0].system, "http://pharmakb.org") + self.assertEqual(inst.valueCodeableConcept.coding[0].code, "373066001") + self.assertEqual(inst.valueCodeableConcept.coding[0].display, "Yes (qualifier value)") + self.assertEqual(inst.valueCodeableConcept.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.valueCodeableConcept.text, "YES") def testObservation6(self): - inst = self.instantiate_from("observation-example-mbp.json") + inst = self.instantiate_from("observation-example-bloodpressure-dar.json") self.assertIsNotNone(inst, "Must have instantiated a Observation instance") self.implObservation6(inst) @@ -199,29 +206,53 @@ def testObservation6(self): self.implObservation6(inst2) def implObservation6(self, inst): + self.assertEqual(inst.bodySite.coding[0].code, "368209003") + self.assertEqual(inst.bodySite.coding[0].display, "Right arm") + self.assertEqual(inst.bodySite.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.category[0].coding[0].code, "vital-signs") self.assertEqual(inst.category[0].coding[0].display, "Vital Signs") self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/observation-category") - self.assertEqual(inst.category[0].text, "Vital Signs") - self.assertEqual(inst.code.coding[0].code, "8478-0") - self.assertEqual(inst.code.coding[0].display, "Mean blood pressure") + self.assertEqual(inst.code.coding[0].code, "85354-9") + self.assertEqual(inst.code.coding[0].display, "Blood pressure panel with all children optional") self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.code.text, "Mean blood pressure") - self.assertEqual(inst.effectiveDateTime.date, FHIRDate("1999-07-02").date) - self.assertEqual(inst.effectiveDateTime.as_json(), "1999-07-02") - self.assertEqual(inst.id, "mbp") + self.assertEqual(inst.code.text, "Blood pressure systolic & diastolic") + self.assertEqual(inst.component[0].code.coding[0].code, "8480-6") + self.assertEqual(inst.component[0].code.coding[0].display, "Systolic blood pressure") + self.assertEqual(inst.component[0].code.coding[0].system, "http://loinc.org") + self.assertEqual(inst.component[0].code.coding[1].code, "271649006") + self.assertEqual(inst.component[0].code.coding[1].display, "Systolic blood pressure") + self.assertEqual(inst.component[0].code.coding[1].system, "http://snomed.info/sct") + self.assertEqual(inst.component[0].code.coding[2].code, "bp-s") + self.assertEqual(inst.component[0].code.coding[2].display, "Systolic Blood pressure") + self.assertEqual(inst.component[0].code.coding[2].system, "http://acme.org/devices/clinical-codes") + self.assertEqual(inst.component[0].valueQuantity.code, "mm[Hg]") + self.assertEqual(inst.component[0].valueQuantity.system, "http://unitsofmeasure.org") + self.assertEqual(inst.component[0].valueQuantity.unit, "mmHg") + self.assertEqual(inst.component[0].valueQuantity.value, 107) + self.assertEqual(inst.component[1].code.coding[0].code, "8462-4") + self.assertEqual(inst.component[1].code.coding[0].display, "Diastolic blood pressure") + self.assertEqual(inst.component[1].code.coding[0].system, "http://loinc.org") + self.assertEqual(inst.component[1].dataAbsentReason.coding[0].code, "not-performed") + self.assertEqual(inst.component[1].dataAbsentReason.coding[0].display, "Not Performed") + self.assertEqual(inst.component[1].dataAbsentReason.coding[0].system, "http://terminology.hl7.org/CodeSystem/data-absent-reason") + self.assertEqual(inst.effectiveDateTime.date, FHIRDate("2012-09-17").date) + self.assertEqual(inst.effectiveDateTime.as_json(), "2012-09-17") + self.assertEqual(inst.id, "blood-pressure-dar") + self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") + self.assertEqual(inst.identifier[0].value, "urn:uuid:187e0c12-8dd2-67e2-99b2-bf273c878281") + self.assertEqual(inst.interpretation[0].coding[0].code, "L") + self.assertEqual(inst.interpretation[0].coding[0].display, "low") + self.assertEqual(inst.interpretation[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation") + self.assertEqual(inst.interpretation[0].text, "Below low normal") + self.assertEqual(inst.meta.profile[0], "http://hl7.org/fhir/StructureDefinition/vitalsigns") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.valueQuantity.code, "mm[Hg]") - self.assertEqual(inst.valueQuantity.system, "http://unitsofmeasure.org") - self.assertEqual(inst.valueQuantity.unit, "mm[Hg]") - self.assertEqual(inst.valueQuantity.value, 80) def testObservation7(self): - inst = self.instantiate_from("observation-example-genetics-brcapat.json") + inst = self.instantiate_from("observation-example-respiratory-rate.json") self.assertIsNotNone(inst, "Must have instantiated a Observation instance") self.implObservation7(inst) @@ -231,26 +262,30 @@ def testObservation7(self): self.implObservation7(inst2) def implObservation7(self, inst): - self.assertEqual(inst.code.coding[0].code, "59041-4") - self.assertEqual(inst.code.coding[0].display, "BRCA1+BRCA2 gene mutations tested for in Blood or Tissue by Molecular genetics method Nominal") + self.assertEqual(inst.category[0].coding[0].code, "vital-signs") + self.assertEqual(inst.category[0].coding[0].display, "Vital Signs") + self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/observation-category") + self.assertEqual(inst.category[0].text, "Vital Signs") + self.assertEqual(inst.code.coding[0].code, "9279-1") + self.assertEqual(inst.code.coding[0].display, "Respiratory rate") self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.extension[0].url, "http://hl7.org/fhir/StructureDefinition/observation-geneticsGene") - self.assertEqual(inst.extension[0].valueCodeableConcept.coding[0].code, "KX470182.1") - self.assertEqual(inst.extension[0].valueCodeableConcept.coding[0].display, "BRCA") - self.assertEqual(inst.extension[0].valueCodeableConcept.coding[0].system, "https://www.ncbi.nlm.nih.gov/nuccore") - self.assertEqual(inst.extension[1].url, "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity") - self.assertEqual(inst.extension[1].valueCodeableConcept.coding[0].code, "413581001") - self.assertEqual(inst.extension[1].valueCodeableConcept.coding[0].display, "Unknown racial group") - self.assertEqual(inst.extension[1].valueCodeableConcept.coding[0].system, "http://browser.ihtsdotools.org/") - self.assertEqual(inst.id, "example-genetics-brcapat") + self.assertEqual(inst.code.text, "Respiratory rate") + self.assertEqual(inst.effectiveDateTime.date, FHIRDate("1999-07-02").date) + self.assertEqual(inst.effectiveDateTime.as_json(), "1999-07-02") + self.assertEqual(inst.id, "respiratory-rate") + self.assertEqual(inst.meta.profile[0], "http://hl7.org/fhir/StructureDefinition/vitalsigns") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.valueQuantity.code, "/min") + self.assertEqual(inst.valueQuantity.system, "http://unitsofmeasure.org") + self.assertEqual(inst.valueQuantity.unit, "breaths/minute") + self.assertEqual(inst.valueQuantity.value, 26) def testObservation8(self): - inst = self.instantiate_from("observation-example-bmi.json") + inst = self.instantiate_from("observation-example-f203-bicarbonate.json") self.assertIsNotNone(inst, "Must have instantiated a Observation instance") self.implObservation8(inst) @@ -260,30 +295,40 @@ def testObservation8(self): self.implObservation8(inst2) def implObservation8(self, inst): - self.assertEqual(inst.category[0].coding[0].code, "vital-signs") - self.assertEqual(inst.category[0].coding[0].display, "Vital Signs") - self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/observation-category") - self.assertEqual(inst.category[0].text, "Vital Signs") - self.assertEqual(inst.code.coding[0].code, "39156-5") - self.assertEqual(inst.code.coding[0].display, "Body mass index (BMI) [Ratio]") + self.assertEqual(inst.code.coding[0].code, "1963-8") + self.assertEqual(inst.code.coding[0].display, "Bicarbonate [Moles/?volume] in Serum") self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.code.text, "BMI") - self.assertEqual(inst.effectiveDateTime.date, FHIRDate("1999-07-02").date) - self.assertEqual(inst.effectiveDateTime.as_json(), "1999-07-02") - self.assertEqual(inst.id, "bmi") - self.assertEqual(inst.meta.profile[0], "http://hl7.org/fhir/StructureDefinition/vitalsigns") + self.assertEqual(inst.code.coding[1].code, "365722008") + self.assertEqual(inst.code.coding[1].display, "Bicarbonate level") + self.assertEqual(inst.code.coding[1].system, "http://snomed.info/sct") + self.assertEqual(inst.id, "f203") + self.assertEqual(inst.identifier[0].system, "https://intranet.aumc.nl/labvalues") + self.assertEqual(inst.identifier[0].value, "1304-03720-Bicarbonate") + self.assertEqual(inst.interpretation[0].coding[0].code, "166698001") + self.assertEqual(inst.interpretation[0].coding[0].display, "Serum bicarbonate level normal") + self.assertEqual(inst.interpretation[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.interpretation[0].coding[1].code, "N") + self.assertEqual(inst.interpretation[0].coding[1].system, "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation") + self.assertEqual(inst.issued.date, FHIRDate("2013-04-04T14:34:00+01:00").date) + self.assertEqual(inst.issued.as_json(), "2013-04-04T14:34:00+01:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.method.text, "enzymatic method") + self.assertEqual(inst.referenceRange[0].high.value, 29) + self.assertEqual(inst.referenceRange[0].low.value, 22) + self.assertEqual(inst.referenceRange[0].type.coding[0].code, "normal") + self.assertEqual(inst.referenceRange[0].type.coding[0].display, "Normal Range") + self.assertEqual(inst.referenceRange[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/referencerange-meaning") self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.valueQuantity.code, "kg/m2") - self.assertEqual(inst.valueQuantity.system, "http://unitsofmeasure.org") - self.assertEqual(inst.valueQuantity.unit, "kg/m2") - self.assertEqual(inst.valueQuantity.value, 16.2) + self.assertEqual(inst.valueQuantity.code, "258813002") + self.assertEqual(inst.valueQuantity.system, "http://snomed.info/sct") + self.assertEqual(inst.valueQuantity.unit, "mmol/L") + self.assertEqual(inst.valueQuantity.value, 28) def testObservation9(self): - inst = self.instantiate_from("observation-example-body-height.json") + inst = self.instantiate_from("observation-example-diplotype1.json") self.assertIsNotNone(inst, "Must have instantiated a Observation instance") self.implObservation9(inst) @@ -293,30 +338,25 @@ def testObservation9(self): self.implObservation9(inst2) def implObservation9(self, inst): - self.assertEqual(inst.category[0].coding[0].code, "vital-signs") - self.assertEqual(inst.category[0].coding[0].display, "Vital Signs") - self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/observation-category") - self.assertEqual(inst.category[0].text, "Vital Signs") - self.assertEqual(inst.code.coding[0].code, "8302-2") - self.assertEqual(inst.code.coding[0].display, "Body height") - self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.code.text, "Body height") - self.assertEqual(inst.effectiveDateTime.date, FHIRDate("1999-07-02").date) - self.assertEqual(inst.effectiveDateTime.as_json(), "1999-07-02") - self.assertEqual(inst.id, "body-height") - self.assertEqual(inst.meta.profile[0], "http://hl7.org/fhir/StructureDefinition/vitalsigns") + self.assertEqual(inst.code.coding[0].code, "363779003") + self.assertEqual(inst.code.coding[0].display, "Genotype determination") + self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.code.text, "Diplotype Call") + self.assertEqual(inst.extension[0].url, "http://hl7.org/fhir/StructureDefinition/observation-geneticsGene") + self.assertEqual(inst.extension[0].valueCodeableConcept.coding[0].code, "2623") + self.assertEqual(inst.extension[0].valueCodeableConcept.coding[0].display, "CYP2C9") + self.assertEqual(inst.extension[0].valueCodeableConcept.coding[0].system, "http://www.genenames.org") + self.assertEqual(inst.id, "example-diplotype1") + self.assertEqual(inst.issued.date, FHIRDate("2013-04-03T15:30:10+01:00").date) + self.assertEqual(inst.issued.as_json(), "2013-04-03T15:30:10+01:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.valueQuantity.code, "[in_i]") - self.assertEqual(inst.valueQuantity.system, "http://unitsofmeasure.org") - self.assertEqual(inst.valueQuantity.unit, "in") - self.assertEqual(inst.valueQuantity.value, 66.89999999999999) def testObservation10(self): - inst = self.instantiate_from("observation-example-eye-color.json") + inst = self.instantiate_from("observation-example-TPMT-haplotype-one.json") self.assertIsNotNone(inst, "Must have instantiated a Observation instance") self.implObservation10(inst) @@ -326,14 +366,23 @@ def testObservation10(self): self.implObservation10(inst2) def implObservation10(self, inst): - self.assertEqual(inst.code.text, "eye color") - self.assertEqual(inst.effectiveDateTime.date, FHIRDate("2016-05-18").date) - self.assertEqual(inst.effectiveDateTime.as_json(), "2016-05-18") - self.assertEqual(inst.id, "eye-color") + self.assertEqual(inst.code.coding[0].code, "363779003") + self.assertEqual(inst.code.coding[0].display, "Genotype determination") + self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.code.text, "Haplotype Call") + self.assertEqual(inst.extension[0].url, "http://hl7.org/fhir/StructureDefinition/observation-geneticsGene") + self.assertEqual(inst.extension[0].valueCodeableConcept.coding[0].code, "12014") + self.assertEqual(inst.extension[0].valueCodeableConcept.coding[0].display, "TPMT") + self.assertEqual(inst.extension[0].valueCodeableConcept.coding[0].system, "http://www.genenames.org") + self.assertEqual(inst.id, "example-TPMT-haplotype-one") + self.assertEqual(inst.issued.date, FHIRDate("2013-04-03T15:30:10+01:00").date) + self.assertEqual(inst.issued.as_json(), "2013-04-03T15:30:10+01:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.status, "final") + self.assertEqual(inst.status, "unknown") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.valueString, "blue") + self.assertEqual(inst.valueCodeableConcept.coding[0].code, "PA166128347") + self.assertEqual(inst.valueCodeableConcept.coding[0].display, "*1") + self.assertEqual(inst.valueCodeableConcept.coding[0].system, "http://pharmakb.org") diff --git a/fhirclient/models/observationdefinition.py b/fhirclient/models/observationdefinition.py index 9f5d381c8..57f9952e7 100644 --- a/fhirclient/models/observationdefinition.py +++ b/fhirclient/models/observationdefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ObservationDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ObservationDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/observationdefinition_tests.py b/fhirclient/models/observationdefinition_tests.py index df5b4f66b..0a597a81f 100644 --- a/fhirclient/models/observationdefinition_tests.py +++ b/fhirclient/models/observationdefinition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/operationdefinition.py b/fhirclient/models/operationdefinition.py index 631c02626..010b750d1 100644 --- a/fhirclient/models/operationdefinition.py +++ b/fhirclient/models/operationdefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/OperationDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/OperationDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/operationdefinition_tests.py b/fhirclient/models/operationdefinition_tests.py index 9d4fac102..a4fa565b5 100644 --- a/fhirclient/models/operationdefinition_tests.py +++ b/fhirclient/models/operationdefinition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/operationoutcome.py b/fhirclient/models/operationoutcome.py index eca22f0c8..1069ebfa0 100644 --- a/fhirclient/models/operationoutcome.py +++ b/fhirclient/models/operationoutcome.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/OperationOutcome) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/OperationOutcome) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/operationoutcome_tests.py b/fhirclient/models/operationoutcome_tests.py index f1e5c7cc6..f38ca08d8 100644 --- a/fhirclient/models/operationoutcome_tests.py +++ b/fhirclient/models/operationoutcome_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return operationoutcome.OperationOutcome(js) def testOperationOutcome1(self): - inst = self.instantiate_from("operationoutcome-example-validationfail.json") + inst = self.instantiate_from("operationoutcome-example-searchfail.json") self.assertIsNotNone(inst, "Must have instantiated a OperationOutcome instance") self.implOperationOutcome1(inst) @@ -32,19 +32,18 @@ def testOperationOutcome1(self): self.implOperationOutcome1(inst2) def implOperationOutcome1(self, inst): - self.assertEqual(inst.id, "validationfail") - self.assertEqual(inst.issue[0].code, "structure") - self.assertEqual(inst.issue[0].details.text, "Error parsing resource XML (Unknown Content \"label\"") - self.assertEqual(inst.issue[0].expression[0], "Patient.identifier") - self.assertEqual(inst.issue[0].location[0], "/f:Patient/f:identifier") - self.assertEqual(inst.issue[0].severity, "error") + self.assertEqual(inst.id, "searchfail") + self.assertEqual(inst.issue[0].code, "code-invalid") + self.assertEqual(inst.issue[0].details.text, "The \"name\" parameter has the modifier \"exact\" which is not supported by this server") + self.assertEqual(inst.issue[0].location[0], "http.name:exact") + self.assertEqual(inst.issue[0].severity, "fatal") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.text.status, "generated") def testOperationOutcome2(self): - inst = self.instantiate_from("operationoutcome-example-break-the-glass.json") + inst = self.instantiate_from("operationoutcome-example-validationfail.json") self.assertIsNotNone(inst, "Must have instantiated a OperationOutcome instance") self.implOperationOutcome2(inst) @@ -54,20 +53,19 @@ def testOperationOutcome2(self): self.implOperationOutcome2(inst2) def implOperationOutcome2(self, inst): - self.assertEqual(inst.id, "break-the-glass") - self.assertEqual(inst.issue[0].code, "suppressed") - self.assertEqual(inst.issue[0].details.coding[0].code, "ETREAT") - self.assertEqual(inst.issue[0].details.coding[0].display, "Emergency Treatment") - self.assertEqual(inst.issue[0].details.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.issue[0].details.text, "Additional information may be available using the Break-The-Glass Protocol") - self.assertEqual(inst.issue[0].severity, "information") + self.assertEqual(inst.id, "validationfail") + self.assertEqual(inst.issue[0].code, "structure") + self.assertEqual(inst.issue[0].details.text, "Error parsing resource XML (Unknown Content \"label\"") + self.assertEqual(inst.issue[0].expression[0], "Patient.identifier") + self.assertEqual(inst.issue[0].location[0], "/f:Patient/f:identifier") + self.assertEqual(inst.issue[0].severity, "error") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.text.status, "generated") def testOperationOutcome3(self): - inst = self.instantiate_from("operationoutcome-example-searchfail.json") + inst = self.instantiate_from("operationoutcome-example-allok.json") self.assertIsNotNone(inst, "Must have instantiated a OperationOutcome instance") self.implOperationOutcome3(inst) @@ -77,11 +75,10 @@ def testOperationOutcome3(self): self.implOperationOutcome3(inst2) def implOperationOutcome3(self, inst): - self.assertEqual(inst.id, "searchfail") - self.assertEqual(inst.issue[0].code, "code-invalid") - self.assertEqual(inst.issue[0].details.text, "The \"name\" parameter has the modifier \"exact\" which is not supported by this server") - self.assertEqual(inst.issue[0].location[0], "http.name:exact") - self.assertEqual(inst.issue[0].severity, "fatal") + self.assertEqual(inst.id, "allok") + self.assertEqual(inst.issue[0].code, "informational") + self.assertEqual(inst.issue[0].details.text, "All OK") + self.assertEqual(inst.issue[0].severity, "information") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") @@ -131,7 +128,7 @@ def implOperationOutcome5(self, inst): self.assertEqual(inst.text.status, "generated") def testOperationOutcome6(self): - inst = self.instantiate_from("operationoutcome-example-allok.json") + inst = self.instantiate_from("operationoutcome-example-break-the-glass.json") self.assertIsNotNone(inst, "Must have instantiated a OperationOutcome instance") self.implOperationOutcome6(inst) @@ -141,9 +138,12 @@ def testOperationOutcome6(self): self.implOperationOutcome6(inst2) def implOperationOutcome6(self, inst): - self.assertEqual(inst.id, "allok") - self.assertEqual(inst.issue[0].code, "informational") - self.assertEqual(inst.issue[0].details.text, "All OK") + self.assertEqual(inst.id, "break-the-glass") + self.assertEqual(inst.issue[0].code, "suppressed") + self.assertEqual(inst.issue[0].details.coding[0].code, "ETREAT") + self.assertEqual(inst.issue[0].details.coding[0].display, "Emergency Treatment") + self.assertEqual(inst.issue[0].details.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.issue[0].details.text, "Additional information may be available using the Break-The-Glass Protocol") self.assertEqual(inst.issue[0].severity, "information") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") diff --git a/fhirclient/models/organization.py b/fhirclient/models/organization.py index 81f597e7a..06ce80967 100644 --- a/fhirclient/models/organization.py +++ b/fhirclient/models/organization.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Organization) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Organization) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/organization_tests.py b/fhirclient/models/organization_tests.py index 427015693..8430ecffd 100644 --- a/fhirclient/models/organization_tests.py +++ b/fhirclient/models/organization_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return organization.Organization(js) def testOrganization1(self): - inst = self.instantiate_from("organization-example.json") + inst = self.instantiate_from("organization-example-f201-aumc.json") self.assertIsNotNone(inst, "Must have instantiated a Organization instance") self.implOrganization1(inst) @@ -32,24 +32,46 @@ def testOrganization1(self): self.implOrganization1(inst2) def implOrganization1(self, inst): - self.assertEqual(inst.address[0].city, "Ann Arbor") - self.assertEqual(inst.address[0].country, "USA") - self.assertEqual(inst.address[0].line[0], "3300 Washtenaw Avenue, Suite 227") - self.assertEqual(inst.address[0].postalCode, "48104") - self.assertEqual(inst.address[0].state, "MI") - self.assertEqual(inst.alias[0], "HL7 International") - self.assertEqual(inst.id, "hl7") + self.assertTrue(inst.active) + self.assertEqual(inst.address[0].city, "Den Helder") + self.assertEqual(inst.address[0].country, "NLD") + self.assertEqual(inst.address[0].line[0], "Walvisbaai 3") + self.assertEqual(inst.address[0].postalCode, "2333ZA") + self.assertEqual(inst.address[0].use, "work") + self.assertEqual(inst.contact[0].address.city, "Den helder") + self.assertEqual(inst.contact[0].address.country, "NLD") + self.assertEqual(inst.contact[0].address.line[0], "Walvisbaai 3") + self.assertEqual(inst.contact[0].address.line[1], "Gebouw 2") + self.assertEqual(inst.contact[0].address.postalCode, "2333ZA") + self.assertEqual(inst.contact[0].name.family, "Brand") + self.assertEqual(inst.contact[0].name.given[0], "Ronald") + self.assertEqual(inst.contact[0].name.prefix[0], "Prof.Dr.") + self.assertEqual(inst.contact[0].name.text, "Professor Brand") + self.assertEqual(inst.contact[0].name.use, "official") + self.assertEqual(inst.contact[0].telecom[0].system, "phone") + self.assertEqual(inst.contact[0].telecom[0].use, "work") + self.assertEqual(inst.contact[0].telecom[0].value, "+31715269702") + self.assertEqual(inst.id, "f201") + self.assertEqual(inst.identifier[0].system, "http://www.zorgkaartnederland.nl/") + self.assertEqual(inst.identifier[0].use, "official") + self.assertEqual(inst.identifier[0].value, "Artis University Medical Center") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "Health Level Seven International") + self.assertEqual(inst.name, "Artis University Medical Center (AUMC)") self.assertEqual(inst.telecom[0].system, "phone") - self.assertEqual(inst.telecom[0].value, "(+1) 734-677-7777") - self.assertEqual(inst.telecom[1].system, "fax") - self.assertEqual(inst.telecom[1].value, "(+1) 734-677-6622") - self.assertEqual(inst.telecom[2].system, "email") - self.assertEqual(inst.telecom[2].value, "hq@HL7.org") + self.assertEqual(inst.telecom[0].use, "work") + self.assertEqual(inst.telecom[0].value, "+31715269111") self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.type[0].coding[0].code, "405608006") + self.assertEqual(inst.type[0].coding[0].display, "Academic Medical Center") + self.assertEqual(inst.type[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.type[0].coding[1].code, "V6") + self.assertEqual(inst.type[0].coding[1].display, "University Medical Hospital") + self.assertEqual(inst.type[0].coding[1].system, "urn:oid:2.16.840.1.113883.2.4.15.1060") + self.assertEqual(inst.type[0].coding[2].code, "prov") + self.assertEqual(inst.type[0].coding[2].display, "Healthcare Provider") + self.assertEqual(inst.type[0].coding[2].system, "http://terminology.hl7.org/CodeSystem/organization-type") def testOrganization2(self): inst = self.instantiate_from("organization-example-mmanu.json") @@ -72,7 +94,7 @@ def implOrganization2(self, inst): self.assertEqual(inst.text.status, "generated") def testOrganization3(self): - inst = self.instantiate_from("organization-example-gastro.json") + inst = self.instantiate_from("organization-example-good-health-care.json") self.assertIsNotNone(inst, "Must have instantiated a Organization instance") self.implOrganization3(inst) @@ -82,23 +104,17 @@ def testOrganization3(self): self.implOrganization3(inst2) def implOrganization3(self, inst): - self.assertEqual(inst.id, "1") - self.assertEqual(inst.identifier[0].system, "http://www.acme.org.au/units") - self.assertEqual(inst.identifier[0].value, "Gastro") + self.assertEqual(inst.id, "2.16.840.1.113883.19.5") + self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") + self.assertEqual(inst.identifier[0].value, "2.16.840.1.113883.19.5") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "Gastroenterology") - self.assertEqual(inst.telecom[0].system, "phone") - self.assertEqual(inst.telecom[0].use, "mobile") - self.assertEqual(inst.telecom[0].value, "+1 555 234 3523") - self.assertEqual(inst.telecom[1].system, "email") - self.assertEqual(inst.telecom[1].use, "work") - self.assertEqual(inst.telecom[1].value, "gastro@acme.org") + self.assertEqual(inst.name, "Good Health Clinic") self.assertEqual(inst.text.status, "generated") def testOrganization4(self): - inst = self.instantiate_from("organization-example-mihealth.json") + inst = self.instantiate_from("organization-example-gastro.json") self.assertIsNotNone(inst, "Must have instantiated a Organization instance") self.implOrganization4(inst) @@ -108,18 +124,23 @@ def testOrganization4(self): self.implOrganization4(inst2) def implOrganization4(self, inst): - self.assertEqual(inst.alias[0], "Michigan State Department of Health") - self.assertEqual(inst.id, "3") - self.assertEqual(inst.identifier[0].system, "http://michigan.gov/state-dept-ids") - self.assertEqual(inst.identifier[0].value, "25") + self.assertEqual(inst.id, "1") + self.assertEqual(inst.identifier[0].system, "http://www.acme.org.au/units") + self.assertEqual(inst.identifier[0].value, "Gastro") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "Michigan Health") + self.assertEqual(inst.name, "Gastroenterology") + self.assertEqual(inst.telecom[0].system, "phone") + self.assertEqual(inst.telecom[0].use, "mobile") + self.assertEqual(inst.telecom[0].value, "+1 555 234 3523") + self.assertEqual(inst.telecom[1].system, "email") + self.assertEqual(inst.telecom[1].use, "work") + self.assertEqual(inst.telecom[1].value, "gastro@acme.org") self.assertEqual(inst.text.status, "generated") def testOrganization5(self): - inst = self.instantiate_from("organization-example-lab.json") + inst = self.instantiate_from("organization-example-mihealth.json") self.assertIsNotNone(inst, "Must have instantiated a Organization instance") self.implOrganization5(inst) @@ -129,23 +150,18 @@ def testOrganization5(self): self.implOrganization5(inst2) def implOrganization5(self, inst): - self.assertEqual(inst.id, "1832473e-2fe0-452d-abe9-3cdb9879522f") - self.assertEqual(inst.identifier[0].system, "http://www.acme.org.au/units") - self.assertEqual(inst.identifier[0].value, "ClinLab") + self.assertEqual(inst.alias[0], "Michigan State Department of Health") + self.assertEqual(inst.id, "3") + self.assertEqual(inst.identifier[0].system, "http://michigan.gov/state-dept-ids") + self.assertEqual(inst.identifier[0].value, "25") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "Clinical Lab") - self.assertEqual(inst.telecom[0].system, "phone") - self.assertEqual(inst.telecom[0].use, "work") - self.assertEqual(inst.telecom[0].value, "+1 555 234 1234") - self.assertEqual(inst.telecom[1].system, "email") - self.assertEqual(inst.telecom[1].use, "work") - self.assertEqual(inst.telecom[1].value, "contact@labs.acme.org") + self.assertEqual(inst.name, "Michigan Health") self.assertEqual(inst.text.status, "generated") def testOrganization6(self): - inst = self.instantiate_from("organization-example-f002-burgers-card.json") + inst = self.instantiate_from("organization-example-insurer.json") self.assertIsNotNone(inst, "Must have instantiated a Organization instance") self.implOrganization6(inst) @@ -155,32 +171,18 @@ def testOrganization6(self): self.implOrganization6(inst2) def implOrganization6(self, inst): - self.assertTrue(inst.active) - self.assertEqual(inst.address[0].line[0], "South Wing, floor 2") - self.assertEqual(inst.contact[0].address.line[0], "South Wing, floor 2") - self.assertEqual(inst.contact[0].name.text, "mevr. D. de Haan") - self.assertEqual(inst.contact[0].purpose.coding[0].code, "ADMIN") - self.assertEqual(inst.contact[0].purpose.coding[0].system, "http://terminology.hl7.org/CodeSystem/contactentity-type") - self.assertEqual(inst.contact[0].telecom[0].system, "phone") - self.assertEqual(inst.contact[0].telecom[0].value, "022-655 2321") - self.assertEqual(inst.contact[0].telecom[1].system, "email") - self.assertEqual(inst.contact[0].telecom[1].value, "cardio@burgersumc.nl") - self.assertEqual(inst.contact[0].telecom[2].system, "fax") - self.assertEqual(inst.contact[0].telecom[2].value, "022-655 2322") - self.assertEqual(inst.id, "f002") + self.assertEqual(inst.alias[0], "ABC Insurance") + self.assertEqual(inst.id, "2") + self.assertEqual(inst.identifier[0].system, "urn:oid:2.16.840.1.113883.3.19.2.3") + self.assertEqual(inst.identifier[0].value, "666666") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "Burgers UMC Cardiology unit") - self.assertEqual(inst.telecom[0].system, "phone") - self.assertEqual(inst.telecom[0].value, "022-655 2320") + self.assertEqual(inst.name, "XYZ Insurance") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type[0].coding[0].code, "dept") - self.assertEqual(inst.type[0].coding[0].display, "Hospital Department") - self.assertEqual(inst.type[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/organization-type") def testOrganization7(self): - inst = self.instantiate_from("organization-example-f201-aumc.json") + inst = self.instantiate_from("organization-example-f003-burgers-ENT.json") self.assertIsNotNone(inst, "Must have instantiated a Organization instance") self.implOrganization7(inst) @@ -191,48 +193,31 @@ def testOrganization7(self): def implOrganization7(self, inst): self.assertTrue(inst.active) - self.assertEqual(inst.address[0].city, "Den Helder") - self.assertEqual(inst.address[0].country, "NLD") - self.assertEqual(inst.address[0].line[0], "Walvisbaai 3") - self.assertEqual(inst.address[0].postalCode, "2333ZA") - self.assertEqual(inst.address[0].use, "work") - self.assertEqual(inst.contact[0].address.city, "Den helder") - self.assertEqual(inst.contact[0].address.country, "NLD") - self.assertEqual(inst.contact[0].address.line[0], "Walvisbaai 3") - self.assertEqual(inst.contact[0].address.line[1], "Gebouw 2") - self.assertEqual(inst.contact[0].address.postalCode, "2333ZA") - self.assertEqual(inst.contact[0].name.family, "Brand") - self.assertEqual(inst.contact[0].name.given[0], "Ronald") - self.assertEqual(inst.contact[0].name.prefix[0], "Prof.Dr.") - self.assertEqual(inst.contact[0].name.text, "Professor Brand") - self.assertEqual(inst.contact[0].name.use, "official") + self.assertEqual(inst.address[0].line[0], "West Wing, floor 5") + self.assertEqual(inst.contact[0].address.line[0], "West Wing, floor 5") + self.assertEqual(inst.contact[0].name.text, "mr. F. de Hond") + self.assertEqual(inst.contact[0].purpose.coding[0].code, "ADMIN") + self.assertEqual(inst.contact[0].purpose.coding[0].system, "http://terminology.hl7.org/CodeSystem/contactentity-type") self.assertEqual(inst.contact[0].telecom[0].system, "phone") - self.assertEqual(inst.contact[0].telecom[0].use, "work") - self.assertEqual(inst.contact[0].telecom[0].value, "+31715269702") - self.assertEqual(inst.id, "f201") - self.assertEqual(inst.identifier[0].system, "http://www.zorgkaartnederland.nl/") - self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "Artis University Medical Center") + self.assertEqual(inst.contact[0].telecom[0].value, "022-655 7654") + self.assertEqual(inst.contact[0].telecom[1].system, "email") + self.assertEqual(inst.contact[0].telecom[1].value, "KNO@burgersumc.nl") + self.assertEqual(inst.contact[0].telecom[2].system, "fax") + self.assertEqual(inst.contact[0].telecom[2].value, "022-655 0998") + self.assertEqual(inst.id, "f003") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "Artis University Medical Center (AUMC)") + self.assertEqual(inst.name, "Burgers UMC Ear,Nose,Throat unit") self.assertEqual(inst.telecom[0].system, "phone") - self.assertEqual(inst.telecom[0].use, "work") - self.assertEqual(inst.telecom[0].value, "+31715269111") + self.assertEqual(inst.telecom[0].value, "022-655 6780") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type[0].coding[0].code, "405608006") - self.assertEqual(inst.type[0].coding[0].display, "Academic Medical Center") - self.assertEqual(inst.type[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.type[0].coding[1].code, "V6") - self.assertEqual(inst.type[0].coding[1].display, "University Medical Hospital") - self.assertEqual(inst.type[0].coding[1].system, "urn:oid:2.16.840.1.113883.2.4.15.1060") - self.assertEqual(inst.type[0].coding[2].code, "prov") - self.assertEqual(inst.type[0].coding[2].display, "Healthcare Provider") - self.assertEqual(inst.type[0].coding[2].system, "http://terminology.hl7.org/CodeSystem/organization-type") + self.assertEqual(inst.type[0].coding[0].code, "dept") + self.assertEqual(inst.type[0].coding[0].display, "Hospital Department") + self.assertEqual(inst.type[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/organization-type") def testOrganization8(self): - inst = self.instantiate_from("organization-example-good-health-care.json") + inst = self.instantiate_from("organization-example-f002-burgers-card.json") self.assertIsNotNone(inst, "Must have instantiated a Organization instance") self.implOrganization8(inst) @@ -242,17 +227,32 @@ def testOrganization8(self): self.implOrganization8(inst2) def implOrganization8(self, inst): - self.assertEqual(inst.id, "2.16.840.1.113883.19.5") - self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") - self.assertEqual(inst.identifier[0].value, "2.16.840.1.113883.19.5") + self.assertTrue(inst.active) + self.assertEqual(inst.address[0].line[0], "South Wing, floor 2") + self.assertEqual(inst.contact[0].address.line[0], "South Wing, floor 2") + self.assertEqual(inst.contact[0].name.text, "mevr. D. de Haan") + self.assertEqual(inst.contact[0].purpose.coding[0].code, "ADMIN") + self.assertEqual(inst.contact[0].purpose.coding[0].system, "http://terminology.hl7.org/CodeSystem/contactentity-type") + self.assertEqual(inst.contact[0].telecom[0].system, "phone") + self.assertEqual(inst.contact[0].telecom[0].value, "022-655 2321") + self.assertEqual(inst.contact[0].telecom[1].system, "email") + self.assertEqual(inst.contact[0].telecom[1].value, "cardio@burgersumc.nl") + self.assertEqual(inst.contact[0].telecom[2].system, "fax") + self.assertEqual(inst.contact[0].telecom[2].value, "022-655 2322") + self.assertEqual(inst.id, "f002") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "Good Health Clinic") + self.assertEqual(inst.name, "Burgers UMC Cardiology unit") + self.assertEqual(inst.telecom[0].system, "phone") + self.assertEqual(inst.telecom[0].value, "022-655 2320") self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.type[0].coding[0].code, "dept") + self.assertEqual(inst.type[0].coding[0].display, "Hospital Department") + self.assertEqual(inst.type[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/organization-type") def testOrganization9(self): - inst = self.instantiate_from("organization-example-f001-burgers.json") + inst = self.instantiate_from("organization-example-lab.json") self.assertIsNotNone(inst, "Must have instantiated a Organization instance") self.implOrganization9(inst) @@ -262,48 +262,23 @@ def testOrganization9(self): self.implOrganization9(inst2) def implOrganization9(self, inst): - self.assertEqual(inst.address[0].city, "Den Burg") - self.assertEqual(inst.address[0].country, "NLD") - self.assertEqual(inst.address[0].line[0], "Galapagosweg 91") - self.assertEqual(inst.address[0].postalCode, "9105 PZ") - self.assertEqual(inst.address[0].use, "work") - self.assertEqual(inst.address[1].city, "Den Burg") - self.assertEqual(inst.address[1].country, "NLD") - self.assertEqual(inst.address[1].line[0], "PO Box 2311") - self.assertEqual(inst.address[1].postalCode, "9100 AA") - self.assertEqual(inst.address[1].use, "work") - self.assertEqual(inst.contact[0].purpose.coding[0].code, "PRESS") - self.assertEqual(inst.contact[0].purpose.coding[0].system, "http://terminology.hl7.org/CodeSystem/contactentity-type") - self.assertEqual(inst.contact[0].telecom[0].system, "phone") - self.assertEqual(inst.contact[0].telecom[0].value, "022-655 2334") - self.assertEqual(inst.contact[1].purpose.coding[0].code, "PATINF") - self.assertEqual(inst.contact[1].purpose.coding[0].system, "http://terminology.hl7.org/CodeSystem/contactentity-type") - self.assertEqual(inst.contact[1].telecom[0].system, "phone") - self.assertEqual(inst.contact[1].telecom[0].value, "022-655 2335") - self.assertEqual(inst.id, "f001") - self.assertEqual(inst.identifier[0].system, "urn:oid:2.16.528.1") - self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "91654") - self.assertEqual(inst.identifier[1].system, "urn:oid:2.16.840.1.113883.2.4.6.1") - self.assertEqual(inst.identifier[1].use, "usual") - self.assertEqual(inst.identifier[1].value, "17-0112278") + self.assertEqual(inst.id, "1832473e-2fe0-452d-abe9-3cdb9879522f") + self.assertEqual(inst.identifier[0].system, "http://www.acme.org.au/units") + self.assertEqual(inst.identifier[0].value, "ClinLab") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "Burgers University Medical Center") + self.assertEqual(inst.name, "Clinical Lab") self.assertEqual(inst.telecom[0].system, "phone") self.assertEqual(inst.telecom[0].use, "work") - self.assertEqual(inst.telecom[0].value, "022-655 2300") + self.assertEqual(inst.telecom[0].value, "+1 555 234 1234") + self.assertEqual(inst.telecom[1].system, "email") + self.assertEqual(inst.telecom[1].use, "work") + self.assertEqual(inst.telecom[1].value, "contact@labs.acme.org") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type[0].coding[0].code, "V6") - self.assertEqual(inst.type[0].coding[0].display, "University Medical Hospital") - self.assertEqual(inst.type[0].coding[0].system, "urn:oid:2.16.840.1.113883.2.4.15.1060") - self.assertEqual(inst.type[0].coding[1].code, "prov") - self.assertEqual(inst.type[0].coding[1].display, "Healthcare Provider") - self.assertEqual(inst.type[0].coding[1].system, "http://terminology.hl7.org/CodeSystem/organization-type") def testOrganization10(self): - inst = self.instantiate_from("organization-example-insurer.json") + inst = self.instantiate_from("organization-example-f203-bumc.json") self.assertIsNotNone(inst, "Must have instantiated a Organization instance") self.implOrganization10(inst) @@ -313,13 +288,28 @@ def testOrganization10(self): self.implOrganization10(inst2) def implOrganization10(self, inst): - self.assertEqual(inst.alias[0], "ABC Insurance") - self.assertEqual(inst.id, "2") - self.assertEqual(inst.identifier[0].system, "urn:oid:2.16.840.1.113883.3.19.2.3") - self.assertEqual(inst.identifier[0].value, "666666") + self.assertTrue(inst.active) + self.assertEqual(inst.address[0].city, "Blijdorp") + self.assertEqual(inst.address[0].country, "NLD") + self.assertEqual(inst.address[0].line[0], "apenrots 230") + self.assertEqual(inst.address[0].postalCode, "3056BE") + self.assertEqual(inst.address[0].use, "work") + self.assertEqual(inst.id, "f203") + self.assertEqual(inst.identifier[0].system, "http://www.zorgkaartnederland.nl/") + self.assertEqual(inst.identifier[0].type.text, "Zorginstelling naam") + self.assertEqual(inst.identifier[0].use, "official") + self.assertEqual(inst.identifier[0].value, "Blijdorp MC") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name, "XYZ Insurance") + self.assertEqual(inst.name, "Blijdorp Medisch Centrum (BUMC)") + self.assertEqual(inst.telecom[0].system, "phone") + self.assertEqual(inst.telecom[0].use, "work") + self.assertEqual(inst.telecom[0].value, "+31107040704") self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.type[0].coding[0].code, "405608006") + self.assertEqual(inst.type[0].coding[0].display, "Academic Medical Center") + self.assertEqual(inst.type[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.type[0].coding[1].code, "prov") + self.assertEqual(inst.type[0].coding[1].system, "http://terminology.hl7.org/CodeSystem/organization-type") diff --git a/fhirclient/models/organizationaffiliation.py b/fhirclient/models/organizationaffiliation.py index 208ee27b2..3234dd001 100644 --- a/fhirclient/models/organizationaffiliation.py +++ b/fhirclient/models/organizationaffiliation.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/organizationaffiliation_tests.py b/fhirclient/models/organizationaffiliation_tests.py index 548c9d7c8..008a9f7cb 100644 --- a/fhirclient/models/organizationaffiliation_tests.py +++ b/fhirclient/models/organizationaffiliation_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/parameterdefinition.py b/fhirclient/models/parameterdefinition.py index 4fee7da5c..47a8df20b 100644 --- a/fhirclient/models/parameterdefinition.py +++ b/fhirclient/models/parameterdefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ParameterDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ParameterDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/parameters.py b/fhirclient/models/parameters.py index 94c960c03..da45cedf4 100644 --- a/fhirclient/models/parameters.py +++ b/fhirclient/models/parameters.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Parameters) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Parameters) on 2024-07-15. +# 2024, SMART Health IT. from . import resource @@ -181,6 +181,10 @@ def __init__(self, jsondict=None, strict=True): """ If parameter is a data type. Type `str`. """ + self.valueMeta = None + """ If parameter is a data type. + Type `Meta` (represented as `dict` in JSON). """ + self.valueMoney = None """ If parameter is a data type. Type `Money` (represented as `dict` in JSON). """ @@ -301,6 +305,7 @@ def elementProperties(self): ("valueInstant", "valueInstant", fhirdate.FHIRDate, False, "value", False), ("valueInteger", "valueInteger", int, False, "value", False), ("valueMarkdown", "valueMarkdown", str, False, "value", False), + ("valueMeta", "valueMeta", meta.Meta, False, "value", False), ("valueMoney", "valueMoney", money.Money, False, "value", False), ("valueOid", "valueOid", str, False, "value", False), ("valueParameterDefinition", "valueParameterDefinition", parameterdefinition.ParameterDefinition, False, "value", False), @@ -403,6 +408,10 @@ def elementProperties(self): from . import identifier except ImportError: identifier = sys.modules[__package__ + '.identifier'] +try: + from . import meta +except ImportError: + meta = sys.modules[__package__ + '.meta'] try: from . import money except ImportError: diff --git a/fhirclient/models/parameters_tests.py b/fhirclient/models/parameters_tests.py index 77a208788..c744a052f 100644 --- a/fhirclient/models/parameters_tests.py +++ b/fhirclient/models/parameters_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/patient.py b/fhirclient/models/patient.py index 325db4a26..efd54a28d 100644 --- a/fhirclient/models/patient.py +++ b/fhirclient/models/patient.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Patient) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Patient) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/patient_tests.py b/fhirclient/models/patient_tests.py index d7c07ae5d..4b9735488 100644 --- a/fhirclient/models/patient_tests.py +++ b/fhirclient/models/patient_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return patient.Patient(js) def testPatient1(self): - inst = self.instantiate_from("patient-example-xds.json") + inst = self.instantiate_from("patient-example-a.json") self.assertIsNotNone(inst, "Must have instantiated a Patient instance") self.implPatient1(inst) @@ -33,25 +33,23 @@ def testPatient1(self): def implPatient1(self, inst): self.assertTrue(inst.active) - self.assertEqual(inst.address[0].city, "Metropolis") - self.assertEqual(inst.address[0].country, "USA") - self.assertEqual(inst.address[0].line[0], "100 Main St") - self.assertEqual(inst.address[0].postalCode, "44130") - self.assertEqual(inst.address[0].state, "Il") - self.assertEqual(inst.birthDate.date, FHIRDate("1956-05-27").date) - self.assertEqual(inst.birthDate.as_json(), "1956-05-27") + self.assertEqual(inst.contact[0].relationship[0].coding[0].code, "E") + self.assertEqual(inst.contact[0].relationship[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0131") self.assertEqual(inst.gender, "male") - self.assertEqual(inst.id, "xds") - self.assertEqual(inst.identifier[0].system, "urn:oid:1.2.3.4.5") + self.assertEqual(inst.id, "pat1") + self.assertEqual(inst.identifier[0].system, "urn:oid:0.1.2.3.4.5.6.7") self.assertEqual(inst.identifier[0].type.coding[0].code, "MR") self.assertEqual(inst.identifier[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0203") self.assertEqual(inst.identifier[0].use, "usual") - self.assertEqual(inst.identifier[0].value, "89765a87b") + self.assertEqual(inst.identifier[0].value, "654321") + self.assertEqual(inst.link[0].type, "seealso") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].family, "Doe") - self.assertEqual(inst.name[0].given[0], "John") + self.assertEqual(inst.name[0].family, "Donald") + self.assertEqual(inst.name[0].given[0], "Duck") + self.assertEqual(inst.name[0].use, "official") + self.assertEqual(inst.photo[0].contentType, "image/gif") self.assertEqual(inst.text.status, "generated") def testPatient2(self): @@ -115,7 +113,7 @@ def implPatient2(self, inst): self.assertEqual(inst.text.status, "generated") def testPatient3(self): - inst = self.instantiate_from("patient-example-d.json") + inst = self.instantiate_from("patient-example-xcda.json") self.assertIsNotNone(inst, "Must have instantiated a Patient instance") self.implPatient3(inst) @@ -126,26 +124,24 @@ def testPatient3(self): def implPatient3(self, inst): self.assertTrue(inst.active) - self.assertEqual(inst.birthDate.date, FHIRDate("1982-08-02").date) - self.assertEqual(inst.birthDate.as_json(), "1982-08-02") - self.assertTrue(inst.deceasedBoolean) - self.assertEqual(inst.gender, "female") - self.assertEqual(inst.id, "pat4") - self.assertEqual(inst.identifier[0].system, "urn:oid:0.1.2.3.4.5.6.7") + self.assertEqual(inst.birthDate.date, FHIRDate("1932-09-24").date) + self.assertEqual(inst.birthDate.as_json(), "1932-09-24") + self.assertEqual(inst.gender, "male") + self.assertEqual(inst.id, "xcda") + self.assertEqual(inst.identifier[0].system, "urn:oid:2.16.840.1.113883.19.5") self.assertEqual(inst.identifier[0].type.coding[0].code, "MR") self.assertEqual(inst.identifier[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0203") self.assertEqual(inst.identifier[0].use, "usual") - self.assertEqual(inst.identifier[0].value, "123458") + self.assertEqual(inst.identifier[0].value, "12345") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].family, "Notsowell") - self.assertEqual(inst.name[0].given[0], "Sandy") - self.assertEqual(inst.name[0].use, "official") + self.assertEqual(inst.name[0].family, "Levin") + self.assertEqual(inst.name[0].given[0], "Henry") self.assertEqual(inst.text.status, "generated") def testPatient4(self): - inst = self.instantiate_from("patient-example-infant-twin-1.json") + inst = self.instantiate_from("patient-example-newborn.json") self.assertIsNotNone(inst, "Must have instantiated a Patient instance") self.implPatient4(inst) @@ -155,42 +151,20 @@ def testPatient4(self): self.implPatient4(inst2) def implPatient4(self, inst): - self.assertEqual(inst.birthDate.date, FHIRDate("2017-05-15").date) - self.assertEqual(inst.birthDate.as_json(), "2017-05-15") - self.assertEqual(inst.contact[0].name.family, "Organa") - self.assertEqual(inst.contact[0].name.given[0], "Leia") - self.assertEqual(inst.contact[0].name.use, "maiden") - self.assertEqual(inst.contact[0].relationship[0].coding[0].code, "72705000") - self.assertEqual(inst.contact[0].relationship[0].coding[0].display, "Mother") - self.assertEqual(inst.contact[0].relationship[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.contact[0].relationship[0].coding[1].code, "N") - self.assertEqual(inst.contact[0].relationship[0].coding[1].system, "http://terminology.hl7.org/CodeSystem/v2-0131") - self.assertEqual(inst.contact[0].relationship[0].coding[2].code, "MTH") - self.assertEqual(inst.contact[0].relationship[0].coding[2].system, "http://terminology.hl7.org/CodeSystem/v3-RoleCode") - self.assertEqual(inst.contact[0].telecom[0].system, "phone") - self.assertEqual(inst.contact[0].telecom[0].use, "mobile") - self.assertEqual(inst.contact[0].telecom[0].value, "+31201234567") + self.assertEqual(inst.birthDate.date, FHIRDate("2017-09-05").date) + self.assertEqual(inst.birthDate.as_json(), "2017-09-05") self.assertEqual(inst.extension[0].url, "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName") - self.assertEqual(inst.extension[0].valueString, "Organa") - self.assertEqual(inst.gender, "female") - self.assertEqual(inst.id, "infant-twin-1") - self.assertEqual(inst.identifier[0].system, "http://coruscanthealth.org/main-hospital/patient-identifier") - self.assertEqual(inst.identifier[0].type.coding[0].code, "MR") - self.assertEqual(inst.identifier[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0203") - self.assertEqual(inst.identifier[0].value, "MRN7465737865") - self.assertEqual(inst.identifier[1].system, "http://new-republic.gov/galactic-citizen-identifier") - self.assertEqual(inst.identifier[1].value, "7465737865") + self.assertEqual(inst.extension[0].valueString, "Everywoman") + self.assertEqual(inst.gender, "male") + self.assertEqual(inst.id, "newborn") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.multipleBirthInteger, 1) - self.assertEqual(inst.name[0].family, "Solo") - self.assertEqual(inst.name[0].given[0], "Jaina") - self.assertEqual(inst.name[0].use, "official") + self.assertEqual(inst.multipleBirthInteger, 2) self.assertEqual(inst.text.status, "generated") def testPatient5(self): - inst = self.instantiate_from("patient-example-infant-mom.json") + inst = self.instantiate_from("patient-example-animal.json") self.assertIsNotNone(inst, "Must have instantiated a Patient instance") self.implPatient5(inst) @@ -200,6 +174,57 @@ def testPatient5(self): self.implPatient5(inst2) def implPatient5(self, inst): + self.assertTrue(inst.active) + self.assertEqual(inst.birthDate.date, FHIRDate("2010-03-23").date) + self.assertEqual(inst.birthDate.as_json(), "2010-03-23") + self.assertEqual(inst.contact[0].name.family, "Chalmers") + self.assertEqual(inst.contact[0].name.given[0], "Peter") + self.assertEqual(inst.contact[0].name.given[1], "James") + self.assertEqual(inst.contact[0].relationship[0].coding[0].code, "C") + self.assertEqual(inst.contact[0].relationship[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0131") + self.assertEqual(inst.contact[0].telecom[0].system, "phone") + self.assertEqual(inst.contact[0].telecom[0].use, "work") + self.assertEqual(inst.contact[0].telecom[0].value, "(03) 5555 6473") + self.assertEqual(inst.extension[0].extension[0].url, "species") + self.assertEqual(inst.extension[0].extension[0].valueCodeableConcept.coding[0].code, "canislf") + self.assertEqual(inst.extension[0].extension[0].valueCodeableConcept.coding[0].display, "Dog") + self.assertEqual(inst.extension[0].extension[0].valueCodeableConcept.coding[0].system, "http://hl7.org/fhir/animal-species") + self.assertEqual(inst.extension[0].extension[1].url, "breed") + self.assertEqual(inst.extension[0].extension[1].valueCodeableConcept.coding[0].code, "58108001") + self.assertEqual(inst.extension[0].extension[1].valueCodeableConcept.coding[0].display, "Golden retriever") + self.assertEqual(inst.extension[0].extension[1].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.extension[0].extension[1].valueCodeableConcept.coding[1].code, "gret") + self.assertEqual(inst.extension[0].extension[1].valueCodeableConcept.coding[1].display, "Golden Retriever") + self.assertEqual(inst.extension[0].extension[1].valueCodeableConcept.coding[1].system, "http://example.org/fhir/CodeSystem/animal-breed") + self.assertEqual(inst.extension[0].extension[2].url, "genderStatus") + self.assertEqual(inst.extension[0].extension[2].valueCodeableConcept.coding[0].code, "neutered") + self.assertEqual(inst.extension[0].extension[2].valueCodeableConcept.coding[0].system, "http://hl7.org/fhir/animal-genderstatus") + self.assertEqual(inst.extension[0].url, "http://hl7.org/fhir/StructureDefinition/patient-animal") + self.assertEqual(inst.gender, "female") + self.assertEqual(inst.id, "animal") + self.assertEqual(inst.identifier[0].period.start.date, FHIRDate("2010-05-31").date) + self.assertEqual(inst.identifier[0].period.start.as_json(), "2010-05-31") + self.assertEqual(inst.identifier[0].system, "http://www.maroondah.vic.gov.au/AnimalRegFees.aspx") + self.assertEqual(inst.identifier[0].type.text, "Dog Tag") + self.assertEqual(inst.identifier[0].value, "1234123") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.name[0].given[0], "Kenzi") + self.assertEqual(inst.name[0].use, "usual") + self.assertEqual(inst.text.status, "generated") + + def testPatient6(self): + inst = self.instantiate_from("patient-example-infant-mom.json") + self.assertIsNotNone(inst, "Must have instantiated a Patient instance") + self.implPatient6(inst) + + js = inst.as_json() + self.assertEqual("Patient", js["resourceType"]) + inst2 = patient.Patient(js) + self.implPatient6(inst2) + + def implPatient6(self, inst): self.assertEqual(inst.birthDate.date, FHIRDate("1995-10-12").date) self.assertEqual(inst.birthDate.as_json(), "1995-10-12") self.assertEqual(inst.gender, "female") @@ -218,40 +243,102 @@ def implPatient5(self, inst): self.assertEqual(inst.name[1].use, "maiden") self.assertEqual(inst.text.status, "generated") - def testPatient6(self): - inst = self.instantiate_from("patient-example-newborn.json") + def testPatient7(self): + inst = self.instantiate_from("patient-example.json") self.assertIsNotNone(inst, "Must have instantiated a Patient instance") - self.implPatient6(inst) + self.implPatient7(inst) js = inst.as_json() self.assertEqual("Patient", js["resourceType"]) inst2 = patient.Patient(js) - self.implPatient6(inst2) + self.implPatient7(inst2) - def implPatient6(self, inst): - self.assertEqual(inst.birthDate.date, FHIRDate("2017-09-05").date) - self.assertEqual(inst.birthDate.as_json(), "2017-09-05") - self.assertEqual(inst.extension[0].url, "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName") - self.assertEqual(inst.extension[0].valueString, "Everywoman") + def implPatient7(self, inst): + self.assertTrue(inst.active) + self.assertEqual(inst.address[0].city, "PleasantVille") + self.assertEqual(inst.address[0].district, "Rainbow") + self.assertEqual(inst.address[0].line[0], "534 Erewhon St") + self.assertEqual(inst.address[0].period.start.date, FHIRDate("1974-12-25").date) + self.assertEqual(inst.address[0].period.start.as_json(), "1974-12-25") + self.assertEqual(inst.address[0].postalCode, "3999") + self.assertEqual(inst.address[0].state, "Vic") + self.assertEqual(inst.address[0].text, "534 Erewhon St PeasantVille, Rainbow, Vic 3999") + self.assertEqual(inst.address[0].type, "both") + self.assertEqual(inst.address[0].use, "home") + self.assertEqual(inst.birthDate.date, FHIRDate("1974-12-25").date) + self.assertEqual(inst.birthDate.as_json(), "1974-12-25") + self.assertEqual(inst.contact[0].address.city, "PleasantVille") + self.assertEqual(inst.contact[0].address.district, "Rainbow") + self.assertEqual(inst.contact[0].address.line[0], "534 Erewhon St") + self.assertEqual(inst.contact[0].address.period.start.date, FHIRDate("1974-12-25").date) + self.assertEqual(inst.contact[0].address.period.start.as_json(), "1974-12-25") + self.assertEqual(inst.contact[0].address.postalCode, "3999") + self.assertEqual(inst.contact[0].address.state, "Vic") + self.assertEqual(inst.contact[0].address.type, "both") + self.assertEqual(inst.contact[0].address.use, "home") + self.assertEqual(inst.contact[0].gender, "female") + self.assertEqual(inst.contact[0].name.family, "du Marché") + self.assertEqual(inst.contact[0].name.given[0], "Bénédicte") + self.assertEqual(inst.contact[0].period.start.date, FHIRDate("2012").date) + self.assertEqual(inst.contact[0].period.start.as_json(), "2012") + self.assertEqual(inst.contact[0].relationship[0].coding[0].code, "N") + self.assertEqual(inst.contact[0].relationship[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0131") + self.assertEqual(inst.contact[0].telecom[0].system, "phone") + self.assertEqual(inst.contact[0].telecom[0].value, "+33 (237) 998327") + self.assertFalse(inst.deceasedBoolean) self.assertEqual(inst.gender, "male") - self.assertEqual(inst.id, "newborn") + self.assertEqual(inst.id, "example") + self.assertEqual(inst.identifier[0].period.start.date, FHIRDate("2001-05-06").date) + self.assertEqual(inst.identifier[0].period.start.as_json(), "2001-05-06") + self.assertEqual(inst.identifier[0].system, "urn:oid:1.2.36.146.595.217.0.1") + self.assertEqual(inst.identifier[0].type.coding[0].code, "MR") + self.assertEqual(inst.identifier[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0203") + self.assertEqual(inst.identifier[0].use, "usual") + self.assertEqual(inst.identifier[0].value, "12345") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.multipleBirthInteger, 2) + self.assertEqual(inst.name[0].family, "Chalmers") + self.assertEqual(inst.name[0].given[0], "Peter") + self.assertEqual(inst.name[0].given[1], "James") + self.assertEqual(inst.name[0].use, "official") + self.assertEqual(inst.name[1].given[0], "Jim") + self.assertEqual(inst.name[1].use, "usual") + self.assertEqual(inst.name[2].family, "Windsor") + self.assertEqual(inst.name[2].given[0], "Peter") + self.assertEqual(inst.name[2].given[1], "James") + self.assertEqual(inst.name[2].period.end.date, FHIRDate("2002").date) + self.assertEqual(inst.name[2].period.end.as_json(), "2002") + self.assertEqual(inst.name[2].use, "maiden") + self.assertEqual(inst.telecom[0].use, "home") + self.assertEqual(inst.telecom[1].rank, 1) + self.assertEqual(inst.telecom[1].system, "phone") + self.assertEqual(inst.telecom[1].use, "work") + self.assertEqual(inst.telecom[1].value, "(03) 5555 6473") + self.assertEqual(inst.telecom[2].rank, 2) + self.assertEqual(inst.telecom[2].system, "phone") + self.assertEqual(inst.telecom[2].use, "mobile") + self.assertEqual(inst.telecom[2].value, "(03) 3410 5613") + self.assertEqual(inst.telecom[3].period.end.date, FHIRDate("2014").date) + self.assertEqual(inst.telecom[3].period.end.as_json(), "2014") + self.assertEqual(inst.telecom[3].system, "phone") + self.assertEqual(inst.telecom[3].use, "old") + self.assertEqual(inst.telecom[3].value, "(03) 5555 8834") self.assertEqual(inst.text.status, "generated") - def testPatient7(self): - inst = self.instantiate_from("patient-example-infant-fetal.json") + def testPatient8(self): + inst = self.instantiate_from("patient-example-infant-twin-1.json") self.assertIsNotNone(inst, "Must have instantiated a Patient instance") - self.implPatient7(inst) + self.implPatient8(inst) js = inst.as_json() self.assertEqual("Patient", js["resourceType"]) inst2 = patient.Patient(js) - self.implPatient7(inst2) + self.implPatient8(inst2) - def implPatient7(self, inst): + def implPatient8(self, inst): + self.assertEqual(inst.birthDate.date, FHIRDate("2017-05-15").date) + self.assertEqual(inst.birthDate.as_json(), "2017-05-15") self.assertEqual(inst.contact[0].name.family, "Organa") self.assertEqual(inst.contact[0].name.given[0], "Leia") self.assertEqual(inst.contact[0].name.use, "maiden") @@ -267,54 +354,25 @@ def implPatient7(self, inst): self.assertEqual(inst.contact[0].telecom[0].value, "+31201234567") self.assertEqual(inst.extension[0].url, "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName") self.assertEqual(inst.extension[0].valueString, "Organa") - self.assertEqual(inst.gender, "male") - self.assertEqual(inst.id, "infant-fetal") + self.assertEqual(inst.gender, "female") + self.assertEqual(inst.id, "infant-twin-1") self.assertEqual(inst.identifier[0].system, "http://coruscanthealth.org/main-hospital/patient-identifier") self.assertEqual(inst.identifier[0].type.coding[0].code, "MR") self.assertEqual(inst.identifier[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0203") - self.assertEqual(inst.identifier[0].value, "MRN657865757378") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.text.status, "generated") - - def testPatient8(self): - inst = self.instantiate_from("patient-genetics-example1.json") - self.assertIsNotNone(inst, "Must have instantiated a Patient instance") - self.implPatient8(inst) - - js = inst.as_json() - self.assertEqual("Patient", js["resourceType"]) - inst2 = patient.Patient(js) - self.implPatient8(inst2) - - def implPatient8(self, inst): - self.assertTrue(inst.active) - self.assertEqual(inst.address[0].line[0], "2222 Home Street") - self.assertEqual(inst.address[0].use, "home") - self.assertEqual(inst.birthDate.date, FHIRDate("1973-05-31").date) - self.assertEqual(inst.birthDate.as_json(), "1973-05-31") - self.assertEqual(inst.gender, "female") - self.assertEqual(inst.id, "genetics-example1") - self.assertEqual(inst.identifier[0].system, "http://hl7.org/fhir/sid/us-ssn") - self.assertEqual(inst.identifier[0].type.coding[0].code, "SS") - self.assertEqual(inst.identifier[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0203") - self.assertEqual(inst.identifier[0].value, "444222222") - self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2012-05-29T23:45:32Z").date) - self.assertEqual(inst.meta.lastUpdated.as_json(), "2012-05-29T23:45:32Z") + self.assertEqual(inst.identifier[0].value, "MRN7465737865") + self.assertEqual(inst.identifier[1].system, "http://new-republic.gov/galactic-citizen-identifier") + self.assertEqual(inst.identifier[1].value, "7465737865") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].family, "Everywoman") - self.assertEqual(inst.name[0].given[0], "Eve") + self.assertEqual(inst.multipleBirthInteger, 1) + self.assertEqual(inst.name[0].family, "Solo") + self.assertEqual(inst.name[0].given[0], "Jaina") self.assertEqual(inst.name[0].use, "official") - self.assertEqual(inst.telecom[0].system, "phone") - self.assertEqual(inst.telecom[0].use, "work") - self.assertEqual(inst.telecom[0].value, "555-555-2003") self.assertEqual(inst.text.status, "generated") def testPatient9(self): - inst = self.instantiate_from("patient-example-b.json") + inst = self.instantiate_from("patient-example-dicom.json") self.assertIsNotNone(inst, "Must have instantiated a Patient instance") self.implPatient9(inst) @@ -325,22 +383,23 @@ def testPatient9(self): def implPatient9(self, inst): self.assertTrue(inst.active) - self.assertEqual(inst.gender, "other") - self.assertEqual(inst.id, "pat2") - self.assertEqual(inst.identifier[0].system, "urn:oid:0.1.2.3.4.5.6.7") - self.assertEqual(inst.identifier[0].type.coding[0].code, "MR") - self.assertEqual(inst.identifier[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0203") - self.assertEqual(inst.identifier[0].use, "usual") - self.assertEqual(inst.identifier[0].value, "123456") - self.assertEqual(inst.link[0].type, "seealso") + self.assertEqual(inst.extension[0].url, "http://nema.org/fhir/extensions#0010:1010") + self.assertEqual(inst.extension[0].valueQuantity.unit, "Y") + self.assertEqual(inst.extension[0].valueQuantity.value, 56) + self.assertEqual(inst.extension[1].url, "http://nema.org/fhir/extensions#0010:1020") + self.assertEqual(inst.extension[1].valueQuantity.unit, "m") + self.assertEqual(inst.extension[1].valueQuantity.value, 1.83) + self.assertEqual(inst.extension[2].url, "http://nema.org/fhir/extensions#0010:1030") + self.assertEqual(inst.extension[2].valueQuantity.unit, "kg") + self.assertEqual(inst.extension[2].valueQuantity.value, 72.58) + self.assertEqual(inst.gender, "male") + self.assertEqual(inst.id, "dicom") + self.assertEqual(inst.identifier[0].system, "http://nema.org/examples/patients") + self.assertEqual(inst.identifier[0].value, "MINT1234") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].family, "Donald") - self.assertEqual(inst.name[0].given[0], "Duck") - self.assertEqual(inst.name[0].given[1], "D") - self.assertEqual(inst.name[0].use, "official") - self.assertEqual(inst.photo[0].contentType, "image/gif") + self.assertEqual(inst.name[0].family, "MINT_TEST") self.assertEqual(inst.text.status, "generated") def testPatient10(self): diff --git a/fhirclient/models/paymentnotice.py b/fhirclient/models/paymentnotice.py index 4d2615007..e17eb0860 100644 --- a/fhirclient/models/paymentnotice.py +++ b/fhirclient/models/paymentnotice.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/PaymentNotice) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/PaymentNotice) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/paymentnotice_tests.py b/fhirclient/models/paymentnotice_tests.py index 7f85c44a6..46b022638 100644 --- a/fhirclient/models/paymentnotice_tests.py +++ b/fhirclient/models/paymentnotice_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/paymentreconciliation.py b/fhirclient/models/paymentreconciliation.py index 958c21348..c1152eb43 100644 --- a/fhirclient/models/paymentreconciliation.py +++ b/fhirclient/models/paymentreconciliation.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/PaymentReconciliation) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/PaymentReconciliation) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/paymentreconciliation_tests.py b/fhirclient/models/paymentreconciliation_tests.py index edc7aa4af..d18de54a8 100644 --- a/fhirclient/models/paymentreconciliation_tests.py +++ b/fhirclient/models/paymentreconciliation_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/period.py b/fhirclient/models/period.py index 4cdb26f7b..52aa5cf9a 100644 --- a/fhirclient/models/period.py +++ b/fhirclient/models/period.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Period) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Period) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/person.py b/fhirclient/models/person.py index 7c68f213a..3897f8993 100644 --- a/fhirclient/models/person.py +++ b/fhirclient/models/person.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Person) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Person) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/person_tests.py b/fhirclient/models/person_tests.py index 4cfdc247c..563dfef28 100644 --- a/fhirclient/models/person_tests.py +++ b/fhirclient/models/person_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/plandefinition.py b/fhirclient/models/plandefinition.py index 458c37c02..4c95c9678 100644 --- a/fhirclient/models/plandefinition.py +++ b/fhirclient/models/plandefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/PlanDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/PlanDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/plandefinition_tests.py b/fhirclient/models/plandefinition_tests.py index 5fe6208c3..ddc4c2e9f 100644 --- a/fhirclient/models/plandefinition_tests.py +++ b/fhirclient/models/plandefinition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -116,7 +116,7 @@ def implPlanDefinition1(self, inst): self.assertEqual(inst.version, "1") def testPlanDefinition2(self): - inst = self.instantiate_from("plandefinition-options-example.json") + inst = self.instantiate_from("plandefinition-predecessor-example.json") self.assertIsNotNone(inst, "Must have instantiated a PlanDefinition instance") self.implPlanDefinition2(inst) @@ -126,6 +126,235 @@ def testPlanDefinition2(self): self.implPlanDefinition2(inst2) def implPlanDefinition2(self, inst): + self.assertEqual(inst.action[0].action[0].condition[0].expression.expression, "Should Administer Zika Virus Exposure Assessment") + self.assertEqual(inst.action[0].action[0].condition[0].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[0].condition[0].kind, "applicability") + self.assertEqual(inst.action[0].action[0].definitionCanonical, "ActivityDefinition/administer-zika-virus-exposure-assessment") + self.assertEqual(inst.action[0].action[1].condition[0].expression.expression, "Should Order Serum + Urine rRT-PCR Test") + self.assertEqual(inst.action[0].action[1].condition[0].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[1].condition[0].kind, "applicability") + self.assertEqual(inst.action[0].action[1].definitionCanonical, "ActivityDefinition/order-serum-urine-rrt-pcr-test") + self.assertEqual(inst.action[0].action[2].condition[0].expression.expression, "Should Order Serum Zika Virus IgM + Dengue Virus IgM") + self.assertEqual(inst.action[0].action[2].condition[0].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[2].condition[0].kind, "applicability") + self.assertEqual(inst.action[0].action[2].definitionCanonical, "ActivityDefinition/order-serum-zika-dengue-virus-igm") + self.assertEqual(inst.action[0].action[3].condition[0].expression.expression, "Should Consider IgM Antibody Testing") + self.assertEqual(inst.action[0].action[3].condition[0].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[3].condition[0].kind, "applicability") + self.assertEqual(inst.action[0].action[3].definitionCanonical, "ActivityDefinition/consider-igm-antibody-testing") + self.assertEqual(inst.action[0].action[4].action[0].definitionCanonical, "ActivityDefinition/provide-mosquito-prevention-advice") + self.assertEqual(inst.action[0].action[4].action[1].definitionCanonical, "ActivityDefinition/provide-contraception-advice") + self.assertEqual(inst.action[0].action[4].condition[0].expression.expression, "Should Provide Mosquito Prevention and Contraception Advice") + self.assertEqual(inst.action[0].action[4].condition[0].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[4].condition[0].kind, "applicability") + self.assertEqual(inst.action[0].condition[0].expression.expression, "Is Patient Pregnant") + self.assertEqual(inst.action[0].condition[0].expression.language, "text/cql") + self.assertEqual(inst.action[0].condition[0].kind, "applicability") + self.assertEqual(inst.action[0].title, "Zika Virus Assessment") + self.assertEqual(inst.action[0].trigger[0].name, "patient-view") + self.assertEqual(inst.action[0].trigger[0].type, "named-event") + self.assertEqual(inst.date.date, FHIRDate("2016-11-14").date) + self.assertEqual(inst.date.as_json(), "2016-11-14") + self.assertEqual(inst.description, "Zika Virus Management intervention describing the CDC Guidelines for Zika Virus Reporting and Management.") + self.assertEqual(inst.id, "zika-virus-intervention-initial") + self.assertEqual(inst.identifier[0].use, "official") + self.assertEqual(inst.identifier[0].value, "zika-virus-intervention") + self.assertEqual(inst.library[0], "Library/zika-virus-intervention-logic") + self.assertEqual(inst.relatedArtifact[0].type, "derived-from") + self.assertEqual(inst.relatedArtifact[0].url, "https://www.cdc.gov/mmwr/volumes/65/wr/mm6539e1.htm?s_cid=mm6539e1_w") + self.assertEqual(inst.relatedArtifact[1].resource, "PlanDefinition/zika-virus-intervention") + self.assertEqual(inst.relatedArtifact[1].type, "successor") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.title, "Example Zika Virus Intervention") + self.assertEqual(inst.topic[0].text, "Zika Virus Management") + self.assertEqual(inst.url, "http://example.org/PlanDefinition/zika-virus-intervention") + self.assertEqual(inst.version, "1.0.0") + + def testPlanDefinition3(self): + inst = self.instantiate_from("plandefinition-example.json") + self.assertIsNotNone(inst, "Must have instantiated a PlanDefinition instance") + self.implPlanDefinition3(inst) + + js = inst.as_json() + self.assertEqual("PlanDefinition", js["resourceType"]) + inst2 = plandefinition.PlanDefinition(js) + self.implPlanDefinition3(inst2) + + def implPlanDefinition3(self, inst): + self.assertEqual(inst.action[0].action[0].action[0].definitionCanonical, "#referralToMentalHealthCare") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[0].expression.expression, "Now()") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[0].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[0].path, "timing.event") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[1].expression.expression, "Code '261QM0850X' from SuicideRiskLogic.\"NUCC Provider Taxonomy\" display 'Adult Mental Health'") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[1].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[1].path, "specialty") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[2].expression.expression, "SuicideRiskLogic.ServiceRequestFulfillmentTime") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[2].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[2].path, "occurrenceDateTime") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[3].expression.expression, "SuicideRiskLogic.Patient") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[3].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[3].path, "subject") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[4].expression.expression, "SuicideRiskLogic.Practitioner") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[4].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[4].path, "requester.agent") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[5].expression.expression, "SuicideRiskLogic.RiskAssessmentScore") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[5].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[5].path, "reasonCode") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[6].expression.expression, "SuicideRiskLogic.RiskAssessment") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[6].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[6].path, "reasonReference") + self.assertEqual(inst.action[0].action[0].action[0].textEquivalent, "Refer to outpatient mental health program for evaluation and treatment of mental health conditions now") + self.assertEqual(inst.action[0].action[0].groupingBehavior, "logical-group") + self.assertEqual(inst.action[0].action[0].selectionBehavior, "any") + self.assertEqual(inst.action[0].action[0].title, "Consults and Referrals") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].definitionCanonical, "#citalopramPrescription") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[0].expression.expression, "'draft'") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[0].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[0].path, "status") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[1].expression.expression, "SuicideRiskLogic.Patient") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[1].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[1].path, "patient") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[2].expression.expression, "SuicideRiskLogic.Practitioner") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[2].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[2].path, "prescriber") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[3].expression.expression, "SuicideRiskLogic.RiskAssessmentScore") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[3].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[3].path, "reasonCode") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[4].expression.expression, "SuicideRiskLogic.RiskAssessment") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[4].expression.language, "text/cql") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[4].path, "reasonReference") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].textEquivalent, "citalopram 20 mg tablet 1 tablet oral 1 time daily now (30 table; 3 refills)") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[1].textEquivalent, "escitalopram 10 mg tablet 1 tablet oral 1 time daily now (30 tablet; 3 refills)") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[2].textEquivalent, "fluoxetine 20 mg capsule 1 capsule oral 1 time daily now (30 tablet; 3 refills)") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[3].textEquivalent, "paroxetine 20 mg tablet 1 tablet oral 1 time daily now (30 tablet; 3 refills)") + self.assertEqual(inst.action[0].action[1].action[0].action[0].action[4].textEquivalent, "sertraline 50 mg tablet 1 tablet oral 1 time daily now (30 tablet; 3 refills)") + self.assertEqual(inst.action[0].action[1].action[0].action[0].documentation[0].document.contentType, "text/html") + self.assertEqual(inst.action[0].action[1].action[0].action[0].documentation[0].document.title, "National Library of Medicine. DailyMed website. CITALOPRAM- citalopram hydrobromide tablet, film coated.") + self.assertEqual(inst.action[0].action[1].action[0].action[0].documentation[0].document.url, "http://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=6daeb45c-451d-b135-bf8f-2d6dff4b6b01") + self.assertEqual(inst.action[0].action[1].action[0].action[0].documentation[0].type, "citation") + self.assertEqual(inst.action[0].action[1].action[0].action[0].groupingBehavior, "logical-group") + self.assertEqual(inst.action[0].action[1].action[0].action[0].selectionBehavior, "at-most-one") + self.assertEqual(inst.action[0].action[1].action[0].action[0].title, "Selective Serotonin Reuptake Inhibitors (Choose a mazimum of one or document reasons for exception)") + self.assertEqual(inst.action[0].action[1].action[0].action[1].textEquivalent, "Dopamine Norepinephrine Reuptake Inhibitors (Choose a maximum of one or document reasons for exception)") + self.assertEqual(inst.action[0].action[1].action[0].action[2].textEquivalent, "Serotonin Norepinephrine Reuptake Inhibitors (Choose a maximum of one or doument reasons for exception)") + self.assertEqual(inst.action[0].action[1].action[0].action[3].textEquivalent, "Norepinephrine-Serotonin Modulators (Choose a maximum of one or document reasons for exception)") + self.assertEqual(inst.action[0].action[1].action[0].documentation[0].document.contentType, "text/html") + self.assertEqual(inst.action[0].action[1].action[0].documentation[0].document.extension[0].url, "http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence") + self.assertEqual(inst.action[0].action[1].action[0].documentation[0].document.extension[0].valueCodeableConcept.coding[0].code, "high") + self.assertEqual(inst.action[0].action[1].action[0].documentation[0].document.extension[0].valueCodeableConcept.coding[0].system, "http://terminology.hl7.org/CodeSystem/evidence-quality") + self.assertEqual(inst.action[0].action[1].action[0].documentation[0].document.extension[0].valueCodeableConcept.text, "High Quality") + self.assertEqual(inst.action[0].action[1].action[0].documentation[0].document.title, "Practice Guideline for the Treatment of Patients with Major Depressive Disorder") + self.assertEqual(inst.action[0].action[1].action[0].documentation[0].document.url, "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf") + self.assertEqual(inst.action[0].action[1].action[0].documentation[0].type, "citation") + self.assertEqual(inst.action[0].action[1].action[0].groupingBehavior, "logical-group") + self.assertEqual(inst.action[0].action[1].action[0].selectionBehavior, "at-most-one") + self.assertEqual(inst.action[0].action[1].action[0].title, "First-Line Antidepressants") + self.assertEqual(inst.action[0].action[1].groupingBehavior, "logical-group") + self.assertEqual(inst.action[0].action[1].selectionBehavior, "at-most-one") + self.assertEqual(inst.action[0].action[1].title, "Medications") + self.assertEqual(inst.action[0].title, "Suicide Risk Assessment and Outpatient Management") + self.assertEqual(inst.approvalDate.date, FHIRDate("2016-03-12").date) + self.assertEqual(inst.approvalDate.as_json(), "2016-03-12") + self.assertEqual(inst.author[0].name, "Motive Medical Intelligence") + self.assertEqual(inst.author[0].telecom[0].system, "phone") + self.assertEqual(inst.author[0].telecom[0].use, "work") + self.assertEqual(inst.author[0].telecom[0].value, "415-362-4007") + self.assertEqual(inst.author[0].telecom[1].system, "email") + self.assertEqual(inst.author[0].telecom[1].use, "work") + self.assertEqual(inst.author[0].telecom[1].value, "info@motivemi.com") + self.assertEqual(inst.contact[0].telecom[0].system, "phone") + self.assertEqual(inst.contact[0].telecom[0].use, "work") + self.assertEqual(inst.contact[0].telecom[0].value, "415-362-4007") + self.assertEqual(inst.contact[0].telecom[1].system, "email") + self.assertEqual(inst.contact[0].telecom[1].use, "work") + self.assertEqual(inst.contact[0].telecom[1].value, "info@motivemi.com") + self.assertEqual(inst.contained[0].id, "referralToMentalHealthCare") + self.assertEqual(inst.contained[1].id, "citalopramPrescription") + self.assertEqual(inst.contained[2].id, "citalopramMedication") + self.assertEqual(inst.contained[3].id, "citalopramSubstance") + self.assertEqual(inst.copyright, "© Copyright 2016 Motive Medical Intelligence. All rights reserved.") + self.assertEqual(inst.date.date, FHIRDate("2015-08-15").date) + self.assertEqual(inst.date.as_json(), "2015-08-15") + self.assertEqual(inst.description, "Orders to be applied to a patient characterized as low suicide risk.") + self.assertEqual(inst.effectivePeriod.end.date, FHIRDate("2017-12-31").date) + self.assertEqual(inst.effectivePeriod.end.as_json(), "2017-12-31") + self.assertEqual(inst.effectivePeriod.start.date, FHIRDate("2016-01-01").date) + self.assertEqual(inst.effectivePeriod.start.as_json(), "2016-01-01") + self.assertTrue(inst.experimental) + self.assertEqual(inst.id, "low-suicide-risk-order-set") + self.assertEqual(inst.identifier[0].system, "http://motivemi.com/artifacts") + self.assertEqual(inst.identifier[0].use, "official") + self.assertEqual(inst.identifier[0].value, "mmi:low-suicide-risk-order-set") + self.assertEqual(inst.jurisdiction[0].coding[0].code, "US") + self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") + self.assertEqual(inst.lastReviewDate.date, FHIRDate("2016-08-15").date) + self.assertEqual(inst.lastReviewDate.as_json(), "2016-08-15") + self.assertEqual(inst.library[0], "Library/suiciderisk-orderset-logic") + self.assertEqual(inst.name, "LowSuicideRiskOrderSet") + self.assertEqual(inst.publisher, "Motive Medical Intelligence") + self.assertEqual(inst.purpose, "This order set helps ensure consistent application of appropriate orders for the care of low suicide risk patients.") + self.assertEqual(inst.relatedArtifact[0].display, "Practice Guideline for the Treatment of Patients with Major Depressive Disorder") + self.assertEqual(inst.relatedArtifact[0].type, "derived-from") + self.assertEqual(inst.relatedArtifact[0].url, "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf") + self.assertEqual(inst.relatedArtifact[1].resource, "ActivityDefinition/referralPrimaryCareMentalHealth") + self.assertEqual(inst.relatedArtifact[1].type, "composed-of") + self.assertEqual(inst.relatedArtifact[2].resource, "ActivityDefinition/citalopramPrescription") + self.assertEqual(inst.relatedArtifact[2].type, "composed-of") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.title, "Low Suicide Risk Order Set") + self.assertEqual(inst.topic[0].text, "Suicide risk assessment") + self.assertEqual(inst.url, "http://motivemi.com/artifacts/PlanDefinition/low-suicide-risk-order-set") + self.assertEqual(inst.usage, "This order set should be applied after assessing a patient for suicide risk, when the findings of that assessment indicate the patient has low suicide risk.") + self.assertEqual(inst.useContext[0].code.code, "age") + self.assertEqual(inst.useContext[0].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") + self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].code, "D000328") + self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].display, "Adult") + self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].system, "https://meshb.nlm.nih.gov") + self.assertEqual(inst.useContext[1].code.code, "focus") + self.assertEqual(inst.useContext[1].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") + self.assertEqual(inst.useContext[1].valueCodeableConcept.coding[0].code, "87512008") + self.assertEqual(inst.useContext[1].valueCodeableConcept.coding[0].display, "Mild major depression") + self.assertEqual(inst.useContext[1].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.useContext[2].code.code, "focus") + self.assertEqual(inst.useContext[2].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") + self.assertEqual(inst.useContext[2].valueCodeableConcept.coding[0].code, "40379007") + self.assertEqual(inst.useContext[2].valueCodeableConcept.coding[0].display, "Major depression, recurrent, mild") + self.assertEqual(inst.useContext[2].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.useContext[3].code.code, "focus") + self.assertEqual(inst.useContext[3].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") + self.assertEqual(inst.useContext[3].valueCodeableConcept.coding[0].code, "394687007") + self.assertEqual(inst.useContext[3].valueCodeableConcept.coding[0].display, "Low suicide risk") + self.assertEqual(inst.useContext[3].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.useContext[4].code.code, "focus") + self.assertEqual(inst.useContext[4].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") + self.assertEqual(inst.useContext[4].valueCodeableConcept.coding[0].code, "225337009") + self.assertEqual(inst.useContext[4].valueCodeableConcept.coding[0].display, "Suicide risk assessment") + self.assertEqual(inst.useContext[4].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.useContext[5].code.code, "user") + self.assertEqual(inst.useContext[5].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") + self.assertEqual(inst.useContext[5].valueCodeableConcept.coding[0].code, "309343006") + self.assertEqual(inst.useContext[5].valueCodeableConcept.coding[0].display, "Physician") + self.assertEqual(inst.useContext[5].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.useContext[6].code.code, "venue") + self.assertEqual(inst.useContext[6].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") + self.assertEqual(inst.useContext[6].valueCodeableConcept.coding[0].code, "440655000") + self.assertEqual(inst.useContext[6].valueCodeableConcept.coding[0].display, "Outpatient environment") + self.assertEqual(inst.useContext[6].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.version, "1.0.0") + + def testPlanDefinition4(self): + inst = self.instantiate_from("plandefinition-options-example.json") + self.assertIsNotNone(inst, "Must have instantiated a PlanDefinition instance") + self.implPlanDefinition4(inst) + + js = inst.as_json() + self.assertEqual("PlanDefinition", js["resourceType"]) + inst2 = plandefinition.PlanDefinition(js) + self.implPlanDefinition4(inst2) + + def implPlanDefinition4(self, inst): self.assertEqual(inst.action[0].action[0].definitionCanonical, "#activitydefinition-medicationrequest-1") self.assertEqual(inst.action[0].action[0].id, "medication-action-1") self.assertEqual(inst.action[0].action[0].title, "Administer Medication 1") @@ -149,17 +378,17 @@ def implPlanDefinition2(self, inst): self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.title, "This example illustrates relationships between actions.") - def testPlanDefinition3(self): + def testPlanDefinition5(self): inst = self.instantiate_from("plandefinition-example-cardiology-os.json") self.assertIsNotNone(inst, "Must have instantiated a PlanDefinition instance") - self.implPlanDefinition3(inst) + self.implPlanDefinition5(inst) js = inst.as_json() self.assertEqual("PlanDefinition", js["resourceType"]) inst2 = plandefinition.PlanDefinition(js) - self.implPlanDefinition3(inst2) + self.implPlanDefinition5(inst2) - def implPlanDefinition3(self, inst): + def implPlanDefinition5(self, inst): self.assertEqual(inst.action[0].action[0].action[0].definitionCanonical, "#referralToCardiologyConsult") self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[0].expression.expression, "Now()") self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[0].expression.language, "text/cql") @@ -313,17 +542,17 @@ def implPlanDefinition3(self, inst): self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.version, "0.1") - def testPlanDefinition4(self): + def testPlanDefinition6(self): inst = self.instantiate_from("plandefinition-protocol-example.json") self.assertIsNotNone(inst, "Must have instantiated a PlanDefinition instance") - self.implPlanDefinition4(inst) + self.implPlanDefinition6(inst) js = inst.as_json() self.assertEqual("PlanDefinition", js["resourceType"]) inst2 = plandefinition.PlanDefinition(js) - self.implPlanDefinition4(inst2) + self.implPlanDefinition6(inst2) - def implPlanDefinition4(self, inst): + def implPlanDefinition6(self, inst): self.assertEqual(inst.action[0].cardinalityBehavior, "single") self.assertEqual(inst.action[0].condition[0].expression.expression, "exists ([Condition: Obesity]) or not exists ([Observation: BMI] O where O.effectiveDateTime 2 years or less before Today())") self.assertEqual(inst.action[0].condition[0].expression.language, "text/cql") @@ -373,233 +602,4 @@ def implPlanDefinition4(self, inst): self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].code, "414916001") self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].display, "Obesity (disorder)") self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") - - def testPlanDefinition5(self): - inst = self.instantiate_from("plandefinition-example.json") - self.assertIsNotNone(inst, "Must have instantiated a PlanDefinition instance") - self.implPlanDefinition5(inst) - - js = inst.as_json() - self.assertEqual("PlanDefinition", js["resourceType"]) - inst2 = plandefinition.PlanDefinition(js) - self.implPlanDefinition5(inst2) - - def implPlanDefinition5(self, inst): - self.assertEqual(inst.action[0].action[0].action[0].definitionCanonical, "#referralToMentalHealthCare") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[0].expression.expression, "Now()") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[0].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[0].path, "timing.event") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[1].expression.expression, "Code '261QM0850X' from SuicideRiskLogic.\"NUCC Provider Taxonomy\" display 'Adult Mental Health'") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[1].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[1].path, "specialty") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[2].expression.expression, "SuicideRiskLogic.ServiceRequestFulfillmentTime") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[2].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[2].path, "occurrenceDateTime") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[3].expression.expression, "SuicideRiskLogic.Patient") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[3].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[3].path, "subject") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[4].expression.expression, "SuicideRiskLogic.Practitioner") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[4].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[4].path, "requester.agent") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[5].expression.expression, "SuicideRiskLogic.RiskAssessmentScore") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[5].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[5].path, "reasonCode") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[6].expression.expression, "SuicideRiskLogic.RiskAssessment") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[6].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[0].action[0].dynamicValue[6].path, "reasonReference") - self.assertEqual(inst.action[0].action[0].action[0].textEquivalent, "Refer to outpatient mental health program for evaluation and treatment of mental health conditions now") - self.assertEqual(inst.action[0].action[0].groupingBehavior, "logical-group") - self.assertEqual(inst.action[0].action[0].selectionBehavior, "any") - self.assertEqual(inst.action[0].action[0].title, "Consults and Referrals") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].definitionCanonical, "#citalopramPrescription") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[0].expression.expression, "'draft'") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[0].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[0].path, "status") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[1].expression.expression, "SuicideRiskLogic.Patient") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[1].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[1].path, "patient") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[2].expression.expression, "SuicideRiskLogic.Practitioner") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[2].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[2].path, "prescriber") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[3].expression.expression, "SuicideRiskLogic.RiskAssessmentScore") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[3].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[3].path, "reasonCode") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[4].expression.expression, "SuicideRiskLogic.RiskAssessment") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[4].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].dynamicValue[4].path, "reasonReference") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[0].textEquivalent, "citalopram 20 mg tablet 1 tablet oral 1 time daily now (30 table; 3 refills)") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[1].textEquivalent, "escitalopram 10 mg tablet 1 tablet oral 1 time daily now (30 tablet; 3 refills)") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[2].textEquivalent, "fluoxetine 20 mg capsule 1 capsule oral 1 time daily now (30 tablet; 3 refills)") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[3].textEquivalent, "paroxetine 20 mg tablet 1 tablet oral 1 time daily now (30 tablet; 3 refills)") - self.assertEqual(inst.action[0].action[1].action[0].action[0].action[4].textEquivalent, "sertraline 50 mg tablet 1 tablet oral 1 time daily now (30 tablet; 3 refills)") - self.assertEqual(inst.action[0].action[1].action[0].action[0].documentation[0].document.contentType, "text/html") - self.assertEqual(inst.action[0].action[1].action[0].action[0].documentation[0].document.title, "National Library of Medicine. DailyMed website. CITALOPRAM- citalopram hydrobromide tablet, film coated.") - self.assertEqual(inst.action[0].action[1].action[0].action[0].documentation[0].document.url, "http://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=6daeb45c-451d-b135-bf8f-2d6dff4b6b01") - self.assertEqual(inst.action[0].action[1].action[0].action[0].documentation[0].type, "citation") - self.assertEqual(inst.action[0].action[1].action[0].action[0].groupingBehavior, "logical-group") - self.assertEqual(inst.action[0].action[1].action[0].action[0].selectionBehavior, "at-most-one") - self.assertEqual(inst.action[0].action[1].action[0].action[0].title, "Selective Serotonin Reuptake Inhibitors (Choose a mazimum of one or document reasons for exception)") - self.assertEqual(inst.action[0].action[1].action[0].action[1].textEquivalent, "Dopamine Norepinephrine Reuptake Inhibitors (Choose a maximum of one or document reasons for exception)") - self.assertEqual(inst.action[0].action[1].action[0].action[2].textEquivalent, "Serotonin Norepinephrine Reuptake Inhibitors (Choose a maximum of one or doument reasons for exception)") - self.assertEqual(inst.action[0].action[1].action[0].action[3].textEquivalent, "Norepinephrine-Serotonin Modulators (Choose a maximum of one or document reasons for exception)") - self.assertEqual(inst.action[0].action[1].action[0].documentation[0].document.contentType, "text/html") - self.assertEqual(inst.action[0].action[1].action[0].documentation[0].document.extension[0].url, "http://hl7.org/fhir/StructureDefinition/cqf-qualityOfEvidence") - self.assertEqual(inst.action[0].action[1].action[0].documentation[0].document.extension[0].valueCodeableConcept.coding[0].code, "high") - self.assertEqual(inst.action[0].action[1].action[0].documentation[0].document.extension[0].valueCodeableConcept.coding[0].system, "http://terminology.hl7.org/CodeSystem/evidence-quality") - self.assertEqual(inst.action[0].action[1].action[0].documentation[0].document.extension[0].valueCodeableConcept.text, "High Quality") - self.assertEqual(inst.action[0].action[1].action[0].documentation[0].document.title, "Practice Guideline for the Treatment of Patients with Major Depressive Disorder") - self.assertEqual(inst.action[0].action[1].action[0].documentation[0].document.url, "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf") - self.assertEqual(inst.action[0].action[1].action[0].documentation[0].type, "citation") - self.assertEqual(inst.action[0].action[1].action[0].groupingBehavior, "logical-group") - self.assertEqual(inst.action[0].action[1].action[0].selectionBehavior, "at-most-one") - self.assertEqual(inst.action[0].action[1].action[0].title, "First-Line Antidepressants") - self.assertEqual(inst.action[0].action[1].groupingBehavior, "logical-group") - self.assertEqual(inst.action[0].action[1].selectionBehavior, "at-most-one") - self.assertEqual(inst.action[0].action[1].title, "Medications") - self.assertEqual(inst.action[0].title, "Suicide Risk Assessment and Outpatient Management") - self.assertEqual(inst.approvalDate.date, FHIRDate("2016-03-12").date) - self.assertEqual(inst.approvalDate.as_json(), "2016-03-12") - self.assertEqual(inst.author[0].name, "Motive Medical Intelligence") - self.assertEqual(inst.author[0].telecom[0].system, "phone") - self.assertEqual(inst.author[0].telecom[0].use, "work") - self.assertEqual(inst.author[0].telecom[0].value, "415-362-4007") - self.assertEqual(inst.author[0].telecom[1].system, "email") - self.assertEqual(inst.author[0].telecom[1].use, "work") - self.assertEqual(inst.author[0].telecom[1].value, "info@motivemi.com") - self.assertEqual(inst.contact[0].telecom[0].system, "phone") - self.assertEqual(inst.contact[0].telecom[0].use, "work") - self.assertEqual(inst.contact[0].telecom[0].value, "415-362-4007") - self.assertEqual(inst.contact[0].telecom[1].system, "email") - self.assertEqual(inst.contact[0].telecom[1].use, "work") - self.assertEqual(inst.contact[0].telecom[1].value, "info@motivemi.com") - self.assertEqual(inst.contained[0].id, "referralToMentalHealthCare") - self.assertEqual(inst.contained[1].id, "citalopramPrescription") - self.assertEqual(inst.contained[2].id, "citalopramMedication") - self.assertEqual(inst.contained[3].id, "citalopramSubstance") - self.assertEqual(inst.copyright, "© Copyright 2016 Motive Medical Intelligence. All rights reserved.") - self.assertEqual(inst.date.date, FHIRDate("2015-08-15").date) - self.assertEqual(inst.date.as_json(), "2015-08-15") - self.assertEqual(inst.description, "Orders to be applied to a patient characterized as low suicide risk.") - self.assertEqual(inst.effectivePeriod.end.date, FHIRDate("2017-12-31").date) - self.assertEqual(inst.effectivePeriod.end.as_json(), "2017-12-31") - self.assertEqual(inst.effectivePeriod.start.date, FHIRDate("2016-01-01").date) - self.assertEqual(inst.effectivePeriod.start.as_json(), "2016-01-01") - self.assertTrue(inst.experimental) - self.assertEqual(inst.id, "low-suicide-risk-order-set") - self.assertEqual(inst.identifier[0].system, "http://motivemi.com/artifacts") - self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "mmi:low-suicide-risk-order-set") - self.assertEqual(inst.jurisdiction[0].coding[0].code, "US") - self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") - self.assertEqual(inst.lastReviewDate.date, FHIRDate("2016-08-15").date) - self.assertEqual(inst.lastReviewDate.as_json(), "2016-08-15") - self.assertEqual(inst.library[0], "Library/suiciderisk-orderset-logic") - self.assertEqual(inst.name, "LowSuicideRiskOrderSet") - self.assertEqual(inst.publisher, "Motive Medical Intelligence") - self.assertEqual(inst.purpose, "This order set helps ensure consistent application of appropriate orders for the care of low suicide risk patients.") - self.assertEqual(inst.relatedArtifact[0].display, "Practice Guideline for the Treatment of Patients with Major Depressive Disorder") - self.assertEqual(inst.relatedArtifact[0].type, "derived-from") - self.assertEqual(inst.relatedArtifact[0].url, "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf") - self.assertEqual(inst.relatedArtifact[1].resource, "ActivityDefinition/referralPrimaryCareMentalHealth") - self.assertEqual(inst.relatedArtifact[1].type, "composed-of") - self.assertEqual(inst.relatedArtifact[2].resource, "ActivityDefinition/citalopramPrescription") - self.assertEqual(inst.relatedArtifact[2].type, "composed-of") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.title, "Low Suicide Risk Order Set") - self.assertEqual(inst.topic[0].text, "Suicide risk assessment") - self.assertEqual(inst.url, "http://motivemi.com/artifacts/PlanDefinition/low-suicide-risk-order-set") - self.assertEqual(inst.usage, "This order set should be applied after assessing a patient for suicide risk, when the findings of that assessment indicate the patient has low suicide risk.") - self.assertEqual(inst.useContext[0].code.code, "age") - self.assertEqual(inst.useContext[0].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") - self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].code, "D000328") - self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].display, "Adult") - self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].system, "https://meshb.nlm.nih.gov") - self.assertEqual(inst.useContext[1].code.code, "focus") - self.assertEqual(inst.useContext[1].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") - self.assertEqual(inst.useContext[1].valueCodeableConcept.coding[0].code, "87512008") - self.assertEqual(inst.useContext[1].valueCodeableConcept.coding[0].display, "Mild major depression") - self.assertEqual(inst.useContext[1].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.useContext[2].code.code, "focus") - self.assertEqual(inst.useContext[2].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") - self.assertEqual(inst.useContext[2].valueCodeableConcept.coding[0].code, "40379007") - self.assertEqual(inst.useContext[2].valueCodeableConcept.coding[0].display, "Major depression, recurrent, mild") - self.assertEqual(inst.useContext[2].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.useContext[3].code.code, "focus") - self.assertEqual(inst.useContext[3].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") - self.assertEqual(inst.useContext[3].valueCodeableConcept.coding[0].code, "394687007") - self.assertEqual(inst.useContext[3].valueCodeableConcept.coding[0].display, "Low suicide risk") - self.assertEqual(inst.useContext[3].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.useContext[4].code.code, "focus") - self.assertEqual(inst.useContext[4].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") - self.assertEqual(inst.useContext[4].valueCodeableConcept.coding[0].code, "225337009") - self.assertEqual(inst.useContext[4].valueCodeableConcept.coding[0].display, "Suicide risk assessment") - self.assertEqual(inst.useContext[4].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.useContext[5].code.code, "user") - self.assertEqual(inst.useContext[5].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") - self.assertEqual(inst.useContext[5].valueCodeableConcept.coding[0].code, "309343006") - self.assertEqual(inst.useContext[5].valueCodeableConcept.coding[0].display, "Physician") - self.assertEqual(inst.useContext[5].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.useContext[6].code.code, "venue") - self.assertEqual(inst.useContext[6].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") - self.assertEqual(inst.useContext[6].valueCodeableConcept.coding[0].code, "440655000") - self.assertEqual(inst.useContext[6].valueCodeableConcept.coding[0].display, "Outpatient environment") - self.assertEqual(inst.useContext[6].valueCodeableConcept.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.version, "1.0.0") - - def testPlanDefinition6(self): - inst = self.instantiate_from("plandefinition-predecessor-example.json") - self.assertIsNotNone(inst, "Must have instantiated a PlanDefinition instance") - self.implPlanDefinition6(inst) - - js = inst.as_json() - self.assertEqual("PlanDefinition", js["resourceType"]) - inst2 = plandefinition.PlanDefinition(js) - self.implPlanDefinition6(inst2) - - def implPlanDefinition6(self, inst): - self.assertEqual(inst.action[0].action[0].condition[0].expression.expression, "Should Administer Zika Virus Exposure Assessment") - self.assertEqual(inst.action[0].action[0].condition[0].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[0].condition[0].kind, "applicability") - self.assertEqual(inst.action[0].action[0].definitionCanonical, "ActivityDefinition/administer-zika-virus-exposure-assessment") - self.assertEqual(inst.action[0].action[1].condition[0].expression.expression, "Should Order Serum + Urine rRT-PCR Test") - self.assertEqual(inst.action[0].action[1].condition[0].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[1].condition[0].kind, "applicability") - self.assertEqual(inst.action[0].action[1].definitionCanonical, "ActivityDefinition/order-serum-urine-rrt-pcr-test") - self.assertEqual(inst.action[0].action[2].condition[0].expression.expression, "Should Order Serum Zika Virus IgM + Dengue Virus IgM") - self.assertEqual(inst.action[0].action[2].condition[0].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[2].condition[0].kind, "applicability") - self.assertEqual(inst.action[0].action[2].definitionCanonical, "ActivityDefinition/order-serum-zika-dengue-virus-igm") - self.assertEqual(inst.action[0].action[3].condition[0].expression.expression, "Should Consider IgM Antibody Testing") - self.assertEqual(inst.action[0].action[3].condition[0].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[3].condition[0].kind, "applicability") - self.assertEqual(inst.action[0].action[3].definitionCanonical, "ActivityDefinition/consider-igm-antibody-testing") - self.assertEqual(inst.action[0].action[4].action[0].definitionCanonical, "ActivityDefinition/provide-mosquito-prevention-advice") - self.assertEqual(inst.action[0].action[4].action[1].definitionCanonical, "ActivityDefinition/provide-contraception-advice") - self.assertEqual(inst.action[0].action[4].condition[0].expression.expression, "Should Provide Mosquito Prevention and Contraception Advice") - self.assertEqual(inst.action[0].action[4].condition[0].expression.language, "text/cql") - self.assertEqual(inst.action[0].action[4].condition[0].kind, "applicability") - self.assertEqual(inst.action[0].condition[0].expression.expression, "Is Patient Pregnant") - self.assertEqual(inst.action[0].condition[0].expression.language, "text/cql") - self.assertEqual(inst.action[0].condition[0].kind, "applicability") - self.assertEqual(inst.action[0].title, "Zika Virus Assessment") - self.assertEqual(inst.action[0].trigger[0].name, "patient-view") - self.assertEqual(inst.action[0].trigger[0].type, "named-event") - self.assertEqual(inst.date.date, FHIRDate("2016-11-14").date) - self.assertEqual(inst.date.as_json(), "2016-11-14") - self.assertEqual(inst.description, "Zika Virus Management intervention describing the CDC Guidelines for Zika Virus Reporting and Management.") - self.assertEqual(inst.id, "zika-virus-intervention-initial") - self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "zika-virus-intervention") - self.assertEqual(inst.library[0], "Library/zika-virus-intervention-logic") - self.assertEqual(inst.relatedArtifact[0].type, "derived-from") - self.assertEqual(inst.relatedArtifact[0].url, "https://www.cdc.gov/mmwr/volumes/65/wr/mm6539e1.htm?s_cid=mm6539e1_w") - self.assertEqual(inst.relatedArtifact[1].resource, "PlanDefinition/zika-virus-intervention") - self.assertEqual(inst.relatedArtifact[1].type, "successor") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.title, "Example Zika Virus Intervention") - self.assertEqual(inst.topic[0].text, "Zika Virus Management") - self.assertEqual(inst.url, "http://example.org/PlanDefinition/zika-virus-intervention") - self.assertEqual(inst.version, "1.0.0") diff --git a/fhirclient/models/population.py b/fhirclient/models/population.py index ea22d8067..1f14f24f2 100644 --- a/fhirclient/models/population.py +++ b/fhirclient/models/population.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Population) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Population) on 2024-07-15. +# 2024, SMART Health IT. from . import backboneelement diff --git a/fhirclient/models/practitioner.py b/fhirclient/models/practitioner.py index fc41aba3f..60f238999 100644 --- a/fhirclient/models/practitioner.py +++ b/fhirclient/models/practitioner.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Practitioner) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Practitioner) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/practitioner_tests.py b/fhirclient/models/practitioner_tests.py index 29b1c06f8..9d9093f7b 100644 --- a/fhirclient/models/practitioner_tests.py +++ b/fhirclient/models/practitioner_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return practitioner.Practitioner(js) def testPractitioner1(self): - inst = self.instantiate_from("practitioner-example-f203-jvg.json") + inst = self.instantiate_from("practitioner-example-f202-lm.json") self.assertIsNotNone(inst, "Must have instantiated a Practitioner instance") self.implPractitioner1(inst) @@ -36,24 +36,28 @@ def implPractitioner1(self, inst): self.assertEqual(inst.address[0].city, "Den helder") self.assertEqual(inst.address[0].country, "NLD") self.assertEqual(inst.address[0].line[0], "Walvisbaai 3") + self.assertEqual(inst.address[0].line[1], "C4 - Automatisering") self.assertEqual(inst.address[0].postalCode, "2333ZA") self.assertEqual(inst.address[0].use, "work") - self.assertEqual(inst.birthDate.date, FHIRDate("1983-04-20").date) - self.assertEqual(inst.birthDate.as_json(), "1983-04-20") + self.assertEqual(inst.birthDate.date, FHIRDate("1960-06-12").date) + self.assertEqual(inst.birthDate.as_json(), "1960-06-12") self.assertEqual(inst.gender, "male") - self.assertEqual(inst.id, "f203") + self.assertEqual(inst.id, "f202") self.assertEqual(inst.identifier[0].system, "urn:oid:2.16.528.1.1007.3.1") self.assertEqual(inst.identifier[0].type.text, "UZI-nummer") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "12345678903") + self.assertEqual(inst.identifier[0].value, "12345678902") self.assertEqual(inst.identifier[1].system, "https://www.bigregister.nl/") self.assertEqual(inst.identifier[1].type.text, "BIG-nummer") self.assertEqual(inst.identifier[1].use, "official") - self.assertEqual(inst.identifier[1].value, "12345678903") + self.assertEqual(inst.identifier[1].value, "12345678902") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].text, "Juri van Gelder") + self.assertEqual(inst.name[0].family, "Maas") + self.assertEqual(inst.name[0].given[0], "Luigi") + self.assertEqual(inst.name[0].prefix[0], "Dr.") + self.assertEqual(inst.name[0].text, "Luigi Maas") self.assertEqual(inst.name[0].use, "official") self.assertEqual(inst.telecom[0].system, "phone") self.assertEqual(inst.telecom[0].use, "work") @@ -61,7 +65,7 @@ def implPractitioner1(self, inst): self.assertEqual(inst.text.status, "generated") def testPractitioner2(self): - inst = self.instantiate_from("practitioner-example-f201-ab.json") + inst = self.instantiate_from("practitioner-example-f001-evdb.json") self.assertIsNotNone(inst, "Must have instantiated a Practitioner instance") self.implPractitioner2(inst) @@ -71,39 +75,41 @@ def testPractitioner2(self): self.implPractitioner2(inst2) def implPractitioner2(self, inst): - self.assertTrue(inst.active) - self.assertEqual(inst.address[0].city, "Den helder") + self.assertEqual(inst.address[0].city, "Den Burg") self.assertEqual(inst.address[0].country, "NLD") - self.assertEqual(inst.address[0].line[0], "Walvisbaai 3") - self.assertEqual(inst.address[0].line[1], "C4 - Automatisering") - self.assertEqual(inst.address[0].postalCode, "2333ZA") + self.assertEqual(inst.address[0].line[0], "Galapagosweg 91") + self.assertEqual(inst.address[0].postalCode, "9105 PZ") self.assertEqual(inst.address[0].use, "work") - self.assertEqual(inst.birthDate.date, FHIRDate("1956-12-24").date) - self.assertEqual(inst.birthDate.as_json(), "1956-12-24") + self.assertEqual(inst.birthDate.date, FHIRDate("1975-12-07").date) + self.assertEqual(inst.birthDate.as_json(), "1975-12-07") self.assertEqual(inst.gender, "male") - self.assertEqual(inst.id, "f201") + self.assertEqual(inst.id, "f001") self.assertEqual(inst.identifier[0].system, "urn:oid:2.16.528.1.1007.3.1") - self.assertEqual(inst.identifier[0].type.text, "UZI-nummer") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "12345678901") + self.assertEqual(inst.identifier[0].value, "938273695") + self.assertEqual(inst.identifier[1].system, "urn:oid:2.16.840.1.113883.2.4.6.3") + self.assertEqual(inst.identifier[1].use, "usual") + self.assertEqual(inst.identifier[1].value, "129IDH4OP733") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].family, "Bronsig") - self.assertEqual(inst.name[0].given[0], "Arend") - self.assertEqual(inst.name[0].prefix[0], "Dr.") - self.assertEqual(inst.name[0].text, "Dokter Bronsig") + self.assertEqual(inst.name[0].family, "van den broek") + self.assertEqual(inst.name[0].given[0], "Eric") + self.assertEqual(inst.name[0].suffix[0], "MD") self.assertEqual(inst.name[0].use, "official") - self.assertEqual(inst.qualification[0].code.coding[0].code, "41672002") - self.assertEqual(inst.qualification[0].code.coding[0].display, "Pulmonologist") - self.assertEqual(inst.qualification[0].code.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.telecom[0].system, "phone") self.assertEqual(inst.telecom[0].use, "work") - self.assertEqual(inst.telecom[0].value, "+31715269111") + self.assertEqual(inst.telecom[0].value, "0205568263") + self.assertEqual(inst.telecom[1].system, "email") + self.assertEqual(inst.telecom[1].use, "work") + self.assertEqual(inst.telecom[1].value, "E.M.vandenbroek@bmc.nl") + self.assertEqual(inst.telecom[2].system, "fax") + self.assertEqual(inst.telecom[2].use, "work") + self.assertEqual(inst.telecom[2].value, "0205664440") self.assertEqual(inst.text.status, "generated") def testPractitioner3(self): - inst = self.instantiate_from("practitioner-example-f202-lm.json") + inst = self.instantiate_from("practitioner-example-xcda1.json") self.assertIsNotNone(inst, "Must have instantiated a Practitioner instance") self.implPractitioner3(inst) @@ -113,40 +119,21 @@ def testPractitioner3(self): self.implPractitioner3(inst2) def implPractitioner3(self, inst): - self.assertTrue(inst.active) - self.assertEqual(inst.address[0].city, "Den helder") - self.assertEqual(inst.address[0].country, "NLD") - self.assertEqual(inst.address[0].line[0], "Walvisbaai 3") - self.assertEqual(inst.address[0].line[1], "C4 - Automatisering") - self.assertEqual(inst.address[0].postalCode, "2333ZA") - self.assertEqual(inst.address[0].use, "work") - self.assertEqual(inst.birthDate.date, FHIRDate("1960-06-12").date) - self.assertEqual(inst.birthDate.as_json(), "1960-06-12") - self.assertEqual(inst.gender, "male") - self.assertEqual(inst.id, "f202") - self.assertEqual(inst.identifier[0].system, "urn:oid:2.16.528.1.1007.3.1") - self.assertEqual(inst.identifier[0].type.text, "UZI-nummer") + self.assertEqual(inst.id, "xcda1") + self.assertEqual(inst.identifier[0].system, "http://healthcare.example.org/identifiers/staff") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "12345678902") - self.assertEqual(inst.identifier[1].system, "https://www.bigregister.nl/") - self.assertEqual(inst.identifier[1].type.text, "BIG-nummer") - self.assertEqual(inst.identifier[1].use, "official") - self.assertEqual(inst.identifier[1].value, "12345678902") + self.assertEqual(inst.identifier[0].value, "D234123") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].family, "Maas") - self.assertEqual(inst.name[0].given[0], "Luigi") - self.assertEqual(inst.name[0].prefix[0], "Dr.") - self.assertEqual(inst.name[0].text, "Luigi Maas") - self.assertEqual(inst.name[0].use, "official") - self.assertEqual(inst.telecom[0].system, "phone") - self.assertEqual(inst.telecom[0].use, "work") - self.assertEqual(inst.telecom[0].value, "+31715269111") + self.assertEqual(inst.name[0].family, "Dopplemeyer") + self.assertEqual(inst.name[0].given[0], "Sherry") + self.assertEqual(inst.telecom[0].system, "email") + self.assertEqual(inst.telecom[0].value, "john.doe@healthcare.example.org") self.assertEqual(inst.text.status, "generated") def testPractitioner4(self): - inst = self.instantiate_from("practitioner-example-xcda-author.json") + inst = self.instantiate_from("practitioner-example-f007-sh.json") self.assertIsNotNone(inst, "Must have instantiated a Practitioner instance") self.implPractitioner4(inst) @@ -156,17 +143,41 @@ def testPractitioner4(self): self.implPractitioner4(inst2) def implPractitioner4(self, inst): - self.assertEqual(inst.id, "xcda-author") + self.assertEqual(inst.address[0].city, "Den Burg") + self.assertEqual(inst.address[0].country, "NLD") + self.assertEqual(inst.address[0].line[0], "Galapagosweg 91") + self.assertEqual(inst.address[0].postalCode, "9105 PZ") + self.assertEqual(inst.address[0].use, "work") + self.assertEqual(inst.birthDate.date, FHIRDate("1971-11-07").date) + self.assertEqual(inst.birthDate.as_json(), "1971-11-07") + self.assertEqual(inst.gender, "female") + self.assertEqual(inst.id, "f007") + self.assertEqual(inst.identifier[0].system, "urn:oid:2.16.528.1.1007.3.1") + self.assertEqual(inst.identifier[0].use, "official") + self.assertEqual(inst.identifier[0].value, "874635264") + self.assertEqual(inst.identifier[1].system, "urn:oid:2.16.840.1.113883.2.4.6.3") + self.assertEqual(inst.identifier[1].use, "usual") + self.assertEqual(inst.identifier[1].value, "567IUI51C154") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].family, "Hippocrates") - self.assertEqual(inst.name[0].given[0], "Harold") + self.assertEqual(inst.name[0].family, "Heps") + self.assertEqual(inst.name[0].given[0], "Simone") self.assertEqual(inst.name[0].suffix[0], "MD") + self.assertEqual(inst.name[0].use, "official") + self.assertEqual(inst.telecom[0].system, "phone") + self.assertEqual(inst.telecom[0].use, "work") + self.assertEqual(inst.telecom[0].value, "020556936") + self.assertEqual(inst.telecom[1].system, "email") + self.assertEqual(inst.telecom[1].use, "work") + self.assertEqual(inst.telecom[1].value, "S.M.Heps@bmc.nl") + self.assertEqual(inst.telecom[2].system, "fax") + self.assertEqual(inst.telecom[2].use, "work") + self.assertEqual(inst.telecom[2].value, "0205669283") self.assertEqual(inst.text.status, "generated") def testPractitioner5(self): - inst = self.instantiate_from("practitioner-example-f003-mv.json") + inst = self.instantiate_from("practitioner-example-f204-ce.json") self.assertIsNotNone(inst, "Must have instantiated a Practitioner instance") self.implPractitioner5(inst) @@ -176,44 +187,31 @@ def testPractitioner5(self): self.implPractitioner5(inst2) def implPractitioner5(self, inst): - self.assertEqual(inst.address[0].city, "Amsterdam") + self.assertEqual(inst.address[0].city, "Den helder") self.assertEqual(inst.address[0].country, "NLD") - self.assertEqual(inst.address[0].line[0], "Galapagosweg 91") - self.assertEqual(inst.address[0].postalCode, "1105 AZ") + self.assertEqual(inst.address[0].line[0], "Walvisbaai 3") + self.assertEqual(inst.address[0].postalCode, "2333ZA") self.assertEqual(inst.address[0].use, "work") - self.assertEqual(inst.birthDate.date, FHIRDate("1963-07-01").date) - self.assertEqual(inst.birthDate.as_json(), "1963-07-01") - self.assertEqual(inst.communication[0].coding[0].code, "nl") - self.assertEqual(inst.communication[0].coding[0].display, "Dutch") - self.assertEqual(inst.communication[0].coding[0].system, "urn:ietf:bcp:47") - self.assertEqual(inst.gender, "male") - self.assertEqual(inst.id, "f003") + self.assertEqual(inst.birthDate.date, FHIRDate("1967-11-05").date) + self.assertEqual(inst.birthDate.as_json(), "1967-11-05") + self.assertEqual(inst.gender, "female") + self.assertEqual(inst.id, "f204") self.assertEqual(inst.identifier[0].system, "urn:oid:2.16.528.1.1007.3.1") + self.assertEqual(inst.identifier[0].type.text, "UZI-nummer") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "846100293") - self.assertEqual(inst.identifier[1].system, "urn:oid:2.16.840.1.113883.2.4.6.3") - self.assertEqual(inst.identifier[1].use, "usual") - self.assertEqual(inst.identifier[1].value, "243HID3RT938") + self.assertEqual(inst.identifier[0].value, "12345678904") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].family, "Versteegh") - self.assertEqual(inst.name[0].given[0], "Marc") - self.assertEqual(inst.name[0].suffix[0], "MD") - self.assertEqual(inst.name[0].use, "official") + self.assertEqual(inst.name[0].text, "Carla Espinosa") + self.assertEqual(inst.name[0].use, "usual") self.assertEqual(inst.telecom[0].system, "phone") self.assertEqual(inst.telecom[0].use, "work") - self.assertEqual(inst.telecom[0].value, "0205562431") - self.assertEqual(inst.telecom[1].system, "email") - self.assertEqual(inst.telecom[1].use, "work") - self.assertEqual(inst.telecom[1].value, "m.versteegh@bmc.nl") - self.assertEqual(inst.telecom[2].system, "fax") - self.assertEqual(inst.telecom[2].use, "work") - self.assertEqual(inst.telecom[2].value, "0205662948") + self.assertEqual(inst.telecom[0].value, "+31715262169") self.assertEqual(inst.text.status, "generated") def testPractitioner6(self): - inst = self.instantiate_from("practitioner-example-f002-pv.json") + inst = self.instantiate_from("practitioner-example-xcda-author.json") self.assertIsNotNone(inst, "Must have instantiated a Practitioner instance") self.implPractitioner6(inst) @@ -223,41 +221,17 @@ def testPractitioner6(self): self.implPractitioner6(inst2) def implPractitioner6(self, inst): - self.assertEqual(inst.address[0].city, "Den Burg") - self.assertEqual(inst.address[0].country, "NLD") - self.assertEqual(inst.address[0].line[0], "Galapagosweg 91") - self.assertEqual(inst.address[0].postalCode, "9105 PZ") - self.assertEqual(inst.address[0].use, "work") - self.assertEqual(inst.birthDate.date, FHIRDate("1979-04-29").date) - self.assertEqual(inst.birthDate.as_json(), "1979-04-29") - self.assertEqual(inst.gender, "male") - self.assertEqual(inst.id, "f002") - self.assertEqual(inst.identifier[0].system, "urn:oid:2.16.528.1.1007.3.1") - self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "730291637") - self.assertEqual(inst.identifier[1].system, "urn:oid:2.16.840.1.113883.2.4.6.3") - self.assertEqual(inst.identifier[1].use, "usual") - self.assertEqual(inst.identifier[1].value, "174BIP3JH438") + self.assertEqual(inst.id, "xcda-author") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].family, "Voigt") - self.assertEqual(inst.name[0].given[0], "Pieter") + self.assertEqual(inst.name[0].family, "Hippocrates") + self.assertEqual(inst.name[0].given[0], "Harold") self.assertEqual(inst.name[0].suffix[0], "MD") - self.assertEqual(inst.name[0].use, "official") - self.assertEqual(inst.telecom[0].system, "phone") - self.assertEqual(inst.telecom[0].use, "work") - self.assertEqual(inst.telecom[0].value, "0205569336") - self.assertEqual(inst.telecom[1].system, "email") - self.assertEqual(inst.telecom[1].use, "work") - self.assertEqual(inst.telecom[1].value, "p.voigt@bmc.nl") - self.assertEqual(inst.telecom[2].system, "fax") - self.assertEqual(inst.telecom[2].use, "work") - self.assertEqual(inst.telecom[2].value, "0205669382") self.assertEqual(inst.text.status, "generated") def testPractitioner7(self): - inst = self.instantiate_from("practitioner-example.json") + inst = self.instantiate_from("practitioner-example-f201-ab.json") self.assertIsNotNone(inst, "Must have instantiated a Practitioner instance") self.implPractitioner7(inst) @@ -268,32 +242,38 @@ def testPractitioner7(self): def implPractitioner7(self, inst): self.assertTrue(inst.active) - self.assertEqual(inst.address[0].city, "PleasantVille") - self.assertEqual(inst.address[0].line[0], "534 Erewhon St") - self.assertEqual(inst.address[0].postalCode, "3999") - self.assertEqual(inst.address[0].state, "Vic") - self.assertEqual(inst.address[0].use, "home") - self.assertEqual(inst.id, "example") - self.assertEqual(inst.identifier[0].system, "http://www.acme.org/practitioners") - self.assertEqual(inst.identifier[0].value, "23") + self.assertEqual(inst.address[0].city, "Den helder") + self.assertEqual(inst.address[0].country, "NLD") + self.assertEqual(inst.address[0].line[0], "Walvisbaai 3") + self.assertEqual(inst.address[0].line[1], "C4 - Automatisering") + self.assertEqual(inst.address[0].postalCode, "2333ZA") + self.assertEqual(inst.address[0].use, "work") + self.assertEqual(inst.birthDate.date, FHIRDate("1956-12-24").date) + self.assertEqual(inst.birthDate.as_json(), "1956-12-24") + self.assertEqual(inst.gender, "male") + self.assertEqual(inst.id, "f201") + self.assertEqual(inst.identifier[0].system, "urn:oid:2.16.528.1.1007.3.1") + self.assertEqual(inst.identifier[0].type.text, "UZI-nummer") + self.assertEqual(inst.identifier[0].use, "official") + self.assertEqual(inst.identifier[0].value, "12345678901") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].family, "Careful") - self.assertEqual(inst.name[0].given[0], "Adam") - self.assertEqual(inst.name[0].prefix[0], "Dr") - self.assertEqual(inst.qualification[0].code.coding[0].code, "BS") - self.assertEqual(inst.qualification[0].code.coding[0].display, "Bachelor of Science") - self.assertEqual(inst.qualification[0].code.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0360/2.7") - self.assertEqual(inst.qualification[0].code.text, "Bachelor of Science") - self.assertEqual(inst.qualification[0].identifier[0].system, "http://example.org/UniversityIdentifier") - self.assertEqual(inst.qualification[0].identifier[0].value, "12345") - self.assertEqual(inst.qualification[0].period.start.date, FHIRDate("1995").date) - self.assertEqual(inst.qualification[0].period.start.as_json(), "1995") + self.assertEqual(inst.name[0].family, "Bronsig") + self.assertEqual(inst.name[0].given[0], "Arend") + self.assertEqual(inst.name[0].prefix[0], "Dr.") + self.assertEqual(inst.name[0].text, "Dokter Bronsig") + self.assertEqual(inst.name[0].use, "official") + self.assertEqual(inst.qualification[0].code.coding[0].code, "41672002") + self.assertEqual(inst.qualification[0].code.coding[0].display, "Pulmonologist") + self.assertEqual(inst.qualification[0].code.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.telecom[0].system, "phone") + self.assertEqual(inst.telecom[0].use, "work") + self.assertEqual(inst.telecom[0].value, "+31715269111") self.assertEqual(inst.text.status, "generated") def testPractitioner8(self): - inst = self.instantiate_from("practitioner-example-f007-sh.json") + inst = self.instantiate_from("practitioner-example-f004-rb.json") self.assertIsNotNone(inst, "Must have instantiated a Practitioner instance") self.implPractitioner8(inst) @@ -303,41 +283,45 @@ def testPractitioner8(self): self.implPractitioner8(inst2) def implPractitioner8(self, inst): - self.assertEqual(inst.address[0].city, "Den Burg") + self.assertEqual(inst.address[0].city, "Amsterdam") self.assertEqual(inst.address[0].country, "NLD") self.assertEqual(inst.address[0].line[0], "Galapagosweg 91") - self.assertEqual(inst.address[0].postalCode, "9105 PZ") + self.assertEqual(inst.address[0].postalCode, "1105 AZ") self.assertEqual(inst.address[0].use, "work") - self.assertEqual(inst.birthDate.date, FHIRDate("1971-11-07").date) - self.assertEqual(inst.birthDate.as_json(), "1971-11-07") - self.assertEqual(inst.gender, "female") - self.assertEqual(inst.id, "f007") + self.assertEqual(inst.birthDate.date, FHIRDate("1980-02-04").date) + self.assertEqual(inst.birthDate.as_json(), "1980-02-04") + self.assertEqual(inst.communication[0].coding[0].code, "nl") + self.assertEqual(inst.communication[0].coding[0].display, "Netherlands") + self.assertEqual(inst.communication[0].coding[0].system, "urn:ietf:bcp:47") + self.assertEqual(inst.communication[0].text, "Language") + self.assertEqual(inst.gender, "male") + self.assertEqual(inst.id, "f004") self.assertEqual(inst.identifier[0].system, "urn:oid:2.16.528.1.1007.3.1") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "874635264") + self.assertEqual(inst.identifier[0].value, "118265112") self.assertEqual(inst.identifier[1].system, "urn:oid:2.16.840.1.113883.2.4.6.3") self.assertEqual(inst.identifier[1].use, "usual") - self.assertEqual(inst.identifier[1].value, "567IUI51C154") + self.assertEqual(inst.identifier[1].value, "523ASA1LK927") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].family, "Heps") - self.assertEqual(inst.name[0].given[0], "Simone") + self.assertEqual(inst.name[0].family, "Briet") + self.assertEqual(inst.name[0].given[0], "Ronald") self.assertEqual(inst.name[0].suffix[0], "MD") self.assertEqual(inst.name[0].use, "official") self.assertEqual(inst.telecom[0].system, "phone") self.assertEqual(inst.telecom[0].use, "work") - self.assertEqual(inst.telecom[0].value, "020556936") + self.assertEqual(inst.telecom[0].value, "0205569273") self.assertEqual(inst.telecom[1].system, "email") self.assertEqual(inst.telecom[1].use, "work") - self.assertEqual(inst.telecom[1].value, "S.M.Heps@bmc.nl") + self.assertEqual(inst.telecom[1].value, "r.briet@bmc.nl") self.assertEqual(inst.telecom[2].system, "fax") self.assertEqual(inst.telecom[2].use, "work") - self.assertEqual(inst.telecom[2].value, "0205669283") + self.assertEqual(inst.telecom[2].value, "0205664440") self.assertEqual(inst.text.status, "generated") def testPractitioner9(self): - inst = self.instantiate_from("practitioner-example-f204-ce.json") + inst = self.instantiate_from("practitioner-example-f002-pv.json") self.assertIsNotNone(inst, "Must have instantiated a Practitioner instance") self.implPractitioner9(inst) @@ -347,31 +331,41 @@ def testPractitioner9(self): self.implPractitioner9(inst2) def implPractitioner9(self, inst): - self.assertEqual(inst.address[0].city, "Den helder") + self.assertEqual(inst.address[0].city, "Den Burg") self.assertEqual(inst.address[0].country, "NLD") - self.assertEqual(inst.address[0].line[0], "Walvisbaai 3") - self.assertEqual(inst.address[0].postalCode, "2333ZA") + self.assertEqual(inst.address[0].line[0], "Galapagosweg 91") + self.assertEqual(inst.address[0].postalCode, "9105 PZ") self.assertEqual(inst.address[0].use, "work") - self.assertEqual(inst.birthDate.date, FHIRDate("1967-11-05").date) - self.assertEqual(inst.birthDate.as_json(), "1967-11-05") - self.assertEqual(inst.gender, "female") - self.assertEqual(inst.id, "f204") + self.assertEqual(inst.birthDate.date, FHIRDate("1979-04-29").date) + self.assertEqual(inst.birthDate.as_json(), "1979-04-29") + self.assertEqual(inst.gender, "male") + self.assertEqual(inst.id, "f002") self.assertEqual(inst.identifier[0].system, "urn:oid:2.16.528.1.1007.3.1") - self.assertEqual(inst.identifier[0].type.text, "UZI-nummer") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "12345678904") + self.assertEqual(inst.identifier[0].value, "730291637") + self.assertEqual(inst.identifier[1].system, "urn:oid:2.16.840.1.113883.2.4.6.3") + self.assertEqual(inst.identifier[1].use, "usual") + self.assertEqual(inst.identifier[1].value, "174BIP3JH438") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].text, "Carla Espinosa") - self.assertEqual(inst.name[0].use, "usual") + self.assertEqual(inst.name[0].family, "Voigt") + self.assertEqual(inst.name[0].given[0], "Pieter") + self.assertEqual(inst.name[0].suffix[0], "MD") + self.assertEqual(inst.name[0].use, "official") self.assertEqual(inst.telecom[0].system, "phone") self.assertEqual(inst.telecom[0].use, "work") - self.assertEqual(inst.telecom[0].value, "+31715262169") + self.assertEqual(inst.telecom[0].value, "0205569336") + self.assertEqual(inst.telecom[1].system, "email") + self.assertEqual(inst.telecom[1].use, "work") + self.assertEqual(inst.telecom[1].value, "p.voigt@bmc.nl") + self.assertEqual(inst.telecom[2].system, "fax") + self.assertEqual(inst.telecom[2].use, "work") + self.assertEqual(inst.telecom[2].value, "0205669382") self.assertEqual(inst.text.status, "generated") def testPractitioner10(self): - inst = self.instantiate_from("practitioner-example-xcda1.json") + inst = self.instantiate_from("practitioner-example-f006-rvdb.json") self.assertIsNotNone(inst, "Must have instantiated a Practitioner instance") self.implPractitioner10(inst) @@ -381,16 +375,36 @@ def testPractitioner10(self): self.implPractitioner10(inst2) def implPractitioner10(self, inst): - self.assertEqual(inst.id, "xcda1") - self.assertEqual(inst.identifier[0].system, "http://healthcare.example.org/identifiers/staff") + self.assertEqual(inst.address[0].city, "Den Burg") + self.assertEqual(inst.address[0].country, "NLD") + self.assertEqual(inst.address[0].line[0], "Galapagosweg 91") + self.assertEqual(inst.address[0].postalCode, "9105 PZ") + self.assertEqual(inst.address[0].use, "work") + self.assertEqual(inst.birthDate.date, FHIRDate("1975-12-07").date) + self.assertEqual(inst.birthDate.as_json(), "1975-12-07") + self.assertEqual(inst.gender, "male") + self.assertEqual(inst.id, "f006") + self.assertEqual(inst.identifier[0].system, "urn:oid:2.16.528.1.1007.3.1") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "D234123") + self.assertEqual(inst.identifier[0].value, "937223645") + self.assertEqual(inst.identifier[1].system, "urn:oid:2.16.840.1.113883.2.4.6.3") + self.assertEqual(inst.identifier[1].use, "usual") + self.assertEqual(inst.identifier[1].value, "134IDY41W988") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].family, "Dopplemeyer") - self.assertEqual(inst.name[0].given[0], "Sherry") - self.assertEqual(inst.telecom[0].system, "email") - self.assertEqual(inst.telecom[0].value, "john.doe@healthcare.example.org") + self.assertEqual(inst.name[0].family, "van den Berk") + self.assertEqual(inst.name[0].given[0], "Rob") + self.assertEqual(inst.name[0].suffix[0], "MD") + self.assertEqual(inst.name[0].use, "official") + self.assertEqual(inst.telecom[0].system, "phone") + self.assertEqual(inst.telecom[0].use, "work") + self.assertEqual(inst.telecom[0].value, "0205569288") + self.assertEqual(inst.telecom[1].system, "email") + self.assertEqual(inst.telecom[1].use, "work") + self.assertEqual(inst.telecom[1].value, "R.A.vandenberk@bmc.nl") + self.assertEqual(inst.telecom[2].system, "fax") + self.assertEqual(inst.telecom[2].use, "work") + self.assertEqual(inst.telecom[2].value, "0205664987") self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/practitionerrole.py b/fhirclient/models/practitionerrole.py index 1ecca2e3a..33b2dce98 100644 --- a/fhirclient/models/practitionerrole.py +++ b/fhirclient/models/practitionerrole.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/PractitionerRole) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/PractitionerRole) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/practitionerrole_tests.py b/fhirclient/models/practitionerrole_tests.py index 5a8d81427..afe11b9e8 100644 --- a/fhirclient/models/practitionerrole_tests.py +++ b/fhirclient/models/practitionerrole_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/procedure.py b/fhirclient/models/procedure.py index 2a865916c..31355b73b 100644 --- a/fhirclient/models/procedure.py +++ b/fhirclient/models/procedure.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Procedure) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Procedure) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -134,7 +134,7 @@ def __init__(self, jsondict=None, strict=True): List of `FHIRReference` items (represented as `dict` in JSON). """ self.status = None - """ preparation | in-progress | not-done | suspended | aborted | + """ preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown. Type `str`. """ diff --git a/fhirclient/models/procedure_tests.py b/fhirclient/models/procedure_tests.py index ce9b927f4..6ab51995b 100644 --- a/fhirclient/models/procedure_tests.py +++ b/fhirclient/models/procedure_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return procedure.Procedure(js) def testProcedure1(self): - inst = self.instantiate_from("procedure-example-f201-tpf.json") + inst = self.instantiate_from("procedure-example-ambulation.json") self.assertIsNotNone(inst, "Must have instantiated a Procedure instance") self.implProcedure1(inst) @@ -32,40 +32,6 @@ def testProcedure1(self): self.implProcedure1(inst2) def implProcedure1(self, inst): - self.assertEqual(inst.bodySite[0].coding[0].code, "272676008") - self.assertEqual(inst.bodySite[0].coding[0].display, "Sphenoid bone") - self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.code.coding[0].code, "367336001") - self.assertEqual(inst.code.coding[0].display, "Chemotherapy") - self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.id, "f201") - self.assertEqual(inst.instantiatesCanonical[0], "PlanDefinition/KDN5") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.note[0].text, "Eerste neo-adjuvante TPF-kuur bij groot proces in sphenoid met intracraniale uitbreiding.") - self.assertEqual(inst.performedPeriod.end.date, FHIRDate("2013-01-28T14:27:00+01:00").date) - self.assertEqual(inst.performedPeriod.end.as_json(), "2013-01-28T14:27:00+01:00") - self.assertEqual(inst.performedPeriod.start.date, FHIRDate("2013-01-28T13:31:00+01:00").date) - self.assertEqual(inst.performedPeriod.start.as_json(), "2013-01-28T13:31:00+01:00") - self.assertEqual(inst.performer[0].function.coding[0].code, "310512001") - self.assertEqual(inst.performer[0].function.coding[0].display, "Medical oncologist") - self.assertEqual(inst.performer[0].function.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.reasonCode[0].text, "DiagnosticReport/f201") - self.assertEqual(inst.status, "completed") - self.assertEqual(inst.text.status, "generated") - - def testProcedure2(self): - inst = self.instantiate_from("procedure-example-ambulation.json") - self.assertIsNotNone(inst, "Must have instantiated a Procedure instance") - self.implProcedure2(inst) - - js = inst.as_json() - self.assertEqual("Procedure", js["resourceType"]) - inst2 = procedure.Procedure(js) - self.implProcedure2(inst2) - - def implProcedure2(self, inst): self.assertEqual(inst.code.coding[0].code, "62013009") self.assertEqual(inst.code.coding[0].display, "Ambulating patient (procedure)") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") @@ -84,105 +50,115 @@ def implProcedure2(self, inst): self.assertEqual(inst.text.div, "
Ambulation procedure was not done
") self.assertEqual(inst.text.status, "generated") - def testProcedure3(self): - inst = self.instantiate_from("procedure-example-implant.json") + def testProcedure2(self): + inst = self.instantiate_from("procedure-example-biopsy.json") self.assertIsNotNone(inst, "Must have instantiated a Procedure instance") - self.implProcedure3(inst) + self.implProcedure2(inst) js = inst.as_json() self.assertEqual("Procedure", js["resourceType"]) inst2 = procedure.Procedure(js) - self.implProcedure3(inst2) + self.implProcedure2(inst2) - def implProcedure3(self, inst): - self.assertEqual(inst.code.coding[0].code, "25267002") - self.assertEqual(inst.code.coding[0].display, "Insertion of intracardiac pacemaker (procedure)") + def implProcedure2(self, inst): + self.assertEqual(inst.bodySite[0].coding[0].code, "368225008") + self.assertEqual(inst.bodySite[0].coding[0].display, "Entire Left Forearm") + self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.bodySite[0].text, "Left forearm") + self.assertEqual(inst.category.coding[0].code, "103693007") + self.assertEqual(inst.category.coding[0].display, "Diagnostic procedure (procedure)") + self.assertEqual(inst.category.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.category.text, "Diagnostic procedure") + self.assertEqual(inst.code.coding[0].code, "90105005") + self.assertEqual(inst.code.coding[0].display, "Biopsy of soft tissue of forearm (Procedure)") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.code.text, "Implant Pacemaker") - self.assertEqual(inst.focalDevice[0].action.coding[0].code, "implanted") - self.assertEqual(inst.focalDevice[0].action.coding[0].system, "http://hl7.org/fhir/device-action") - self.assertEqual(inst.followUp[0].text, "ROS 5 days - 2013-04-10") - self.assertEqual(inst.id, "example-implant") + self.assertEqual(inst.code.text, "Biopsy of suspected melanoma L) arm") + self.assertEqual(inst.complication[0].coding[0].code, "67750007") + self.assertEqual(inst.complication[0].coding[0].display, "Ineffective airway clearance (finding)") + self.assertEqual(inst.complication[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.complication[0].text, "Ineffective airway clearance") + self.assertEqual(inst.followUp[0].text, "Review in clinic") + self.assertEqual(inst.id, "biopsy") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.note[0].text, "Routine Appendectomy. Appendix was inflamed and in retro-caecal position") - self.assertEqual(inst.performedDateTime.date, FHIRDate("2015-04-05").date) - self.assertEqual(inst.performedDateTime.as_json(), "2015-04-05") - self.assertEqual(inst.reasonCode[0].text, "Bradycardia") + self.assertEqual(inst.note[0].text, "Standard Biopsy") + self.assertEqual(inst.performedDateTime.date, FHIRDate("2014-02-03").date) + self.assertEqual(inst.performedDateTime.as_json(), "2014-02-03") + self.assertEqual(inst.reasonCode[0].text, "Dark lesion l) forearm. getting darker last 3 months.") self.assertEqual(inst.status, "completed") + self.assertEqual(inst.text.div, "
Biopsy of suspected melanoma L) arm
") self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.usedCode[0].coding[0].code, "79068005") + self.assertEqual(inst.usedCode[0].coding[0].display, "Needle, device (physical object)") + self.assertEqual(inst.usedCode[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.usedCode[0].text, "30-guage needle") - def testProcedure4(self): - inst = self.instantiate_from("procedure-example-colon-biopsy.json") + def testProcedure3(self): + inst = self.instantiate_from("procedure-example-appendectomy-narrative.json") self.assertIsNotNone(inst, "Must have instantiated a Procedure instance") - self.implProcedure4(inst) + self.implProcedure3(inst) js = inst.as_json() self.assertEqual("Procedure", js["resourceType"]) inst2 = procedure.Procedure(js) - self.implProcedure4(inst2) + self.implProcedure3(inst2) - def implProcedure4(self, inst): - self.assertEqual(inst.code.coding[0].code, "76164006") - self.assertEqual(inst.code.coding[0].display, "Biopsy of colon (procedure)") - self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.code.text, "Biopsy of colon") - self.assertEqual(inst.id, "colon-biopsy") - self.assertEqual(inst.identifier[0].value, "12345") + def implProcedure3(self, inst): + self.assertEqual(inst.id, "appendectomy-narrative") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.status, "completed") - self.assertEqual(inst.text.div, "
Biopsy of colon, which was part of colonoscopy
") - self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.text.div, "
Routine Appendectomy in April 2013 performed by Dr Cecil Surgeon
") + self.assertEqual(inst.text.status, "additional") - def testProcedure5(self): - inst = self.instantiate_from("procedure-example-f004-tracheotomy.json") + def testProcedure4(self): + inst = self.instantiate_from("procedure-example-f003-abscess.json") self.assertIsNotNone(inst, "Must have instantiated a Procedure instance") - self.implProcedure5(inst) + self.implProcedure4(inst) js = inst.as_json() self.assertEqual("Procedure", js["resourceType"]) inst2 = procedure.Procedure(js) - self.implProcedure5(inst2) + self.implProcedure4(inst2) - def implProcedure5(self, inst): + def implProcedure4(self, inst): self.assertEqual(inst.bodySite[0].coding[0].code, "83030008") self.assertEqual(inst.bodySite[0].coding[0].display, "Retropharyngeal area") self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.code.coding[0].code, "48387007") - self.assertEqual(inst.code.coding[0].display, "Tracheotomy") + self.assertEqual(inst.code.coding[0].code, "172960003") + self.assertEqual(inst.code.coding[0].display, "Incision of retropharyngeal abscess") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.followUp[0].text, "described in care plan") - self.assertEqual(inst.id, "f004") + self.assertEqual(inst.id, "f003") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.outcome.text, "removal of the retropharyngeal abscess") - self.assertEqual(inst.performedPeriod.end.date, FHIRDate("2013-03-22T10:30:10+01:00").date) - self.assertEqual(inst.performedPeriod.end.as_json(), "2013-03-22T10:30:10+01:00") - self.assertEqual(inst.performedPeriod.start.date, FHIRDate("2013-03-22T09:30:10+01:00").date) - self.assertEqual(inst.performedPeriod.start.as_json(), "2013-03-22T09:30:10+01:00") + self.assertEqual(inst.performedPeriod.end.date, FHIRDate("2013-03-24T10:30:10+01:00").date) + self.assertEqual(inst.performedPeriod.end.as_json(), "2013-03-24T10:30:10+01:00") + self.assertEqual(inst.performedPeriod.start.date, FHIRDate("2013-03-24T09:30:10+01:00").date) + self.assertEqual(inst.performedPeriod.start.as_json(), "2013-03-24T09:30:10+01:00") self.assertEqual(inst.performer[0].function.coding[0].code, "01.000") self.assertEqual(inst.performer[0].function.coding[0].display, "Arts") self.assertEqual(inst.performer[0].function.coding[0].system, "urn:oid:2.16.840.1.113883.2.4.15.111") self.assertEqual(inst.performer[0].function.text, "Care role") - self.assertEqual(inst.reasonCode[0].text, "ensure breathing during surgery") + self.assertEqual(inst.reasonCode[0].text, "abcess in retropharyngeal area") self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.status, "generated") - def testProcedure6(self): + def testProcedure5(self): inst = self.instantiate_from("procedure-example-education.json") self.assertIsNotNone(inst, "Must have instantiated a Procedure instance") - self.implProcedure6(inst) + self.implProcedure5(inst) js = inst.as_json() self.assertEqual("Procedure", js["resourceType"]) inst2 = procedure.Procedure(js) - self.implProcedure6(inst2) + self.implProcedure5(inst2) - def implProcedure6(self, inst): + def implProcedure5(self, inst): self.assertEqual(inst.category.coding[0].code, "311401005") self.assertEqual(inst.category.coding[0].display, "Patient education (procedure)") self.assertEqual(inst.category.coding[0].system, "http://snomed.info/sct") @@ -202,17 +178,17 @@ def implProcedure6(self, inst): self.assertEqual(inst.text.div, "
Health education - breast examination for early detection of breast mass
") self.assertEqual(inst.text.status, "generated") - def testProcedure7(self): + def testProcedure6(self): inst = self.instantiate_from("procedure-example-colonoscopy.json") self.assertIsNotNone(inst, "Must have instantiated a Procedure instance") - self.implProcedure7(inst) + self.implProcedure6(inst) js = inst.as_json() self.assertEqual("Procedure", js["resourceType"]) inst2 = procedure.Procedure(js) - self.implProcedure7(inst2) + self.implProcedure6(inst2) - def implProcedure7(self, inst): + def implProcedure6(self, inst): self.assertEqual(inst.code.coding[0].code, "73761001") self.assertEqual(inst.code.coding[0].display, "Colonoscopy (procedure)") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") @@ -226,8 +202,39 @@ def implProcedure7(self, inst): self.assertEqual(inst.text.div, "
Colonoscopy with complication
") self.assertEqual(inst.text.status, "generated") + def testProcedure7(self): + inst = self.instantiate_from("procedure-example-ob.json") + self.assertIsNotNone(inst, "Must have instantiated a Procedure instance") + self.implProcedure7(inst) + + js = inst.as_json() + self.assertEqual("Procedure", js["resourceType"]) + inst2 = procedure.Procedure(js) + self.implProcedure7(inst2) + + def implProcedure7(self, inst): + self.assertEqual(inst.category.coding[0].code, "386637004") + self.assertEqual(inst.category.coding[0].display, "Obstetric procedure (procedure)") + self.assertEqual(inst.category.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.category.text, "OB") + self.assertEqual(inst.code.coding[0].code, "22633006") + self.assertEqual(inst.code.coding[0].display, "Vaginal delivery, medical personnel present (procedure)") + self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.code.text, "Vaginal delivery") + self.assertEqual(inst.id, "ob") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.outcome.text, "delivery of healthy male infant") + self.assertEqual(inst.performedDateTime.date, FHIRDate("2012-06-02").date) + self.assertEqual(inst.performedDateTime.as_json(), "2012-06-02") + self.assertEqual(inst.reasonCode[0].text, "term pregnancy, active labor") + self.assertEqual(inst.status, "completed") + self.assertEqual(inst.text.div, "
Vaginal delivery of healthy male infant on June 2, 2012
") + self.assertEqual(inst.text.status, "generated") + def testProcedure8(self): - inst = self.instantiate_from("procedure-example-physical-therapy.json") + inst = self.instantiate_from("procedure-example-f001-heart.json") self.assertIsNotNone(inst, "Must have instantiated a Procedure instance") self.implProcedure8(inst) @@ -237,31 +244,32 @@ def testProcedure8(self): self.implProcedure8(inst2) def implProcedure8(self, inst): - self.assertEqual(inst.bodySite[0].coding[0].code, "36701003") - self.assertEqual(inst.bodySite[0].coding[0].display, "Both knees (body structure)") + self.assertEqual(inst.bodySite[0].coding[0].code, "17401000") + self.assertEqual(inst.bodySite[0].coding[0].display, "Heart valve structure") self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.bodySite[0].text, "Both knees") - self.assertEqual(inst.category.coding[0].code, "386053000") - self.assertEqual(inst.category.coding[0].display, "Evaluation procedure (procedure)") - self.assertEqual(inst.category.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.category.text, "Evaluation") - self.assertEqual(inst.code.coding[0].code, "710830005") - self.assertEqual(inst.code.coding[0].display, "Assessment of passive range of motion (procedure)") + self.assertEqual(inst.code.coding[0].code, "34068001") + self.assertEqual(inst.code.coding[0].display, "Heart valve replacement") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.code.text, "Assessment of passive range of motion") - self.assertEqual(inst.id, "physical-therapy") + self.assertEqual(inst.followUp[0].text, "described in care plan") + self.assertEqual(inst.id, "f001") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.performedDateTime.date, FHIRDate("2016-09-27").date) - self.assertEqual(inst.performedDateTime.as_json(), "2016-09-27") - self.assertEqual(inst.reasonCode[0].text, "assessment of mobility limitations due to osteoarthritis") + self.assertEqual(inst.outcome.text, "improved blood circulation") + self.assertEqual(inst.performedPeriod.end.date, FHIRDate("2011-06-27").date) + self.assertEqual(inst.performedPeriod.end.as_json(), "2011-06-27") + self.assertEqual(inst.performedPeriod.start.date, FHIRDate("2011-06-26").date) + self.assertEqual(inst.performedPeriod.start.as_json(), "2011-06-26") + self.assertEqual(inst.performer[0].function.coding[0].code, "01.000") + self.assertEqual(inst.performer[0].function.coding[0].display, "Arts") + self.assertEqual(inst.performer[0].function.coding[0].system, "urn:oid:2.16.840.1.113883.2.4.15.111") + self.assertEqual(inst.performer[0].function.text, "Care role") + self.assertEqual(inst.reasonCode[0].text, "Heart valve disorder") self.assertEqual(inst.status, "completed") - self.assertEqual(inst.text.div, "
Assessment of passive range of motion for both knees on Sept 27, 2016 due to osteoarthritis
") self.assertEqual(inst.text.status, "generated") def testProcedure9(self): - inst = self.instantiate_from("procedure-example-f003-abscess.json") + inst = self.instantiate_from("procedure-example-f004-tracheotomy.json") self.assertIsNotNone(inst, "Must have instantiated a Procedure instance") self.implProcedure9(inst) @@ -274,29 +282,29 @@ def implProcedure9(self, inst): self.assertEqual(inst.bodySite[0].coding[0].code, "83030008") self.assertEqual(inst.bodySite[0].coding[0].display, "Retropharyngeal area") self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.code.coding[0].code, "172960003") - self.assertEqual(inst.code.coding[0].display, "Incision of retropharyngeal abscess") + self.assertEqual(inst.code.coding[0].code, "48387007") + self.assertEqual(inst.code.coding[0].display, "Tracheotomy") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.followUp[0].text, "described in care plan") - self.assertEqual(inst.id, "f003") + self.assertEqual(inst.id, "f004") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.outcome.text, "removal of the retropharyngeal abscess") - self.assertEqual(inst.performedPeriod.end.date, FHIRDate("2013-03-24T10:30:10+01:00").date) - self.assertEqual(inst.performedPeriod.end.as_json(), "2013-03-24T10:30:10+01:00") - self.assertEqual(inst.performedPeriod.start.date, FHIRDate("2013-03-24T09:30:10+01:00").date) - self.assertEqual(inst.performedPeriod.start.as_json(), "2013-03-24T09:30:10+01:00") + self.assertEqual(inst.performedPeriod.end.date, FHIRDate("2013-03-22T10:30:10+01:00").date) + self.assertEqual(inst.performedPeriod.end.as_json(), "2013-03-22T10:30:10+01:00") + self.assertEqual(inst.performedPeriod.start.date, FHIRDate("2013-03-22T09:30:10+01:00").date) + self.assertEqual(inst.performedPeriod.start.as_json(), "2013-03-22T09:30:10+01:00") self.assertEqual(inst.performer[0].function.coding[0].code, "01.000") self.assertEqual(inst.performer[0].function.coding[0].display, "Arts") self.assertEqual(inst.performer[0].function.coding[0].system, "urn:oid:2.16.840.1.113883.2.4.15.111") self.assertEqual(inst.performer[0].function.text, "Care role") - self.assertEqual(inst.reasonCode[0].text, "abcess in retropharyngeal area") + self.assertEqual(inst.reasonCode[0].text, "ensure breathing during surgery") self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.status, "generated") def testProcedure10(self): - inst = self.instantiate_from("procedure-example.json") + inst = self.instantiate_from("procedure-example-implant.json") self.assertIsNotNone(inst, "Must have instantiated a Procedure instance") self.implProcedure10(inst) @@ -306,20 +314,21 @@ def testProcedure10(self): self.implProcedure10(inst2) def implProcedure10(self, inst): - self.assertEqual(inst.code.coding[0].code, "80146002") - self.assertEqual(inst.code.coding[0].display, "Appendectomy (Procedure)") + self.assertEqual(inst.code.coding[0].code, "25267002") + self.assertEqual(inst.code.coding[0].display, "Insertion of intracardiac pacemaker (procedure)") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.code.text, "Appendectomy") + self.assertEqual(inst.code.text, "Implant Pacemaker") + self.assertEqual(inst.focalDevice[0].action.coding[0].code, "implanted") + self.assertEqual(inst.focalDevice[0].action.coding[0].system, "http://hl7.org/fhir/device-action") self.assertEqual(inst.followUp[0].text, "ROS 5 days - 2013-04-10") - self.assertEqual(inst.id, "example") + self.assertEqual(inst.id, "example-implant") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.note[0].text, "Routine Appendectomy. Appendix was inflamed and in retro-caecal position") - self.assertEqual(inst.performedDateTime.date, FHIRDate("2013-04-05").date) - self.assertEqual(inst.performedDateTime.as_json(), "2013-04-05") - self.assertEqual(inst.reasonCode[0].text, "Generalized abdominal pain 24 hours. Localized in RIF with rebound and guarding") + self.assertEqual(inst.performedDateTime.date, FHIRDate("2015-04-05").date) + self.assertEqual(inst.performedDateTime.as_json(), "2015-04-05") + self.assertEqual(inst.reasonCode[0].text, "Bradycardia") self.assertEqual(inst.status, "completed") - self.assertEqual(inst.text.div, "
Routine Appendectomy
") self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/prodcharacteristic.py b/fhirclient/models/prodcharacteristic.py index 8a2b5c6a2..9f1732ab0 100644 --- a/fhirclient/models/prodcharacteristic.py +++ b/fhirclient/models/prodcharacteristic.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ProdCharacteristic) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ProdCharacteristic) on 2024-07-15. +# 2024, SMART Health IT. from . import backboneelement diff --git a/fhirclient/models/productshelflife.py b/fhirclient/models/productshelflife.py index 140062f07..25813e177 100644 --- a/fhirclient/models/productshelflife.py +++ b/fhirclient/models/productshelflife.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ProductShelfLife) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ProductShelfLife) on 2024-07-15. +# 2024, SMART Health IT. from . import backboneelement diff --git a/fhirclient/models/provenance.py b/fhirclient/models/provenance.py index b0e1ca24e..2d47cc48c 100644 --- a/fhirclient/models/provenance.py +++ b/fhirclient/models/provenance.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Provenance) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Provenance) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/provenance_tests.py b/fhirclient/models/provenance_tests.py index 4d61896a2..01e4e86f0 100644 --- a/fhirclient/models/provenance_tests.py +++ b/fhirclient/models/provenance_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return provenance.Provenance(js) def testProvenance1(self): - inst = self.instantiate_from("provenance-example-sig.json") + inst = self.instantiate_from("provenance-example-cwl.json") self.assertIsNotNone(inst, "Must have instantiated a Provenance instance") self.implProvenance1(inst) @@ -32,6 +32,31 @@ def testProvenance1(self): self.implProvenance1(inst2) def implProvenance1(self, inst): + self.assertEqual(inst.agent[0].type.coding[0].code, "AUT") + self.assertEqual(inst.agent[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") + self.assertEqual(inst.entity[0].role, "source") + self.assertEqual(inst.id, "example-cwl") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.occurredPeriod.start.date, FHIRDate("2016-11-30").date) + self.assertEqual(inst.occurredPeriod.start.as_json(), "2016-11-30") + self.assertEqual(inst.reason[0].text, "profiling Short Tandem Repeats (STRs) from high throughput sequencing data.") + self.assertEqual(inst.recorded.date, FHIRDate("2016-12-01T08:12:14+10:00").date) + self.assertEqual(inst.recorded.as_json(), "2016-12-01T08:12:14+10:00") + self.assertEqual(inst.text.status, "generated") + + def testProvenance2(self): + inst = self.instantiate_from("provenance-example-sig.json") + self.assertIsNotNone(inst, "Must have instantiated a Provenance instance") + self.implProvenance2(inst) + + js = inst.as_json() + self.assertEqual("Provenance", js["resourceType"]) + inst2 = provenance.Provenance(js) + self.implProvenance2(inst2) + + def implProvenance2(self, inst): self.assertEqual(inst.activity.coding[0].code, "AU") self.assertEqual(inst.activity.coding[0].display, "authenticated") self.assertEqual(inst.activity.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-DocumentCompletion") @@ -57,31 +82,6 @@ def implProvenance1(self, inst): self.assertEqual(inst.text.div, "
procedure record authored on 27-June 2015 by Harold Hippocrates, MD Content extracted from Referral received 26-June
") self.assertEqual(inst.text.status, "generated") - def testProvenance2(self): - inst = self.instantiate_from("provenance-example-cwl.json") - self.assertIsNotNone(inst, "Must have instantiated a Provenance instance") - self.implProvenance2(inst) - - js = inst.as_json() - self.assertEqual("Provenance", js["resourceType"]) - inst2 = provenance.Provenance(js) - self.implProvenance2(inst2) - - def implProvenance2(self, inst): - self.assertEqual(inst.agent[0].type.coding[0].code, "AUT") - self.assertEqual(inst.agent[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") - self.assertEqual(inst.entity[0].role, "source") - self.assertEqual(inst.id, "example-cwl") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.occurredPeriod.start.date, FHIRDate("2016-11-30").date) - self.assertEqual(inst.occurredPeriod.start.as_json(), "2016-11-30") - self.assertEqual(inst.reason[0].text, "profiling Short Tandem Repeats (STRs) from high throughput sequencing data.") - self.assertEqual(inst.recorded.date, FHIRDate("2016-12-01T08:12:14+10:00").date) - self.assertEqual(inst.recorded.as_json(), "2016-12-01T08:12:14+10:00") - self.assertEqual(inst.text.status, "generated") - def testProvenance3(self): inst = self.instantiate_from("provenance-example-biocompute-object.json") self.assertIsNotNone(inst, "Must have instantiated a Provenance instance") diff --git a/fhirclient/models/quantity.py b/fhirclient/models/quantity.py index 277c7f4cb..427e1672d 100644 --- a/fhirclient/models/quantity.py +++ b/fhirclient/models/quantity.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/MoneyQuantity) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MoneyQuantity) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/questionnaire.py b/fhirclient/models/questionnaire.py index 0a6d129ca..df6a52378 100644 --- a/fhirclient/models/questionnaire.py +++ b/fhirclient/models/questionnaire.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Questionnaire) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Questionnaire) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/questionnaire_tests.py b/fhirclient/models/questionnaire_tests.py index 8c219bac5..043ee54e2 100644 --- a/fhirclient/models/questionnaire_tests.py +++ b/fhirclient/models/questionnaire_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return questionnaire.Questionnaire(js) def testQuestionnaire1(self): - inst = self.instantiate_from("questionnaire-cqf-example.json") + inst = self.instantiate_from("questionnaire-example-bluebook.json") self.assertIsNotNone(inst, "Must have instantiated a Questionnaire instance") self.implQuestionnaire1(inst) @@ -32,108 +32,167 @@ def testQuestionnaire1(self): self.implQuestionnaire1(inst2) def implQuestionnaire1(self, inst): - self.assertEqual(inst.code[0].code, "44249-1") - self.assertEqual(inst.code[0].display, "PHQ-9 quick depression assessment panel:-:Pt:^Patient:-:Report.PHQ-9") + self.assertEqual(inst.date.date, FHIRDate("2013-02-19").date) + self.assertEqual(inst.date.as_json(), "2013-02-19") + self.assertEqual(inst.id, "bb") + self.assertEqual(inst.item[0].item[0].item[0].linkId, "nameOfChild") + self.assertEqual(inst.item[0].item[0].item[0].text, "Name of child") + self.assertEqual(inst.item[0].item[0].item[0].type, "string") + self.assertEqual(inst.item[0].item[0].item[1].answerOption[0].valueCoding.code, "F") + self.assertEqual(inst.item[0].item[0].item[1].answerOption[1].valueCoding.code, "M") + self.assertEqual(inst.item[0].item[0].item[1].linkId, "sex") + self.assertEqual(inst.item[0].item[0].item[1].text, "Sex") + self.assertEqual(inst.item[0].item[0].item[1].type, "choice") + self.assertEqual(inst.item[0].item[0].linkId, "group") + self.assertEqual(inst.item[0].item[0].type, "group") + self.assertEqual(inst.item[0].item[1].item[0].linkId, "birthWeight") + self.assertEqual(inst.item[0].item[1].item[0].text, "Birth weight (kg)") + self.assertEqual(inst.item[0].item[1].item[0].type, "decimal") + self.assertEqual(inst.item[0].item[1].item[1].linkId, "birthLength") + self.assertEqual(inst.item[0].item[1].item[1].text, "Birth length (cm)") + self.assertEqual(inst.item[0].item[1].item[1].type, "decimal") + self.assertEqual(inst.item[0].item[1].item[2].answerOption[0].valueCoding.code, "INJECTION") + self.assertEqual(inst.item[0].item[1].item[2].answerOption[1].valueCoding.code, "INTRAVENOUS") + self.assertEqual(inst.item[0].item[1].item[2].answerOption[2].valueCoding.code, "ORAL") + self.assertTrue(inst.item[0].item[1].item[2].item[0].enableWhen[0].answerBoolean) + self.assertEqual(inst.item[0].item[1].item[2].item[0].enableWhen[0].operator, "exists") + self.assertEqual(inst.item[0].item[1].item[2].item[0].enableWhen[0].question, "vitaminKgiven") + self.assertEqual(inst.item[0].item[1].item[2].item[0].item[0].linkId, "vitaminiKDose1") + self.assertEqual(inst.item[0].item[1].item[2].item[0].item[0].text, "1st dose") + self.assertEqual(inst.item[0].item[1].item[2].item[0].item[0].type, "dateTime") + self.assertEqual(inst.item[0].item[1].item[2].item[0].item[1].linkId, "vitaminiKDose2") + self.assertEqual(inst.item[0].item[1].item[2].item[0].item[1].text, "2nd dose") + self.assertEqual(inst.item[0].item[1].item[2].item[0].item[1].type, "dateTime") + self.assertEqual(inst.item[0].item[1].item[2].item[0].linkId, "vitaminKgivenDoses") + self.assertEqual(inst.item[0].item[1].item[2].item[0].type, "group") + self.assertEqual(inst.item[0].item[1].item[2].linkId, "vitaminKgiven") + self.assertEqual(inst.item[0].item[1].item[2].text, "Vitamin K given") + self.assertEqual(inst.item[0].item[1].item[2].type, "choice") + self.assertEqual(inst.item[0].item[1].item[3].item[0].linkId, "hepBgivenDate") + self.assertEqual(inst.item[0].item[1].item[3].item[0].text, "Date given") + self.assertEqual(inst.item[0].item[1].item[3].item[0].type, "date") + self.assertEqual(inst.item[0].item[1].item[3].linkId, "hepBgiven") + self.assertEqual(inst.item[0].item[1].item[3].text, "Hep B given y / n") + self.assertEqual(inst.item[0].item[1].item[3].type, "boolean") + self.assertEqual(inst.item[0].item[1].item[4].linkId, "abnormalitiesAtBirth") + self.assertEqual(inst.item[0].item[1].item[4].text, "Abnormalities noted at birth") + self.assertEqual(inst.item[0].item[1].item[4].type, "string") + self.assertEqual(inst.item[0].item[1].linkId, "neonatalInformation") + self.assertEqual(inst.item[0].item[1].text, "Neonatal Information") + self.assertEqual(inst.item[0].item[1].type, "group") + self.assertEqual(inst.item[0].linkId, "birthDetails") + self.assertEqual(inst.item[0].text, "Birth details - To be completed by health professional") + self.assertEqual(inst.item[0].type, "group") + self.assertEqual(inst.jurisdiction[0].coding[0].code, "AU") + self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") + self.assertEqual(inst.publisher, "New South Wales Department of Health") + self.assertEqual(inst.status, "draft") + self.assertEqual(inst.subjectType[0], "Patient") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.title, "NSW Government My Personal Health Record") + self.assertEqual(inst.url, "http://hl7.org/fhir/Questionnaire/bb") + + def testQuestionnaire2(self): + inst = self.instantiate_from("questionnaire-example-f201-lifelines.json") + self.assertIsNotNone(inst, "Must have instantiated a Questionnaire instance") + self.implQuestionnaire2(inst) + + js = inst.as_json() + self.assertEqual("Questionnaire", js["resourceType"]) + inst2 = questionnaire.Questionnaire(js) + self.implQuestionnaire2(inst2) + + def implQuestionnaire2(self, inst): + self.assertEqual(inst.code[0].code, "VL 1-1, 18-65_1.2.2") + self.assertEqual(inst.code[0].display, "Lifelines Questionnaire 1 part 1") + self.assertEqual(inst.code[0].system, "http://example.org/system/code/lifelines/nl") + self.assertEqual(inst.date.date, FHIRDate("2010").date) + self.assertEqual(inst.date.as_json(), "2010") + self.assertEqual(inst.id, "f201") + self.assertEqual(inst.item[0].linkId, "1") + self.assertEqual(inst.item[0].text, "Do you have allergies?") + self.assertEqual(inst.item[0].type, "boolean") + self.assertEqual(inst.item[1].item[0].linkId, "2.1") + self.assertEqual(inst.item[1].item[0].text, "What is your gender?") + self.assertEqual(inst.item[1].item[0].type, "string") + self.assertEqual(inst.item[1].item[1].linkId, "2.2") + self.assertEqual(inst.item[1].item[1].text, "What is your date of birth?") + self.assertEqual(inst.item[1].item[1].type, "date") + self.assertEqual(inst.item[1].item[2].linkId, "2.3") + self.assertEqual(inst.item[1].item[2].text, "What is your country of birth?") + self.assertEqual(inst.item[1].item[2].type, "string") + self.assertEqual(inst.item[1].item[3].linkId, "2.4") + self.assertEqual(inst.item[1].item[3].text, "What is your marital status?") + self.assertEqual(inst.item[1].item[3].type, "string") + self.assertEqual(inst.item[1].linkId, "2") + self.assertEqual(inst.item[1].text, "General questions") + self.assertEqual(inst.item[1].type, "group") + self.assertEqual(inst.item[2].item[0].linkId, "3.1") + self.assertEqual(inst.item[2].item[0].text, "Do you smoke?") + self.assertEqual(inst.item[2].item[0].type, "boolean") + self.assertEqual(inst.item[2].item[1].linkId, "3.2") + self.assertEqual(inst.item[2].item[1].text, "Do you drink alchohol?") + self.assertEqual(inst.item[2].item[1].type, "boolean") + self.assertEqual(inst.item[2].linkId, "3") + self.assertEqual(inst.item[2].text, "Intoxications") + self.assertEqual(inst.item[2].type, "group") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.subjectType[0], "Patient") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.url, "http://hl7.org/fhir/Questionnaire/f201") + + def testQuestionnaire3(self): + inst = self.instantiate_from("questionnaire-example-gcs.json") + self.assertIsNotNone(inst, "Must have instantiated a Questionnaire instance") + self.implQuestionnaire3(inst) + + js = inst.as_json() + self.assertEqual("Questionnaire", js["resourceType"]) + inst2 = questionnaire.Questionnaire(js) + self.implQuestionnaire3(inst2) + + def implQuestionnaire3(self, inst): + self.assertEqual(inst.code[0].code, "9269-2") self.assertEqual(inst.code[0].system, "http://loinc.org") - self.assertEqual(inst.extension[0].url, "http://hl7.org/fhir/StructureDefinition/cqf-library") - self.assertEqual(inst.extension[0].valueCanonical, "Library/phq-9-logic") - self.assertEqual(inst.id, "phq-9-questionnaire") - self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "phq-9") - self.assertEqual(inst.item[0].answerValueSet, "http://loinc.org/vs/LL358-3") - self.assertEqual(inst.item[0].code[0].code, "44250-9") + self.assertEqual(inst.contained[0].id, "motor") + self.assertEqual(inst.contained[1].id, "verbal") + self.assertEqual(inst.contained[2].id, "eye") + self.assertEqual(inst.date.date, FHIRDate("2015-08-03").date) + self.assertEqual(inst.date.as_json(), "2015-08-03") + self.assertEqual(inst.id, "gcs") + self.assertEqual(inst.item[0].answerValueSet, "#verbal") + self.assertEqual(inst.item[0].code[0].code, "9270-0") self.assertEqual(inst.item[0].code[0].system, "http://loinc.org") - self.assertEqual(inst.item[0].linkId, "LittleInterest") - self.assertTrue(inst.item[0].required) - self.assertEqual(inst.item[0].text, "Little interest or pleasure in doing things") + self.assertEqual(inst.item[0].linkId, "1.1") self.assertEqual(inst.item[0].type, "choice") - self.assertEqual(inst.item[1].answerValueSet, "http://loinc.org/vs/LL358-3") - self.assertEqual(inst.item[1].code[0].code, "44255-8") + self.assertEqual(inst.item[1].answerValueSet, "#motor") + self.assertEqual(inst.item[1].code[0].code, "9268-4") self.assertEqual(inst.item[1].code[0].system, "http://loinc.org") - self.assertEqual(inst.item[1].linkId, "FeelingDown") - self.assertTrue(inst.item[1].required) - self.assertEqual(inst.item[1].text, "Feeling down, depressed, or hopeless") + self.assertEqual(inst.item[1].linkId, "1.2") self.assertEqual(inst.item[1].type, "choice") - self.assertEqual(inst.item[2].answerValueSet, "http://loinc.org/vs/LL358-3") - self.assertEqual(inst.item[2].code[0].code, "44259-0") + self.assertEqual(inst.item[2].answerValueSet, "#eye") + self.assertEqual(inst.item[2].code[0].code, "9267-6") self.assertEqual(inst.item[2].code[0].system, "http://loinc.org") - self.assertEqual(inst.item[2].linkId, "TroubleSleeping") - self.assertTrue(inst.item[2].required) - self.assertEqual(inst.item[2].text, "Trouble falling or staying asleep") + self.assertEqual(inst.item[2].linkId, "1.3") self.assertEqual(inst.item[2].type, "choice") - self.assertEqual(inst.item[3].answerValueSet, "http://loinc.org/vs/LL358-3") - self.assertEqual(inst.item[3].code[0].code, "44254-1") - self.assertEqual(inst.item[3].code[0].system, "http://loinc.org") - self.assertEqual(inst.item[3].linkId, "FeelingTired") - self.assertTrue(inst.item[3].required) - self.assertEqual(inst.item[3].text, "Feeling tired or having little energy") - self.assertEqual(inst.item[3].type, "choice") - self.assertEqual(inst.item[4].answerValueSet, "http://loinc.org/vs/LL358-3") - self.assertEqual(inst.item[4].code[0].code, "44251-7") - self.assertEqual(inst.item[4].code[0].system, "http://loinc.org") - self.assertEqual(inst.item[4].linkId, "BadAppetite") - self.assertTrue(inst.item[4].required) - self.assertEqual(inst.item[4].text, "Poor appetite or overeating") - self.assertEqual(inst.item[4].type, "choice") - self.assertEqual(inst.item[5].answerValueSet, "http://loinc.org/vs/LL358-3") - self.assertEqual(inst.item[5].code[0].code, "44258-2") - self.assertEqual(inst.item[5].code[0].system, "http://loinc.org") - self.assertEqual(inst.item[5].linkId, "FeelingBadAboutSelf") - self.assertTrue(inst.item[5].required) - self.assertEqual(inst.item[5].text, "Feeling bad about yourself - or that you are a failure or have let yourself or your family down") - self.assertEqual(inst.item[5].type, "choice") - self.assertEqual(inst.item[6].answerValueSet, "http://loinc.org/vs/LL358-3") - self.assertEqual(inst.item[6].code[0].code, "44252-5") - self.assertEqual(inst.item[6].code[0].system, "http://loinc.org") - self.assertEqual(inst.item[6].linkId, "TroubleConcentrating") - self.assertTrue(inst.item[6].required) - self.assertEqual(inst.item[6].text, "Trouble concentrating on things, such as reading the newspaper or watching television") - self.assertEqual(inst.item[6].type, "choice") - self.assertEqual(inst.item[7].answerValueSet, "http://loinc.org/vs/LL358-3") - self.assertEqual(inst.item[7].code[0].code, "44253-3") - self.assertEqual(inst.item[7].code[0].system, "http://loinc.org") - self.assertEqual(inst.item[7].linkId, "MovingSpeaking") - self.assertTrue(inst.item[7].required) - self.assertEqual(inst.item[7].text, "Moving or speaking so slowly that other people could have noticed. Or the opposite - being so fidgety or restless that you have been moving around a lot more than usual") - self.assertEqual(inst.item[7].type, "choice") - self.assertEqual(inst.item[8].code[0].code, "44261-6") - self.assertEqual(inst.item[8].code[0].system, "http://loinc.org") - self.assertEqual(inst.item[8].extension[0].url, "http://hl7.org/fhir/StructureDefinition/cqf-expression") - self.assertEqual(inst.item[8].extension[0].valueExpression.expression, "CalculateTotalScore") - self.assertEqual(inst.item[8].extension[0].valueExpression.language, "text/cql") - self.assertEqual(inst.item[8].linkId, "TotalScore") - self.assertTrue(inst.item[8].required) - self.assertEqual(inst.item[8].text, "Total score") - self.assertEqual(inst.item[8].type, "integer") - self.assertEqual(inst.item[9].answerValueSet, "http://loinc.org/vs/LL358-3") - self.assertEqual(inst.item[9].code[0].code, "44256-6") - self.assertEqual(inst.item[9].code[0].system, "http://loinc.org") - self.assertEqual(inst.item[9].linkId, "Difficulty") - self.assertTrue(inst.item[9].required) - self.assertEqual(inst.item[9].text, "If you checked off any problems, how difficult have these problems made it for you to do your work, take care of things at home, or get along with other people") - self.assertEqual(inst.item[9].type, "choice") - self.assertEqual(inst.meta.profile[0], "http://hl7.org/fhir/StructureDefinition/cqf-questionnaire") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.publisher, "FHIR Project team") self.assertEqual(inst.status, "draft") self.assertEqual(inst.subjectType[0], "Patient") - self.assertEqual(inst.text.div, "
PHQ-9 Questionnaire with dynamic logic
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.title, "Patient Health Questionnaire (PHQ-9)") - self.assertEqual(inst.version, "1.0.0") + self.assertEqual(inst.title, "Glasgow Coma Score") + self.assertEqual(inst.url, "http://hl7.org/fhir/Questionnaire/gcs") - def testQuestionnaire2(self): + def testQuestionnaire4(self): inst = self.instantiate_from("questionnaire-example.json") self.assertIsNotNone(inst, "Must have instantiated a Questionnaire instance") - self.implQuestionnaire2(inst) + self.implQuestionnaire4(inst) js = inst.as_json() self.assertEqual("Questionnaire", js["resourceType"]) inst2 = questionnaire.Questionnaire(js) - self.implQuestionnaire2(inst2) + self.implQuestionnaire4(inst2) - def implQuestionnaire2(self, inst): + def implQuestionnaire4(self, inst): self.assertEqual(inst.date.date, FHIRDate("2012-01").date) self.assertEqual(inst.date.as_json(), "2012-01") self.assertEqual(inst.id, "3141") @@ -203,164 +262,105 @@ def implQuestionnaire2(self, inst): self.assertEqual(inst.title, "Cancer Quality Forum Questionnaire 2012") self.assertEqual(inst.url, "http://hl7.org/fhir/Questionnaire/3141") - def testQuestionnaire3(self): - inst = self.instantiate_from("questionnaire-example-f201-lifelines.json") - self.assertIsNotNone(inst, "Must have instantiated a Questionnaire instance") - self.implQuestionnaire3(inst) - - js = inst.as_json() - self.assertEqual("Questionnaire", js["resourceType"]) - inst2 = questionnaire.Questionnaire(js) - self.implQuestionnaire3(inst2) - - def implQuestionnaire3(self, inst): - self.assertEqual(inst.code[0].code, "VL 1-1, 18-65_1.2.2") - self.assertEqual(inst.code[0].display, "Lifelines Questionnaire 1 part 1") - self.assertEqual(inst.code[0].system, "http://example.org/system/code/lifelines/nl") - self.assertEqual(inst.date.date, FHIRDate("2010").date) - self.assertEqual(inst.date.as_json(), "2010") - self.assertEqual(inst.id, "f201") - self.assertEqual(inst.item[0].linkId, "1") - self.assertEqual(inst.item[0].text, "Do you have allergies?") - self.assertEqual(inst.item[0].type, "boolean") - self.assertEqual(inst.item[1].item[0].linkId, "2.1") - self.assertEqual(inst.item[1].item[0].text, "What is your gender?") - self.assertEqual(inst.item[1].item[0].type, "string") - self.assertEqual(inst.item[1].item[1].linkId, "2.2") - self.assertEqual(inst.item[1].item[1].text, "What is your date of birth?") - self.assertEqual(inst.item[1].item[1].type, "date") - self.assertEqual(inst.item[1].item[2].linkId, "2.3") - self.assertEqual(inst.item[1].item[2].text, "What is your country of birth?") - self.assertEqual(inst.item[1].item[2].type, "string") - self.assertEqual(inst.item[1].item[3].linkId, "2.4") - self.assertEqual(inst.item[1].item[3].text, "What is your marital status?") - self.assertEqual(inst.item[1].item[3].type, "string") - self.assertEqual(inst.item[1].linkId, "2") - self.assertEqual(inst.item[1].text, "General questions") - self.assertEqual(inst.item[1].type, "group") - self.assertEqual(inst.item[2].item[0].linkId, "3.1") - self.assertEqual(inst.item[2].item[0].text, "Do you smoke?") - self.assertEqual(inst.item[2].item[0].type, "boolean") - self.assertEqual(inst.item[2].item[1].linkId, "3.2") - self.assertEqual(inst.item[2].item[1].text, "Do you drink alchohol?") - self.assertEqual(inst.item[2].item[1].type, "boolean") - self.assertEqual(inst.item[2].linkId, "3") - self.assertEqual(inst.item[2].text, "Intoxications") - self.assertEqual(inst.item[2].type, "group") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.subjectType[0], "Patient") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.url, "http://hl7.org/fhir/Questionnaire/f201") - - def testQuestionnaire4(self): - inst = self.instantiate_from("questionnaire-example-gcs.json") + def testQuestionnaire5(self): + inst = self.instantiate_from("questionnaire-cqf-example.json") self.assertIsNotNone(inst, "Must have instantiated a Questionnaire instance") - self.implQuestionnaire4(inst) + self.implQuestionnaire5(inst) js = inst.as_json() self.assertEqual("Questionnaire", js["resourceType"]) inst2 = questionnaire.Questionnaire(js) - self.implQuestionnaire4(inst2) + self.implQuestionnaire5(inst2) - def implQuestionnaire4(self, inst): - self.assertEqual(inst.code[0].code, "9269-2") + def implQuestionnaire5(self, inst): + self.assertEqual(inst.code[0].code, "44249-1") + self.assertEqual(inst.code[0].display, "PHQ-9 quick depression assessment panel:-:Pt:^Patient:-:Report.PHQ-9") self.assertEqual(inst.code[0].system, "http://loinc.org") - self.assertEqual(inst.contained[0].id, "motor") - self.assertEqual(inst.contained[1].id, "verbal") - self.assertEqual(inst.contained[2].id, "eye") - self.assertEqual(inst.date.date, FHIRDate("2015-08-03").date) - self.assertEqual(inst.date.as_json(), "2015-08-03") - self.assertEqual(inst.id, "gcs") - self.assertEqual(inst.item[0].answerValueSet, "#verbal") - self.assertEqual(inst.item[0].code[0].code, "9270-0") + self.assertEqual(inst.extension[0].url, "http://hl7.org/fhir/StructureDefinition/cqf-library") + self.assertEqual(inst.extension[0].valueCanonical, "Library/phq-9-logic") + self.assertEqual(inst.id, "phq-9-questionnaire") + self.assertEqual(inst.identifier[0].use, "official") + self.assertEqual(inst.identifier[0].value, "phq-9") + self.assertEqual(inst.item[0].answerValueSet, "http://loinc.org/vs/LL358-3") + self.assertEqual(inst.item[0].code[0].code, "44250-9") self.assertEqual(inst.item[0].code[0].system, "http://loinc.org") - self.assertEqual(inst.item[0].linkId, "1.1") + self.assertEqual(inst.item[0].linkId, "LittleInterest") + self.assertTrue(inst.item[0].required) + self.assertEqual(inst.item[0].text, "Little interest or pleasure in doing things") self.assertEqual(inst.item[0].type, "choice") - self.assertEqual(inst.item[1].answerValueSet, "#motor") - self.assertEqual(inst.item[1].code[0].code, "9268-4") + self.assertEqual(inst.item[1].answerValueSet, "http://loinc.org/vs/LL358-3") + self.assertEqual(inst.item[1].code[0].code, "44255-8") self.assertEqual(inst.item[1].code[0].system, "http://loinc.org") - self.assertEqual(inst.item[1].linkId, "1.2") + self.assertEqual(inst.item[1].linkId, "FeelingDown") + self.assertTrue(inst.item[1].required) + self.assertEqual(inst.item[1].text, "Feeling down, depressed, or hopeless") self.assertEqual(inst.item[1].type, "choice") - self.assertEqual(inst.item[2].answerValueSet, "#eye") - self.assertEqual(inst.item[2].code[0].code, "9267-6") + self.assertEqual(inst.item[2].answerValueSet, "http://loinc.org/vs/LL358-3") + self.assertEqual(inst.item[2].code[0].code, "44259-0") self.assertEqual(inst.item[2].code[0].system, "http://loinc.org") - self.assertEqual(inst.item[2].linkId, "1.3") + self.assertEqual(inst.item[2].linkId, "TroubleSleeping") + self.assertTrue(inst.item[2].required) + self.assertEqual(inst.item[2].text, "Trouble falling or staying asleep") self.assertEqual(inst.item[2].type, "choice") - self.assertEqual(inst.publisher, "FHIR Project team") - self.assertEqual(inst.status, "draft") - self.assertEqual(inst.subjectType[0], "Patient") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.title, "Glasgow Coma Score") - self.assertEqual(inst.url, "http://hl7.org/fhir/Questionnaire/gcs") - - def testQuestionnaire5(self): - inst = self.instantiate_from("questionnaire-example-bluebook.json") - self.assertIsNotNone(inst, "Must have instantiated a Questionnaire instance") - self.implQuestionnaire5(inst) - - js = inst.as_json() - self.assertEqual("Questionnaire", js["resourceType"]) - inst2 = questionnaire.Questionnaire(js) - self.implQuestionnaire5(inst2) - - def implQuestionnaire5(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2013-02-19").date) - self.assertEqual(inst.date.as_json(), "2013-02-19") - self.assertEqual(inst.id, "bb") - self.assertEqual(inst.item[0].item[0].item[0].linkId, "nameOfChild") - self.assertEqual(inst.item[0].item[0].item[0].text, "Name of child") - self.assertEqual(inst.item[0].item[0].item[0].type, "string") - self.assertEqual(inst.item[0].item[0].item[1].answerOption[0].valueCoding.code, "F") - self.assertEqual(inst.item[0].item[0].item[1].answerOption[1].valueCoding.code, "M") - self.assertEqual(inst.item[0].item[0].item[1].linkId, "sex") - self.assertEqual(inst.item[0].item[0].item[1].text, "Sex") - self.assertEqual(inst.item[0].item[0].item[1].type, "choice") - self.assertEqual(inst.item[0].item[0].linkId, "group") - self.assertEqual(inst.item[0].item[0].type, "group") - self.assertEqual(inst.item[0].item[1].item[0].linkId, "birthWeight") - self.assertEqual(inst.item[0].item[1].item[0].text, "Birth weight (kg)") - self.assertEqual(inst.item[0].item[1].item[0].type, "decimal") - self.assertEqual(inst.item[0].item[1].item[1].linkId, "birthLength") - self.assertEqual(inst.item[0].item[1].item[1].text, "Birth length (cm)") - self.assertEqual(inst.item[0].item[1].item[1].type, "decimal") - self.assertEqual(inst.item[0].item[1].item[2].answerOption[0].valueCoding.code, "INJECTION") - self.assertEqual(inst.item[0].item[1].item[2].answerOption[1].valueCoding.code, "INTRAVENOUS") - self.assertEqual(inst.item[0].item[1].item[2].answerOption[2].valueCoding.code, "ORAL") - self.assertTrue(inst.item[0].item[1].item[2].item[0].enableWhen[0].answerBoolean) - self.assertEqual(inst.item[0].item[1].item[2].item[0].enableWhen[0].operator, "exists") - self.assertEqual(inst.item[0].item[1].item[2].item[0].enableWhen[0].question, "vitaminKgiven") - self.assertEqual(inst.item[0].item[1].item[2].item[0].item[0].linkId, "vitaminiKDose1") - self.assertEqual(inst.item[0].item[1].item[2].item[0].item[0].text, "1st dose") - self.assertEqual(inst.item[0].item[1].item[2].item[0].item[0].type, "dateTime") - self.assertEqual(inst.item[0].item[1].item[2].item[0].item[1].linkId, "vitaminiKDose2") - self.assertEqual(inst.item[0].item[1].item[2].item[0].item[1].text, "2nd dose") - self.assertEqual(inst.item[0].item[1].item[2].item[0].item[1].type, "dateTime") - self.assertEqual(inst.item[0].item[1].item[2].item[0].linkId, "vitaminKgivenDoses") - self.assertEqual(inst.item[0].item[1].item[2].item[0].type, "group") - self.assertEqual(inst.item[0].item[1].item[2].linkId, "vitaminKgiven") - self.assertEqual(inst.item[0].item[1].item[2].text, "Vitamin K given") - self.assertEqual(inst.item[0].item[1].item[2].type, "choice") - self.assertEqual(inst.item[0].item[1].item[3].item[0].linkId, "hepBgivenDate") - self.assertEqual(inst.item[0].item[1].item[3].item[0].text, "Date given") - self.assertEqual(inst.item[0].item[1].item[3].item[0].type, "date") - self.assertEqual(inst.item[0].item[1].item[3].linkId, "hepBgiven") - self.assertEqual(inst.item[0].item[1].item[3].text, "Hep B given y / n") - self.assertEqual(inst.item[0].item[1].item[3].type, "boolean") - self.assertEqual(inst.item[0].item[1].item[4].linkId, "abnormalitiesAtBirth") - self.assertEqual(inst.item[0].item[1].item[4].text, "Abnormalities noted at birth") - self.assertEqual(inst.item[0].item[1].item[4].type, "string") - self.assertEqual(inst.item[0].item[1].linkId, "neonatalInformation") - self.assertEqual(inst.item[0].item[1].text, "Neonatal Information") - self.assertEqual(inst.item[0].item[1].type, "group") - self.assertEqual(inst.item[0].linkId, "birthDetails") - self.assertEqual(inst.item[0].text, "Birth details - To be completed by health professional") - self.assertEqual(inst.item[0].type, "group") - self.assertEqual(inst.jurisdiction[0].coding[0].code, "AU") - self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") - self.assertEqual(inst.publisher, "New South Wales Department of Health") + self.assertEqual(inst.item[3].answerValueSet, "http://loinc.org/vs/LL358-3") + self.assertEqual(inst.item[3].code[0].code, "44254-1") + self.assertEqual(inst.item[3].code[0].system, "http://loinc.org") + self.assertEqual(inst.item[3].linkId, "FeelingTired") + self.assertTrue(inst.item[3].required) + self.assertEqual(inst.item[3].text, "Feeling tired or having little energy") + self.assertEqual(inst.item[3].type, "choice") + self.assertEqual(inst.item[4].answerValueSet, "http://loinc.org/vs/LL358-3") + self.assertEqual(inst.item[4].code[0].code, "44251-7") + self.assertEqual(inst.item[4].code[0].system, "http://loinc.org") + self.assertEqual(inst.item[4].linkId, "BadAppetite") + self.assertTrue(inst.item[4].required) + self.assertEqual(inst.item[4].text, "Poor appetite or overeating") + self.assertEqual(inst.item[4].type, "choice") + self.assertEqual(inst.item[5].answerValueSet, "http://loinc.org/vs/LL358-3") + self.assertEqual(inst.item[5].code[0].code, "44258-2") + self.assertEqual(inst.item[5].code[0].system, "http://loinc.org") + self.assertEqual(inst.item[5].linkId, "FeelingBadAboutSelf") + self.assertTrue(inst.item[5].required) + self.assertEqual(inst.item[5].text, "Feeling bad about yourself - or that you are a failure or have let yourself or your family down") + self.assertEqual(inst.item[5].type, "choice") + self.assertEqual(inst.item[6].answerValueSet, "http://loinc.org/vs/LL358-3") + self.assertEqual(inst.item[6].code[0].code, "44252-5") + self.assertEqual(inst.item[6].code[0].system, "http://loinc.org") + self.assertEqual(inst.item[6].linkId, "TroubleConcentrating") + self.assertTrue(inst.item[6].required) + self.assertEqual(inst.item[6].text, "Trouble concentrating on things, such as reading the newspaper or watching television") + self.assertEqual(inst.item[6].type, "choice") + self.assertEqual(inst.item[7].answerValueSet, "http://loinc.org/vs/LL358-3") + self.assertEqual(inst.item[7].code[0].code, "44253-3") + self.assertEqual(inst.item[7].code[0].system, "http://loinc.org") + self.assertEqual(inst.item[7].linkId, "MovingSpeaking") + self.assertTrue(inst.item[7].required) + self.assertEqual(inst.item[7].text, "Moving or speaking so slowly that other people could have noticed. Or the opposite - being so fidgety or restless that you have been moving around a lot more than usual") + self.assertEqual(inst.item[7].type, "choice") + self.assertEqual(inst.item[8].code[0].code, "44261-6") + self.assertEqual(inst.item[8].code[0].system, "http://loinc.org") + self.assertEqual(inst.item[8].extension[0].url, "http://hl7.org/fhir/StructureDefinition/cqf-expression") + self.assertEqual(inst.item[8].extension[0].valueExpression.expression, "CalculateTotalScore") + self.assertEqual(inst.item[8].extension[0].valueExpression.language, "text/cql") + self.assertEqual(inst.item[8].linkId, "TotalScore") + self.assertTrue(inst.item[8].required) + self.assertEqual(inst.item[8].text, "Total score") + self.assertEqual(inst.item[8].type, "integer") + self.assertEqual(inst.item[9].answerValueSet, "http://loinc.org/vs/LL358-3") + self.assertEqual(inst.item[9].code[0].code, "44256-6") + self.assertEqual(inst.item[9].code[0].system, "http://loinc.org") + self.assertEqual(inst.item[9].linkId, "Difficulty") + self.assertTrue(inst.item[9].required) + self.assertEqual(inst.item[9].text, "If you checked off any problems, how difficult have these problems made it for you to do your work, take care of things at home, or get along with other people") + self.assertEqual(inst.item[9].type, "choice") + self.assertEqual(inst.meta.profile[0], "http://hl7.org/fhir/StructureDefinition/cqf-questionnaire") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.status, "draft") self.assertEqual(inst.subjectType[0], "Patient") + self.assertEqual(inst.text.div, "
PHQ-9 Questionnaire with dynamic logic
") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.title, "NSW Government My Personal Health Record") - self.assertEqual(inst.url, "http://hl7.org/fhir/Questionnaire/bb") + self.assertEqual(inst.title, "Patient Health Questionnaire (PHQ-9)") + self.assertEqual(inst.version, "1.0.0") diff --git a/fhirclient/models/questionnaireresponse.py b/fhirclient/models/questionnaireresponse.py index dad6d42cf..a716270f8 100644 --- a/fhirclient/models/questionnaireresponse.py +++ b/fhirclient/models/questionnaireresponse.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/questionnaireresponse_tests.py b/fhirclient/models/questionnaireresponse_tests.py index 6e63238de..1c9d9d717 100644 --- a/fhirclient/models/questionnaireresponse_tests.py +++ b/fhirclient/models/questionnaireresponse_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -62,7 +62,7 @@ def implQuestionnaireResponse1(self, inst): self.assertEqual(inst.text.status, "generated") def testQuestionnaireResponse2(self): - inst = self.instantiate_from("questionnaireresponse-example-ussg-fht-answers.json") + inst = self.instantiate_from("questionnaireresponse-example-f201-lifelines.json") self.assertIsNotNone(inst, "Must have instantiated a QuestionnaireResponse instance") self.implQuestionnaireResponse2(inst) @@ -72,6 +72,53 @@ def testQuestionnaireResponse2(self): self.implQuestionnaireResponse2(inst2) def implQuestionnaireResponse2(self, inst): + self.assertEqual(inst.authored.date, FHIRDate("2013-06-18T00:00:00+01:00").date) + self.assertEqual(inst.authored.as_json(), "2013-06-18T00:00:00+01:00") + self.assertEqual(inst.id, "f201") + self.assertEqual(inst.item[0].item[0].answer[0].valueString, "I am allergic to house dust") + self.assertEqual(inst.item[0].item[0].linkId, "1.1") + self.assertEqual(inst.item[0].item[0].text, "Do you have allergies?") + self.assertEqual(inst.item[0].linkId, "1") + self.assertEqual(inst.item[1].item[0].answer[0].valueString, "Male") + self.assertEqual(inst.item[1].item[0].linkId, "2.1") + self.assertEqual(inst.item[1].item[0].text, "What is your gender?") + self.assertEqual(inst.item[1].item[1].answer[0].valueDate.date, FHIRDate("1960-03-13").date) + self.assertEqual(inst.item[1].item[1].answer[0].valueDate.as_json(), "1960-03-13") + self.assertEqual(inst.item[1].item[1].linkId, "2.2") + self.assertEqual(inst.item[1].item[1].text, "What is your date of birth?") + self.assertEqual(inst.item[1].item[2].answer[0].valueString, "The Netherlands") + self.assertEqual(inst.item[1].item[2].linkId, "2.3") + self.assertEqual(inst.item[1].item[2].text, "What is your country of birth?") + self.assertEqual(inst.item[1].item[3].answer[0].valueString, "married") + self.assertEqual(inst.item[1].item[3].linkId, "2.4") + self.assertEqual(inst.item[1].item[3].text, "What is your marital status?") + self.assertEqual(inst.item[1].linkId, "2") + self.assertEqual(inst.item[1].text, "General questions") + self.assertEqual(inst.item[2].item[0].answer[0].valueString, "No") + self.assertEqual(inst.item[2].item[0].linkId, "3.1") + self.assertEqual(inst.item[2].item[0].text, "Do you smoke?") + self.assertEqual(inst.item[2].item[1].answer[0].valueString, "No, but I used to drink") + self.assertEqual(inst.item[2].item[1].linkId, "3.2") + self.assertEqual(inst.item[2].item[1].text, "Do you drink alchohol?") + self.assertEqual(inst.item[2].linkId, "3") + self.assertEqual(inst.item[2].text, "Intoxications") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.status, "completed") + self.assertEqual(inst.text.status, "generated") + + def testQuestionnaireResponse3(self): + inst = self.instantiate_from("questionnaireresponse-example-ussg-fht-answers.json") + self.assertIsNotNone(inst, "Must have instantiated a QuestionnaireResponse instance") + self.implQuestionnaireResponse3(inst) + + js = inst.as_json() + self.assertEqual("QuestionnaireResponse", js["resourceType"]) + inst2 = questionnaireresponse.QuestionnaireResponse(js) + self.implQuestionnaireResponse3(inst2) + + def implQuestionnaireResponse3(self, inst): self.assertEqual(inst.authored.date, FHIRDate("2008-01-17").date) self.assertEqual(inst.authored.as_json(), "2008-01-17") self.assertEqual(inst.id, "ussg-fht-answers") @@ -628,64 +675,56 @@ def implQuestionnaireResponse2(self, inst): self.assertEqual(inst.status, "in-progress") self.assertEqual(inst.text.status, "generated") - def testQuestionnaireResponse3(self): - inst = self.instantiate_from("questionnaireresponse-example-f201-lifelines.json") + def testQuestionnaireResponse4(self): + inst = self.instantiate_from("questionnaireresponse-example-gcs.json") self.assertIsNotNone(inst, "Must have instantiated a QuestionnaireResponse instance") - self.implQuestionnaireResponse3(inst) + self.implQuestionnaireResponse4(inst) js = inst.as_json() self.assertEqual("QuestionnaireResponse", js["resourceType"]) inst2 = questionnaireresponse.QuestionnaireResponse(js) - self.implQuestionnaireResponse3(inst2) + self.implQuestionnaireResponse4(inst2) - def implQuestionnaireResponse3(self, inst): - self.assertEqual(inst.authored.date, FHIRDate("2013-06-18T00:00:00+01:00").date) - self.assertEqual(inst.authored.as_json(), "2013-06-18T00:00:00+01:00") - self.assertEqual(inst.id, "f201") - self.assertEqual(inst.item[0].item[0].answer[0].valueString, "I am allergic to house dust") - self.assertEqual(inst.item[0].item[0].linkId, "1.1") - self.assertEqual(inst.item[0].item[0].text, "Do you have allergies?") - self.assertEqual(inst.item[0].linkId, "1") - self.assertEqual(inst.item[1].item[0].answer[0].valueString, "Male") - self.assertEqual(inst.item[1].item[0].linkId, "2.1") - self.assertEqual(inst.item[1].item[0].text, "What is your gender?") - self.assertEqual(inst.item[1].item[1].answer[0].valueDate.date, FHIRDate("1960-03-13").date) - self.assertEqual(inst.item[1].item[1].answer[0].valueDate.as_json(), "1960-03-13") - self.assertEqual(inst.item[1].item[1].linkId, "2.2") - self.assertEqual(inst.item[1].item[1].text, "What is your date of birth?") - self.assertEqual(inst.item[1].item[2].answer[0].valueString, "The Netherlands") - self.assertEqual(inst.item[1].item[2].linkId, "2.3") - self.assertEqual(inst.item[1].item[2].text, "What is your country of birth?") - self.assertEqual(inst.item[1].item[3].answer[0].valueString, "married") - self.assertEqual(inst.item[1].item[3].linkId, "2.4") - self.assertEqual(inst.item[1].item[3].text, "What is your marital status?") - self.assertEqual(inst.item[1].linkId, "2") - self.assertEqual(inst.item[1].text, "General questions") - self.assertEqual(inst.item[2].item[0].answer[0].valueString, "No") - self.assertEqual(inst.item[2].item[0].linkId, "3.1") - self.assertEqual(inst.item[2].item[0].text, "Do you smoke?") - self.assertEqual(inst.item[2].item[1].answer[0].valueString, "No, but I used to drink") - self.assertEqual(inst.item[2].item[1].linkId, "3.2") - self.assertEqual(inst.item[2].item[1].text, "Do you drink alchohol?") - self.assertEqual(inst.item[2].linkId, "3") - self.assertEqual(inst.item[2].text, "Intoxications") + def implQuestionnaireResponse4(self, inst): + self.assertEqual(inst.authored.date, FHIRDate("2014-12-11T04:44:16Z").date) + self.assertEqual(inst.authored.as_json(), "2014-12-11T04:44:16Z") + self.assertEqual(inst.id, "gcs") + self.assertEqual(inst.item[0].answer[0].valueCoding.code, "LA6560-2") + self.assertEqual(inst.item[0].answer[0].valueCoding.display, "Confused") + self.assertEqual(inst.item[0].answer[0].valueCoding.extension[0].url, "http://hl7.org/fhir/StructureDefinition/ordinalValue") + self.assertEqual(inst.item[0].answer[0].valueCoding.extension[0].valueDecimal, 4) + self.assertEqual(inst.item[0].answer[0].valueCoding.system, "http://loinc.org") + self.assertEqual(inst.item[0].linkId, "1.1") + self.assertEqual(inst.item[1].answer[0].valueCoding.code, "LA6566-9") + self.assertEqual(inst.item[1].answer[0].valueCoding.display, "Localizing pain") + self.assertEqual(inst.item[1].answer[0].valueCoding.extension[0].url, "http://hl7.org/fhir/StructureDefinition/ordinalValue") + self.assertEqual(inst.item[1].answer[0].valueCoding.extension[0].valueDecimal, 5) + self.assertEqual(inst.item[1].answer[0].valueCoding.system, "http://loinc.org") + self.assertEqual(inst.item[1].linkId, "1.2") + self.assertEqual(inst.item[2].answer[0].valueCoding.code, "LA6556-0") + self.assertEqual(inst.item[2].answer[0].valueCoding.display, "Eyes open spontaneously") + self.assertEqual(inst.item[2].answer[0].valueCoding.extension[0].url, "http://hl7.org/fhir/StructureDefinition/ordinalValue") + self.assertEqual(inst.item[2].answer[0].valueCoding.extension[0].valueDecimal, 4) + self.assertEqual(inst.item[2].answer[0].valueCoding.system, "http://loinc.org") + self.assertEqual(inst.item[2].linkId, "1.3") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.questionnaire, "Questionnaire/gcs") self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.status, "generated") - def testQuestionnaireResponse4(self): + def testQuestionnaireResponse5(self): inst = self.instantiate_from("questionnaireresponse-example-bluebook.json") self.assertIsNotNone(inst, "Must have instantiated a QuestionnaireResponse instance") - self.implQuestionnaireResponse4(inst) + self.implQuestionnaireResponse5(inst) js = inst.as_json() self.assertEqual("QuestionnaireResponse", js["resourceType"]) inst2 = questionnaireresponse.QuestionnaireResponse(js) - self.implQuestionnaireResponse4(inst2) + self.implQuestionnaireResponse5(inst2) - def implQuestionnaireResponse4(self, inst): + def implQuestionnaireResponse5(self, inst): self.assertEqual(inst.authored.date, FHIRDate("2013-02-19T14:15:00+10:00").date) self.assertEqual(inst.authored.as_json(), "2013-02-19T14:15:00+10:00") self.assertEqual(inst.id, "bb") @@ -733,43 +772,4 @@ def implQuestionnaireResponse4(self, inst): self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.status, "generated") - - def testQuestionnaireResponse5(self): - inst = self.instantiate_from("questionnaireresponse-example-gcs.json") - self.assertIsNotNone(inst, "Must have instantiated a QuestionnaireResponse instance") - self.implQuestionnaireResponse5(inst) - - js = inst.as_json() - self.assertEqual("QuestionnaireResponse", js["resourceType"]) - inst2 = questionnaireresponse.QuestionnaireResponse(js) - self.implQuestionnaireResponse5(inst2) - - def implQuestionnaireResponse5(self, inst): - self.assertEqual(inst.authored.date, FHIRDate("2014-12-11T04:44:16Z").date) - self.assertEqual(inst.authored.as_json(), "2014-12-11T04:44:16Z") - self.assertEqual(inst.id, "gcs") - self.assertEqual(inst.item[0].answer[0].valueCoding.code, "LA6560-2") - self.assertEqual(inst.item[0].answer[0].valueCoding.display, "Confused") - self.assertEqual(inst.item[0].answer[0].valueCoding.extension[0].url, "http://hl7.org/fhir/StructureDefinition/ordinalValue") - self.assertEqual(inst.item[0].answer[0].valueCoding.extension[0].valueDecimal, 4) - self.assertEqual(inst.item[0].answer[0].valueCoding.system, "http://loinc.org") - self.assertEqual(inst.item[0].linkId, "1.1") - self.assertEqual(inst.item[1].answer[0].valueCoding.code, "LA6566-9") - self.assertEqual(inst.item[1].answer[0].valueCoding.display, "Localizing pain") - self.assertEqual(inst.item[1].answer[0].valueCoding.extension[0].url, "http://hl7.org/fhir/StructureDefinition/ordinalValue") - self.assertEqual(inst.item[1].answer[0].valueCoding.extension[0].valueDecimal, 5) - self.assertEqual(inst.item[1].answer[0].valueCoding.system, "http://loinc.org") - self.assertEqual(inst.item[1].linkId, "1.2") - self.assertEqual(inst.item[2].answer[0].valueCoding.code, "LA6556-0") - self.assertEqual(inst.item[2].answer[0].valueCoding.display, "Eyes open spontaneously") - self.assertEqual(inst.item[2].answer[0].valueCoding.extension[0].url, "http://hl7.org/fhir/StructureDefinition/ordinalValue") - self.assertEqual(inst.item[2].answer[0].valueCoding.extension[0].valueDecimal, 4) - self.assertEqual(inst.item[2].answer[0].valueCoding.system, "http://loinc.org") - self.assertEqual(inst.item[2].linkId, "1.3") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.questionnaire, "Questionnaire/gcs") - self.assertEqual(inst.status, "completed") - self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/range.py b/fhirclient/models/range.py index 0118d0749..50d9e90d9 100644 --- a/fhirclient/models/range.py +++ b/fhirclient/models/range.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Range) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Range) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/ratio.py b/fhirclient/models/ratio.py index 277570a87..98f06799f 100644 --- a/fhirclient/models/ratio.py +++ b/fhirclient/models/ratio.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Ratio) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Ratio) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/reference.py b/fhirclient/models/reference.py index c9a93374e..1650d7960 100644 --- a/fhirclient/models/reference.py +++ b/fhirclient/models/reference.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Reference) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Reference) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/relatedartifact.py b/fhirclient/models/relatedartifact.py index 5c0fb219c..6035f7869 100644 --- a/fhirclient/models/relatedartifact.py +++ b/fhirclient/models/relatedartifact.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/RelatedArtifact) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/RelatedArtifact) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/relatedperson.py b/fhirclient/models/relatedperson.py index cb37a0b02..88ba04a6b 100644 --- a/fhirclient/models/relatedperson.py +++ b/fhirclient/models/relatedperson.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/RelatedPerson) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/RelatedPerson) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/relatedperson_tests.py b/fhirclient/models/relatedperson_tests.py index 55546bba6..f17dd2898 100644 --- a/fhirclient/models/relatedperson_tests.py +++ b/fhirclient/models/relatedperson_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return relatedperson.RelatedPerson(js) def testRelatedPerson1(self): - inst = self.instantiate_from("relatedperson-example-peter.json") + inst = self.instantiate_from("relatedperson-example.json") self.assertIsNotNone(inst, "Must have instantiated a RelatedPerson instance") self.implRelatedPerson1(inst) @@ -32,29 +32,30 @@ def testRelatedPerson1(self): self.implRelatedPerson1(inst2) def implRelatedPerson1(self, inst): - self.assertEqual(inst.address[0].city, "PleasantVille") - self.assertEqual(inst.address[0].line[0], "534 Erewhon St") - self.assertEqual(inst.address[0].postalCode, "3999") - self.assertEqual(inst.address[0].state, "Vic") - self.assertEqual(inst.address[0].use, "home") - self.assertEqual(inst.gender, "male") - self.assertEqual(inst.id, "peter") + self.assertTrue(inst.active) + self.assertEqual(inst.address[0].city, "Paris") + self.assertEqual(inst.address[0].country, "FRA") + self.assertEqual(inst.address[0].line[0], "43, Place du Marché Sainte Catherine") + self.assertEqual(inst.address[0].postalCode, "75004") + self.assertEqual(inst.gender, "female") + self.assertEqual(inst.id, "benedicte") + self.assertEqual(inst.identifier[0].system, "urn:oid:1.2.250.1.61") + self.assertEqual(inst.identifier[0].type.text, "INSEE") + self.assertEqual(inst.identifier[0].use, "usual") + self.assertEqual(inst.identifier[0].value, "272117510400399") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].family, "Chalmers") - self.assertEqual(inst.name[0].given[0], "Peter") - self.assertEqual(inst.name[0].given[1], "James") - self.assertEqual(inst.name[0].use, "official") - self.assertEqual(inst.period.start.date, FHIRDate("2012-03-11").date) - self.assertEqual(inst.period.start.as_json(), "2012-03-11") + self.assertEqual(inst.name[0].family, "du Marché") + self.assertEqual(inst.name[0].given[0], "Bénédicte") self.assertEqual(inst.photo[0].contentType, "image/jpeg") - self.assertEqual(inst.photo[0].url, "Binary/f012") - self.assertEqual(inst.relationship[0].coding[0].code, "C") + self.assertEqual(inst.photo[0].url, "Binary/f016") + self.assertEqual(inst.relationship[0].coding[0].code, "N") self.assertEqual(inst.relationship[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0131") + self.assertEqual(inst.relationship[0].coding[1].code, "WIFE") + self.assertEqual(inst.relationship[0].coding[1].system, "http://terminology.hl7.org/CodeSystem/v3-RoleCode") self.assertEqual(inst.telecom[0].system, "phone") - self.assertEqual(inst.telecom[0].use, "work") - self.assertEqual(inst.telecom[0].value, "(03) 5555 6473") + self.assertEqual(inst.telecom[0].value, "+33 (237) 998327") self.assertEqual(inst.text.status, "generated") def testRelatedPerson2(self): @@ -127,7 +128,7 @@ def implRelatedPerson3(self, inst): self.assertEqual(inst.text.status, "generated") def testRelatedPerson4(self): - inst = self.instantiate_from("relatedperson-example.json") + inst = self.instantiate_from("relatedperson-example-f002-ariadne.json") self.assertIsNotNone(inst, "Must have instantiated a RelatedPerson instance") self.implRelatedPerson4(inst) @@ -137,34 +138,27 @@ def testRelatedPerson4(self): self.implRelatedPerson4(inst2) def implRelatedPerson4(self, inst): - self.assertTrue(inst.active) - self.assertEqual(inst.address[0].city, "Paris") - self.assertEqual(inst.address[0].country, "FRA") - self.assertEqual(inst.address[0].line[0], "43, Place du Marché Sainte Catherine") - self.assertEqual(inst.address[0].postalCode, "75004") + self.assertEqual(inst.birthDate.date, FHIRDate("1963").date) + self.assertEqual(inst.birthDate.as_json(), "1963") self.assertEqual(inst.gender, "female") - self.assertEqual(inst.id, "benedicte") - self.assertEqual(inst.identifier[0].system, "urn:oid:1.2.250.1.61") - self.assertEqual(inst.identifier[0].type.text, "INSEE") - self.assertEqual(inst.identifier[0].use, "usual") - self.assertEqual(inst.identifier[0].value, "272117510400399") + self.assertEqual(inst.id, "f002") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].family, "du Marché") - self.assertEqual(inst.name[0].given[0], "Bénédicte") + self.assertEqual(inst.name[0].text, "Ariadne Bor-Jansma") + self.assertEqual(inst.name[0].use, "usual") + self.assertEqual(inst.period.start.date, FHIRDate("1975").date) + self.assertEqual(inst.period.start.as_json(), "1975") self.assertEqual(inst.photo[0].contentType, "image/jpeg") - self.assertEqual(inst.photo[0].url, "Binary/f016") - self.assertEqual(inst.relationship[0].coding[0].code, "N") - self.assertEqual(inst.relationship[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0131") - self.assertEqual(inst.relationship[0].coding[1].code, "WIFE") - self.assertEqual(inst.relationship[0].coding[1].system, "http://terminology.hl7.org/CodeSystem/v3-RoleCode") + self.assertEqual(inst.relationship[0].coding[0].code, "SIGOTHR") + self.assertEqual(inst.relationship[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-RoleCode") self.assertEqual(inst.telecom[0].system, "phone") - self.assertEqual(inst.telecom[0].value, "+33 (237) 998327") + self.assertEqual(inst.telecom[0].use, "home") + self.assertEqual(inst.telecom[0].value, "+31201234567") self.assertEqual(inst.text.status, "generated") def testRelatedPerson5(self): - inst = self.instantiate_from("relatedperson-example-f002-ariadne.json") + inst = self.instantiate_from("relatedperson-example-peter.json") self.assertIsNotNone(inst, "Must have instantiated a RelatedPerson instance") self.implRelatedPerson5(inst) @@ -174,22 +168,28 @@ def testRelatedPerson5(self): self.implRelatedPerson5(inst2) def implRelatedPerson5(self, inst): - self.assertEqual(inst.birthDate.date, FHIRDate("1963").date) - self.assertEqual(inst.birthDate.as_json(), "1963") - self.assertEqual(inst.gender, "female") - self.assertEqual(inst.id, "f002") + self.assertEqual(inst.address[0].city, "PleasantVille") + self.assertEqual(inst.address[0].line[0], "534 Erewhon St") + self.assertEqual(inst.address[0].postalCode, "3999") + self.assertEqual(inst.address[0].state, "Vic") + self.assertEqual(inst.address[0].use, "home") + self.assertEqual(inst.gender, "male") + self.assertEqual(inst.id, "peter") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.name[0].text, "Ariadne Bor-Jansma") - self.assertEqual(inst.name[0].use, "usual") - self.assertEqual(inst.period.start.date, FHIRDate("1975").date) - self.assertEqual(inst.period.start.as_json(), "1975") + self.assertEqual(inst.name[0].family, "Chalmers") + self.assertEqual(inst.name[0].given[0], "Peter") + self.assertEqual(inst.name[0].given[1], "James") + self.assertEqual(inst.name[0].use, "official") + self.assertEqual(inst.period.start.date, FHIRDate("2012-03-11").date) + self.assertEqual(inst.period.start.as_json(), "2012-03-11") self.assertEqual(inst.photo[0].contentType, "image/jpeg") - self.assertEqual(inst.relationship[0].coding[0].code, "SIGOTHR") - self.assertEqual(inst.relationship[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-RoleCode") + self.assertEqual(inst.photo[0].url, "Binary/f012") + self.assertEqual(inst.relationship[0].coding[0].code, "C") + self.assertEqual(inst.relationship[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0131") self.assertEqual(inst.telecom[0].system, "phone") - self.assertEqual(inst.telecom[0].use, "home") - self.assertEqual(inst.telecom[0].value, "+31201234567") + self.assertEqual(inst.telecom[0].use, "work") + self.assertEqual(inst.telecom[0].value, "(03) 5555 6473") self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/requestgroup.py b/fhirclient/models/requestgroup.py index 1ebe7039c..9effec3a5 100644 --- a/fhirclient/models/requestgroup.py +++ b/fhirclient/models/requestgroup.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/RequestGroup) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/RequestGroup) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -65,7 +65,8 @@ def __init__(self, jsondict=None, strict=True): List of `str` items. """ self.intent = None - """ proposal | plan | order. + """ proposal | plan | directive | order | original-order | reflex-order + | filler-order | instance-order | option. Type `str`. """ self.note = None @@ -89,8 +90,8 @@ def __init__(self, jsondict=None, strict=True): List of `FHIRReference` items (represented as `dict` in JSON). """ self.status = None - """ draft | active | suspended | cancelled | completed | entered-in- - error | unknown. + """ draft | active | on-hold | revoked | completed | entered-in-error | + unknown. Type `str`. """ self.subject = None diff --git a/fhirclient/models/requestgroup_tests.py b/fhirclient/models/requestgroup_tests.py index 32585934b..511b4d04f 100644 --- a/fhirclient/models/requestgroup_tests.py +++ b/fhirclient/models/requestgroup_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/researchdefinition.py b/fhirclient/models/researchdefinition.py index 111123f7c..a6cf74fb1 100644 --- a/fhirclient/models/researchdefinition.py +++ b/fhirclient/models/researchdefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ResearchDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ResearchDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/researchdefinition_tests.py b/fhirclient/models/researchdefinition_tests.py index 3d8f6ebcd..cb7d8799d 100644 --- a/fhirclient/models/researchdefinition_tests.py +++ b/fhirclient/models/researchdefinition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/researchelementdefinition.py b/fhirclient/models/researchelementdefinition.py index 17b39e471..29ce9a9a6 100644 --- a/fhirclient/models/researchelementdefinition.py +++ b/fhirclient/models/researchelementdefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ResearchElementDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ResearchElementDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/researchelementdefinition_tests.py b/fhirclient/models/researchelementdefinition_tests.py index 1646921fb..24d881d2a 100644 --- a/fhirclient/models/researchelementdefinition_tests.py +++ b/fhirclient/models/researchelementdefinition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/researchstudy.py b/fhirclient/models/researchstudy.py index 92aba893b..27dcdd1c4 100644 --- a/fhirclient/models/researchstudy.py +++ b/fhirclient/models/researchstudy.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ResearchStudy) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ResearchStudy) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/researchstudy_tests.py b/fhirclient/models/researchstudy_tests.py index df674f516..f6d347672 100644 --- a/fhirclient/models/researchstudy_tests.py +++ b/fhirclient/models/researchstudy_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/researchsubject.py b/fhirclient/models/researchsubject.py index ffa51d163..84fb231e2 100644 --- a/fhirclient/models/researchsubject.py +++ b/fhirclient/models/researchsubject.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ResearchSubject) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ResearchSubject) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/researchsubject_tests.py b/fhirclient/models/researchsubject_tests.py index 6477f4926..cf2a4b2c8 100644 --- a/fhirclient/models/researchsubject_tests.py +++ b/fhirclient/models/researchsubject_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/resource.py b/fhirclient/models/resource.py index 04652dc85..8288ec9e6 100644 --- a/fhirclient/models/resource.py +++ b/fhirclient/models/resource.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Resource) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Resource) on 2024-07-15. +# 2024, SMART Health IT. from . import fhirabstractresource diff --git a/fhirclient/models/riskassessment.py b/fhirclient/models/riskassessment.py index 3c7283f1d..a334579c6 100644 --- a/fhirclient/models/riskassessment.py +++ b/fhirclient/models/riskassessment.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/RiskAssessment) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/RiskAssessment) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/riskassessment_tests.py b/fhirclient/models/riskassessment_tests.py index 28c50b6e4..178dcb446 100644 --- a/fhirclient/models/riskassessment_tests.py +++ b/fhirclient/models/riskassessment_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return riskassessment.RiskAssessment(js) def testRiskAssessment1(self): - inst = self.instantiate_from("riskassessment-example-population.json") + inst = self.instantiate_from("riskassessment-example-breastcancer.json") self.assertIsNotNone(inst, "Must have instantiated a RiskAssessment instance") self.implRiskAssessment1(inst) @@ -32,58 +32,32 @@ def testRiskAssessment1(self): self.implRiskAssessment1(inst2) def implRiskAssessment1(self, inst): - self.assertEqual(inst.contained[0].id, "group1") - self.assertEqual(inst.id, "population") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.status, "final") - self.assertEqual(inst.text.status, "generated") - - def testRiskAssessment2(self): - inst = self.instantiate_from("riskassessment-example-cardiac.json") - self.assertIsNotNone(inst, "Must have instantiated a RiskAssessment instance") - self.implRiskAssessment2(inst) - - js = inst.as_json() - self.assertEqual("RiskAssessment", js["resourceType"]) - inst2 = riskassessment.RiskAssessment(js) - self.implRiskAssessment2(inst2) - - def implRiskAssessment2(self, inst): - self.assertEqual(inst.id, "cardiac") + self.assertEqual(inst.code.coding[0].code, "709510001") + self.assertEqual(inst.code.coding[0].display, "Assessment of risk for disease (procedure)") + self.assertEqual(inst.code.coding[0].system, "http://browser.ihtsdotools.org/") + self.assertEqual(inst.id, "breastcancer-risk") self.assertEqual(inst.identifier[0].system, "http://example.org") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "risk-assessment-cardiac") + self.assertEqual(inst.identifier[0].value, "risk-assessment-breastcancer1") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2014-07-19T16:04:00Z").date) - self.assertEqual(inst.occurrenceDateTime.as_json(), "2014-07-19T16:04:00Z") - self.assertEqual(inst.prediction[0].outcome.text, "Heart Attack") - self.assertEqual(inst.prediction[0].probabilityDecimal, 0.02) - self.assertEqual(inst.prediction[0].whenRange.high.code, "a") - self.assertEqual(inst.prediction[0].whenRange.high.system, "http://unitsofmeasure.org") - self.assertEqual(inst.prediction[0].whenRange.high.unit, "years") - self.assertEqual(inst.prediction[0].whenRange.high.value, 49) - self.assertEqual(inst.prediction[0].whenRange.low.code, "a") - self.assertEqual(inst.prediction[0].whenRange.low.system, "http://unitsofmeasure.org") - self.assertEqual(inst.prediction[0].whenRange.low.unit, "years") - self.assertEqual(inst.prediction[0].whenRange.low.value, 39) + self.assertEqual(inst.note[0].text, "This risk assessment is based on BRCA1 and BRCA2 genetic mutation test") + self.assertEqual(inst.prediction[0].outcome.text, "Unknown risk of developing breast cancer") self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "additional") - def testRiskAssessment3(self): + def testRiskAssessment2(self): inst = self.instantiate_from("riskassessment-example.json") self.assertIsNotNone(inst, "Must have instantiated a RiskAssessment instance") - self.implRiskAssessment3(inst) + self.implRiskAssessment2(inst) js = inst.as_json() self.assertEqual("RiskAssessment", js["resourceType"]) inst2 = riskassessment.RiskAssessment(js) - self.implRiskAssessment3(inst2) + self.implRiskAssessment2(inst2) - def implRiskAssessment3(self, inst): + def implRiskAssessment2(self, inst): self.assertEqual(inst.id, "genetic") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") @@ -171,8 +145,27 @@ def implRiskAssessment3(self, inst): self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "generated") + def testRiskAssessment3(self): + inst = self.instantiate_from("riskassessment-example-population.json") + self.assertIsNotNone(inst, "Must have instantiated a RiskAssessment instance") + self.implRiskAssessment3(inst) + + js = inst.as_json() + self.assertEqual("RiskAssessment", js["resourceType"]) + inst2 = riskassessment.RiskAssessment(js) + self.implRiskAssessment3(inst2) + + def implRiskAssessment3(self, inst): + self.assertEqual(inst.contained[0].id, "group1") + self.assertEqual(inst.id, "population") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.status, "final") + self.assertEqual(inst.text.status, "generated") + def testRiskAssessment4(self): - inst = self.instantiate_from("riskassessment-example-breastcancer.json") + inst = self.instantiate_from("riskassessment-example-cardiac.json") self.assertIsNotNone(inst, "Must have instantiated a RiskAssessment instance") self.implRiskAssessment4(inst) @@ -182,18 +175,25 @@ def testRiskAssessment4(self): self.implRiskAssessment4(inst2) def implRiskAssessment4(self, inst): - self.assertEqual(inst.code.coding[0].code, "709510001") - self.assertEqual(inst.code.coding[0].display, "Assessment of risk for disease (procedure)") - self.assertEqual(inst.code.coding[0].system, "http://browser.ihtsdotools.org/") - self.assertEqual(inst.id, "breastcancer-risk") + self.assertEqual(inst.id, "cardiac") self.assertEqual(inst.identifier[0].system, "http://example.org") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "risk-assessment-breastcancer1") + self.assertEqual(inst.identifier[0].value, "risk-assessment-cardiac") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.note[0].text, "This risk assessment is based on BRCA1 and BRCA2 genetic mutation test") - self.assertEqual(inst.prediction[0].outcome.text, "Unknown risk of developing breast cancer") + self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2014-07-19T16:04:00Z").date) + self.assertEqual(inst.occurrenceDateTime.as_json(), "2014-07-19T16:04:00Z") + self.assertEqual(inst.prediction[0].outcome.text, "Heart Attack") + self.assertEqual(inst.prediction[0].probabilityDecimal, 0.02) + self.assertEqual(inst.prediction[0].whenRange.high.code, "a") + self.assertEqual(inst.prediction[0].whenRange.high.system, "http://unitsofmeasure.org") + self.assertEqual(inst.prediction[0].whenRange.high.unit, "years") + self.assertEqual(inst.prediction[0].whenRange.high.value, 49) + self.assertEqual(inst.prediction[0].whenRange.low.code, "a") + self.assertEqual(inst.prediction[0].whenRange.low.system, "http://unitsofmeasure.org") + self.assertEqual(inst.prediction[0].whenRange.low.unit, "years") + self.assertEqual(inst.prediction[0].whenRange.low.value, 39) self.assertEqual(inst.status, "final") self.assertEqual(inst.text.status, "additional") diff --git a/fhirclient/models/riskevidencesynthesis.py b/fhirclient/models/riskevidencesynthesis.py index 3a0e31558..1cbf42d65 100644 --- a/fhirclient/models/riskevidencesynthesis.py +++ b/fhirclient/models/riskevidencesynthesis.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/RiskEvidenceSynthesis) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/RiskEvidenceSynthesis) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/riskevidencesynthesis_tests.py b/fhirclient/models/riskevidencesynthesis_tests.py index 611ed7243..d52d1a9d4 100644 --- a/fhirclient/models/riskevidencesynthesis_tests.py +++ b/fhirclient/models/riskevidencesynthesis_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/sampleddata.py b/fhirclient/models/sampleddata.py index d716ee69e..02b431f3f 100644 --- a/fhirclient/models/sampleddata.py +++ b/fhirclient/models/sampleddata.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/SampledData) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SampledData) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/schedule.py b/fhirclient/models/schedule.py index 9085ff750..e3cbd1221 100644 --- a/fhirclient/models/schedule.py +++ b/fhirclient/models/schedule.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Schedule) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Schedule) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/schedule_tests.py b/fhirclient/models/schedule_tests.py index 258487fc2..cd3141ccc 100644 --- a/fhirclient/models/schedule_tests.py +++ b/fhirclient/models/schedule_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return schedule.Schedule(js) def testSchedule1(self): - inst = self.instantiate_from("schedule-provider-location1-example.json") + inst = self.instantiate_from("schedule-provider-location2-example.json") self.assertIsNotNone(inst, "Must have instantiated a Schedule instance") self.implSchedule1(inst) @@ -33,11 +33,11 @@ def testSchedule1(self): def implSchedule1(self, inst): self.assertTrue(inst.active) - self.assertEqual(inst.comment, "The slots attached to this schedule are for genetic counselling in the USS Enterprise-D Sickbay.") - self.assertEqual(inst.id, "exampleloc1") + self.assertEqual(inst.comment, "The slots attached to this schedule are for neurosurgery operations at Starfleet HQ only.") + self.assertEqual(inst.id, "exampleloc2") self.assertEqual(inst.identifier[0].system, "http://example.org/scheduleid") self.assertEqual(inst.identifier[0].use, "usual") - self.assertEqual(inst.identifier[0].value, "46") + self.assertEqual(inst.identifier[0].value, "47") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") @@ -45,12 +45,12 @@ def implSchedule1(self, inst): self.assertEqual(inst.planningHorizon.end.as_json(), "2017-12-25T09:30:00Z") self.assertEqual(inst.planningHorizon.start.date, FHIRDate("2017-12-25T09:15:00Z").date) self.assertEqual(inst.planningHorizon.start.as_json(), "2017-12-25T09:15:00Z") - self.assertEqual(inst.serviceCategory[0].coding[0].code, "17") - self.assertEqual(inst.serviceCategory[0].coding[0].display, "General Practice") - self.assertEqual(inst.serviceType[0].coding[0].code, "75") - self.assertEqual(inst.serviceType[0].coding[0].display, "Genetic Counselling") - self.assertEqual(inst.specialty[0].coding[0].code, "394580004") - self.assertEqual(inst.specialty[0].coding[0].display, "Clinical genetics") + self.assertEqual(inst.serviceCategory[0].coding[0].code, "31") + self.assertEqual(inst.serviceCategory[0].coding[0].display, "Specialist Surgical") + self.assertEqual(inst.serviceType[0].coding[0].code, "221") + self.assertEqual(inst.serviceType[0].coding[0].display, "Surgery - General") + self.assertEqual(inst.specialty[0].coding[0].code, "394610002") + self.assertEqual(inst.specialty[0].coding[0].display, "Surgery-Neurosurgery") self.assertEqual(inst.text.status, "generated") def testSchedule2(self): @@ -86,7 +86,7 @@ def implSchedule2(self, inst): self.assertEqual(inst.text.status, "generated") def testSchedule3(self): - inst = self.instantiate_from("schedule-provider-location2-example.json") + inst = self.instantiate_from("schedule-provider-location1-example.json") self.assertIsNotNone(inst, "Must have instantiated a Schedule instance") self.implSchedule3(inst) @@ -97,11 +97,11 @@ def testSchedule3(self): def implSchedule3(self, inst): self.assertTrue(inst.active) - self.assertEqual(inst.comment, "The slots attached to this schedule are for neurosurgery operations at Starfleet HQ only.") - self.assertEqual(inst.id, "exampleloc2") + self.assertEqual(inst.comment, "The slots attached to this schedule are for genetic counselling in the USS Enterprise-D Sickbay.") + self.assertEqual(inst.id, "exampleloc1") self.assertEqual(inst.identifier[0].system, "http://example.org/scheduleid") self.assertEqual(inst.identifier[0].use, "usual") - self.assertEqual(inst.identifier[0].value, "47") + self.assertEqual(inst.identifier[0].value, "46") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") @@ -109,11 +109,11 @@ def implSchedule3(self, inst): self.assertEqual(inst.planningHorizon.end.as_json(), "2017-12-25T09:30:00Z") self.assertEqual(inst.planningHorizon.start.date, FHIRDate("2017-12-25T09:15:00Z").date) self.assertEqual(inst.planningHorizon.start.as_json(), "2017-12-25T09:15:00Z") - self.assertEqual(inst.serviceCategory[0].coding[0].code, "31") - self.assertEqual(inst.serviceCategory[0].coding[0].display, "Specialist Surgical") - self.assertEqual(inst.serviceType[0].coding[0].code, "221") - self.assertEqual(inst.serviceType[0].coding[0].display, "Surgery - General") - self.assertEqual(inst.specialty[0].coding[0].code, "394610002") - self.assertEqual(inst.specialty[0].coding[0].display, "Surgery-Neurosurgery") + self.assertEqual(inst.serviceCategory[0].coding[0].code, "17") + self.assertEqual(inst.serviceCategory[0].coding[0].display, "General Practice") + self.assertEqual(inst.serviceType[0].coding[0].code, "75") + self.assertEqual(inst.serviceType[0].coding[0].display, "Genetic Counselling") + self.assertEqual(inst.specialty[0].coding[0].code, "394580004") + self.assertEqual(inst.specialty[0].coding[0].display, "Clinical genetics") self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/searchparameter.py b/fhirclient/models/searchparameter.py index b638eb571..d882ad52b 100644 --- a/fhirclient/models/searchparameter.py +++ b/fhirclient/models/searchparameter.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/SearchParameter) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SearchParameter) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/searchparameter_tests.py b/fhirclient/models/searchparameter_tests.py index 3129889ce..afae7628a 100644 --- a/fhirclient/models/searchparameter_tests.py +++ b/fhirclient/models/searchparameter_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return searchparameter.SearchParameter(js) def testSearchParameter1(self): - inst = self.instantiate_from("searchparameter-example-extension.json") + inst = self.instantiate_from("searchparameter-example-reference.json") self.assertIsNotNone(inst, "Must have instantiated a SearchParameter instance") self.implSearchParameter1(inst) @@ -32,26 +32,32 @@ def testSearchParameter1(self): self.implSearchParameter1(inst2) def implSearchParameter1(self, inst): - self.assertEqual(inst.base[0], "Patient") - self.assertEqual(inst.code, "part-agree") + self.assertEqual(inst.base[0], "Condition") + self.assertEqual(inst.chain[0], "name") + self.assertEqual(inst.chain[1], "identifier") + self.assertEqual(inst.code, "subject") + self.assertEqual(inst.contact[0].name, "[string]") self.assertEqual(inst.contact[0].telecom[0].system, "url") self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org/fhir") - self.assertEqual(inst.description, "Search by url for a participation agreement, which is stored in a DocumentReference") + self.assertEqual(inst.date.date, FHIRDate("2013-10-23").date) + self.assertEqual(inst.date.as_json(), "2013-10-23") + self.assertEqual(inst.description, "Search by condition subject") self.assertTrue(inst.experimental) - self.assertEqual(inst.expression, "DocumentReference.extension('http://example.org/fhir/StructureDefinition/participation-agreement')") - self.assertEqual(inst.id, "example-extension") - self.assertEqual(inst.name, "Example Search Parameter on an extension") + self.assertEqual(inst.expression, "Condition.subject") + self.assertEqual(inst.id, "example-reference") + self.assertEqual(inst.modifier[0], "missing") + self.assertEqual(inst.name, "Example Search Parameter") self.assertEqual(inst.publisher, "Health Level Seven International (FHIR Infrastructure)") + self.assertEqual(inst.purpose, "Need to search Condition by subject") self.assertEqual(inst.status, "draft") - self.assertEqual(inst.target[0], "DocumentReference") + self.assertEqual(inst.target[0], "Organization") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type, "reference") - self.assertEqual(inst.url, "http://hl7.org/fhir/SearchParameter/example-extension") - self.assertEqual(inst.xpath, "f:DocumentReference/f:extension[@url='http://example.org/fhir/StructureDefinition/participation-agreement']") + self.assertEqual(inst.url, "http://hl7.org/fhir/SearchParameter/example-reference") self.assertEqual(inst.xpathUsage, "normal") def testSearchParameter2(self): - inst = self.instantiate_from("searchparameter-example-reference.json") + inst = self.instantiate_from("searchparameter-example-extension.json") self.assertIsNotNone(inst, "Must have instantiated a SearchParameter instance") self.implSearchParameter2(inst) @@ -61,28 +67,22 @@ def testSearchParameter2(self): self.implSearchParameter2(inst2) def implSearchParameter2(self, inst): - self.assertEqual(inst.base[0], "Condition") - self.assertEqual(inst.chain[0], "name") - self.assertEqual(inst.chain[1], "identifier") - self.assertEqual(inst.code, "subject") - self.assertEqual(inst.contact[0].name, "[string]") + self.assertEqual(inst.base[0], "Patient") + self.assertEqual(inst.code, "part-agree") self.assertEqual(inst.contact[0].telecom[0].system, "url") self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org/fhir") - self.assertEqual(inst.date.date, FHIRDate("2013-10-23").date) - self.assertEqual(inst.date.as_json(), "2013-10-23") - self.assertEqual(inst.description, "Search by condition subject") + self.assertEqual(inst.description, "Search by url for a participation agreement, which is stored in a DocumentReference") self.assertTrue(inst.experimental) - self.assertEqual(inst.expression, "Condition.subject") - self.assertEqual(inst.id, "example-reference") - self.assertEqual(inst.modifier[0], "missing") - self.assertEqual(inst.name, "Example Search Parameter") + self.assertEqual(inst.expression, "DocumentReference.extension('http://example.org/fhir/StructureDefinition/participation-agreement')") + self.assertEqual(inst.id, "example-extension") + self.assertEqual(inst.name, "Example Search Parameter on an extension") self.assertEqual(inst.publisher, "Health Level Seven International (FHIR Infrastructure)") - self.assertEqual(inst.purpose, "Need to search Condition by subject") self.assertEqual(inst.status, "draft") - self.assertEqual(inst.target[0], "Organization") + self.assertEqual(inst.target[0], "DocumentReference") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type, "reference") - self.assertEqual(inst.url, "http://hl7.org/fhir/SearchParameter/example-reference") + self.assertEqual(inst.url, "http://hl7.org/fhir/SearchParameter/example-extension") + self.assertEqual(inst.xpath, "f:DocumentReference/f:extension[@url='http://example.org/fhir/StructureDefinition/participation-agreement']") self.assertEqual(inst.xpathUsage, "normal") def testSearchParameter3(self): diff --git a/fhirclient/models/servicerequest.py b/fhirclient/models/servicerequest.py index 3d5cda6fa..03f539d2c 100644 --- a/fhirclient/models/servicerequest.py +++ b/fhirclient/models/servicerequest.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ServiceRequest) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ServiceRequest) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -77,7 +77,8 @@ def __init__(self, jsondict=None, strict=True): List of `FHIRReference` items (represented as `dict` in JSON). """ self.intent = None - """ proposal | plan | order +. + """ proposal | plan | directive | order | original-order | reflex-order + | filler-order | instance-order | option. Type `str`. """ self.locationCode = None @@ -165,8 +166,8 @@ def __init__(self, jsondict=None, strict=True): List of `FHIRReference` items (represented as `dict` in JSON). """ self.status = None - """ draft | active | suspended | completed | entered-in-error | - cancelled. + """ draft | active | on-hold | revoked | completed | entered-in-error | + unknown. Type `str`. """ self.subject = None diff --git a/fhirclient/models/servicerequest_tests.py b/fhirclient/models/servicerequest_tests.py index 0dbb2b06d..7cbf3294b 100644 --- a/fhirclient/models/servicerequest_tests.py +++ b/fhirclient/models/servicerequest_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return servicerequest.ServiceRequest(js) def testServiceRequest1(self): - inst = self.instantiate_from("servicerequest-example2.json") + inst = self.instantiate_from("servicerequest-example-di.json") self.assertIsNotNone(inst, "Must have instantiated a ServiceRequest instance") self.implServiceRequest1(inst) @@ -32,37 +32,22 @@ def testServiceRequest1(self): self.implServiceRequest1(inst2) def implServiceRequest1(self, inst): - self.assertEqual(inst.asNeededCodeableConcept.text, "as needed to clear mucus") - self.assertEqual(inst.authoredOn.date, FHIRDate("2017-02-01T17:23:07Z").date) - self.assertEqual(inst.authoredOn.as_json(), "2017-02-01T17:23:07Z") - self.assertEqual(inst.code.coding[0].code, "34431008") - self.assertEqual(inst.code.coding[0].display, "Physiotherapy of chest (regime/therapy) ") - self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.contained[0].id, "signature") - self.assertEqual(inst.contained[1].id, "cystic-fibrosis") - self.assertEqual(inst.id, "physiotherapy") - self.assertEqual(inst.identifier[0].system, "http://goodhealth.org/placer-ids") - self.assertEqual(inst.identifier[0].type.coding[0].code, "PLAC") - self.assertEqual(inst.identifier[0].type.coding[0].display, "Placer Identifier") - self.assertEqual(inst.identifier[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0203") - self.assertEqual(inst.identifier[0].type.text, "Placer") - self.assertEqual(inst.identifier[0].value, "20170201-0001") - self.assertEqual(inst.intent, "order") + self.assertEqual(inst.code.coding[0].code, "24627-2") + self.assertEqual(inst.code.coding[0].system, "http://loinc.org") + self.assertEqual(inst.code.text, "Chest CT") + self.assertEqual(inst.id, "di") + self.assertEqual(inst.intent, "original-order") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.occurrenceTiming.repeat.duration, 15) - self.assertEqual(inst.occurrenceTiming.repeat.durationMax, 25) - self.assertEqual(inst.occurrenceTiming.repeat.durationUnit, "min") - self.assertEqual(inst.occurrenceTiming.repeat.frequency, 1) - self.assertEqual(inst.occurrenceTiming.repeat.frequencyMax, 4) - self.assertEqual(inst.occurrenceTiming.repeat.period, 1) - self.assertEqual(inst.occurrenceTiming.repeat.periodUnit, "d") - self.assertEqual(inst.status, "completed") + self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2013-05-08T09:33:27+07:00").date) + self.assertEqual(inst.occurrenceDateTime.as_json(), "2013-05-08T09:33:27+07:00") + self.assertEqual(inst.reasonCode[0].text, "Check for metastatic disease") + self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") def testServiceRequest2(self): - inst = self.instantiate_from("servicerequest-example3.json") + inst = self.instantiate_from("servicerequest-example.json") self.assertIsNotNone(inst, "Must have instantiated a ServiceRequest instance") self.implServiceRequest2(inst) @@ -72,25 +57,24 @@ def testServiceRequest2(self): self.implServiceRequest2(inst2) def implServiceRequest2(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2017-02-01T17:23:07Z").date) - self.assertEqual(inst.authoredOn.as_json(), "2017-02-01T17:23:07Z") - self.assertEqual(inst.code.coding[0].code, "359962006") - self.assertEqual(inst.code.coding[0].display, "Turning patient in bed (procedure)") + self.assertEqual(inst.category[0].coding[0].code, "103693007") + self.assertEqual(inst.category[0].coding[0].display, "Diagnostic procedure (procedure)") + self.assertEqual(inst.category[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.category[0].text, "Diagnostics Procedure") + self.assertEqual(inst.code.coding[0].code, "303653007") + self.assertEqual(inst.code.coding[0].display, "Computed tomography of head") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertTrue(inst.doNotPerform) - self.assertEqual(inst.id, "do-not-turn") - self.assertEqual(inst.identifier[0].system, "http://goodhealth.org/placer-ids") - self.assertEqual(inst.identifier[0].value, "20170201-0002") + self.assertEqual(inst.id, "example") self.assertEqual(inst.intent, "order") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.priority, "stat") - self.assertEqual(inst.status, "active") + self.assertEqual(inst.status, "completed") + self.assertEqual(inst.text.div, "
To be added
") self.assertEqual(inst.text.status, "generated") def testServiceRequest3(self): - inst = self.instantiate_from("servicerequest-example-lipid.json") + inst = self.instantiate_from("servicerequest-example-myringotomy.json") self.assertIsNotNone(inst, "Must have instantiated a ServiceRequest instance") self.implServiceRequest3(inst) @@ -100,27 +84,34 @@ def testServiceRequest3(self): self.implServiceRequest3(inst2) def implServiceRequest3(self, inst): - self.assertEqual(inst.code.coding[0].code, "LIPID") - self.assertEqual(inst.code.coding[0].system, "http://acme.org/tests") - self.assertEqual(inst.code.text, "Lipid Panel") - self.assertEqual(inst.contained[0].id, "fasting") - self.assertEqual(inst.contained[1].id, "serum") - self.assertEqual(inst.id, "lipid") - self.assertEqual(inst.identifier[0].system, "urn:oid:1.3.4.5.6.7") - self.assertEqual(inst.identifier[0].type.coding[0].code, "PLAC") - self.assertEqual(inst.identifier[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0203") - self.assertEqual(inst.identifier[0].type.text, "Placer") - self.assertEqual(inst.identifier[0].value, "2345234234234") - self.assertEqual(inst.intent, "original-order") + self.assertEqual(inst.authoredOn.date, FHIRDate("2014-02-14").date) + self.assertEqual(inst.authoredOn.as_json(), "2014-02-14") + self.assertEqual(inst.category[0].coding[0].code, "103696004") + self.assertEqual(inst.category[0].coding[0].display, "Patient referral to specialist") + self.assertEqual(inst.category[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.code.coding[0].code, "172676009") + self.assertEqual(inst.code.coding[0].display, "Myringotomy and insertion of tympanic ventilation tube") + self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.code.text, "Insertion of grommets") + self.assertEqual(inst.id, "myringotomy") + self.assertEqual(inst.identifier[0].system, "http://orionhealth.com/fhir/apps/referralids") + self.assertEqual(inst.identifier[0].value, "ret4421") + self.assertEqual(inst.intent, "order") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.note[0].text, "patient is afraid of needles") - self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2013-05-02T16:16:00-07:00").date) - self.assertEqual(inst.occurrenceDateTime.as_json(), "2013-05-02T16:16:00-07:00") - self.assertEqual(inst.reasonCode[0].coding[0].code, "V173") - self.assertEqual(inst.reasonCode[0].coding[0].display, "Fam hx-ischem heart dis") - self.assertEqual(inst.reasonCode[0].coding[0].system, "http://hl7.org/fhir/sid/icd-9") + self.assertEqual(inst.note[0].authorString, "Serena Shrink") + self.assertEqual(inst.note[0].text, "In the past 2 years Beverly has had 6 instances of rt-sided Otitis media. She is falling behind her peers at school, and displaying some learning difficulties.") + self.assertEqual(inst.note[0].time.date, FHIRDate("2014-02-14").date) + self.assertEqual(inst.note[0].time.as_json(), "2014-02-14") + self.assertEqual(inst.occurrencePeriod.end.date, FHIRDate("2014-03-14").date) + self.assertEqual(inst.occurrencePeriod.end.as_json(), "2014-03-14") + self.assertEqual(inst.performerType.coding[0].code, "ent") + self.assertEqual(inst.performerType.coding[0].display, "ENT") + self.assertEqual(inst.performerType.coding[0].system, "http://orionhealth.com/fhir/apps/specialties") + self.assertEqual(inst.priority, "routine") + self.assertEqual(inst.reasonCode[0].text, "For consideration of Grommets") + self.assertEqual(inst.requisition.value, "1234") self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") @@ -153,7 +144,7 @@ def implServiceRequest4(self, inst): self.assertEqual(inst.text.status, "generated") def testServiceRequest5(self): - inst = self.instantiate_from("servicerequest-example4.json") + inst = self.instantiate_from("servicerequest-example-ft4.json") self.assertIsNotNone(inst, "Must have instantiated a ServiceRequest instance") self.implServiceRequest5(inst) @@ -163,25 +154,21 @@ def testServiceRequest5(self): self.implServiceRequest5(inst2) def implServiceRequest5(self, inst): - self.assertEqual(inst.code.coding[0].code, "229115003") - self.assertEqual(inst.code.coding[0].display, "Bench Press (regime/therapy) ") - self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.id, "benchpress") - self.assertEqual(inst.intent, "plan") + self.assertEqual(inst.code.coding[0].code, "3024-7") + self.assertEqual(inst.code.coding[0].system, "http://loinc.org") + self.assertEqual(inst.code.text, "Free T4") + self.assertEqual(inst.id, "ft4") + self.assertEqual(inst.intent, "reflex-order") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.occurrenceTiming.repeat.count, 20) - self.assertEqual(inst.occurrenceTiming.repeat.countMax, 30) - self.assertEqual(inst.occurrenceTiming.repeat.frequency, 3) - self.assertEqual(inst.occurrenceTiming.repeat.period, 1) - self.assertEqual(inst.occurrenceTiming.repeat.periodUnit, "wk") - self.assertEqual(inst.patientInstruction, "Start with 30kg 10-15 repetitions for three sets and increase in increments of 5kg when you feel ready") + self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2015-08-27T09:33:27+07:00").date) + self.assertEqual(inst.occurrenceDateTime.as_json(), "2015-08-27T09:33:27+07:00") self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "generated") def testServiceRequest6(self): - inst = self.instantiate_from("servicerequest-example-edu.json") + inst = self.instantiate_from("servicerequest-example2.json") self.assertIsNotNone(inst, "Must have instantiated a ServiceRequest instance") self.implServiceRequest6(inst) @@ -191,29 +178,37 @@ def testServiceRequest6(self): self.implServiceRequest6(inst2) def implServiceRequest6(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2016-08-16").date) - self.assertEqual(inst.authoredOn.as_json(), "2016-08-16") - self.assertEqual(inst.category[0].coding[0].code, "311401005") - self.assertEqual(inst.category[0].coding[0].display, "Patient education (procedure)") - self.assertEqual(inst.category[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.category[0].text, "Education") - self.assertEqual(inst.code.coding[0].code, "48023004") - self.assertEqual(inst.code.coding[0].display, "Breast self-examination technique education (procedure)") + self.assertEqual(inst.asNeededCodeableConcept.text, "as needed to clear mucus") + self.assertEqual(inst.authoredOn.date, FHIRDate("2017-02-01T17:23:07Z").date) + self.assertEqual(inst.authoredOn.as_json(), "2017-02-01T17:23:07Z") + self.assertEqual(inst.code.coding[0].code, "34431008") + self.assertEqual(inst.code.coding[0].display, "Physiotherapy of chest (regime/therapy) ") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.code.text, "Health education - breast examination") - self.assertEqual(inst.id, "education") + self.assertEqual(inst.contained[0].id, "signature") + self.assertEqual(inst.contained[1].id, "cystic-fibrosis") + self.assertEqual(inst.id, "physiotherapy") + self.assertEqual(inst.identifier[0].system, "http://goodhealth.org/placer-ids") + self.assertEqual(inst.identifier[0].type.coding[0].code, "PLAC") + self.assertEqual(inst.identifier[0].type.coding[0].display, "Placer Identifier") + self.assertEqual(inst.identifier[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0203") + self.assertEqual(inst.identifier[0].type.text, "Placer") + self.assertEqual(inst.identifier[0].value, "20170201-0001") self.assertEqual(inst.intent, "order") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2014-08-16").date) - self.assertEqual(inst.occurrenceDateTime.as_json(), "2014-08-16") - self.assertEqual(inst.reasonCode[0].text, "early detection of breast mass") + self.assertEqual(inst.occurrenceTiming.repeat.duration, 15) + self.assertEqual(inst.occurrenceTiming.repeat.durationMax, 25) + self.assertEqual(inst.occurrenceTiming.repeat.durationUnit, "min") + self.assertEqual(inst.occurrenceTiming.repeat.frequency, 1) + self.assertEqual(inst.occurrenceTiming.repeat.frequencyMax, 4) + self.assertEqual(inst.occurrenceTiming.repeat.period, 1) + self.assertEqual(inst.occurrenceTiming.repeat.periodUnit, "d") self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.status, "generated") def testServiceRequest7(self): - inst = self.instantiate_from("servicerequest-example-ventilation.json") + inst = self.instantiate_from("servicerequest-example-colonoscopy.json") self.assertIsNotNone(inst, "Must have instantiated a ServiceRequest instance") self.implServiceRequest7(inst) @@ -223,23 +218,20 @@ def testServiceRequest7(self): self.implServiceRequest7(inst2) def implServiceRequest7(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2018-02-20").date) - self.assertEqual(inst.authoredOn.as_json(), "2018-02-20") - self.assertEqual(inst.code.coding[0].code, "40617009") - self.assertEqual(inst.code.coding[0].display, "Artificial respiration (procedure)") + self.assertEqual(inst.authoredOn.date, FHIRDate("2017-03-05").date) + self.assertEqual(inst.authoredOn.as_json(), "2017-03-05") + self.assertEqual(inst.code.coding[0].code, "73761001") + self.assertEqual(inst.code.coding[0].display, "Colonoscopy (procedure)") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.code.text, "Mechanical Ventilation") - self.assertEqual(inst.id, "vent") + self.assertEqual(inst.code.text, "Colonoscopy") + self.assertEqual(inst.id, "colonoscopy") + self.assertEqual(inst.identifier[0].value, "45678") self.assertEqual(inst.intent, "order") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.orderDetail[0].coding[0].code, "243144002") - self.assertEqual(inst.orderDetail[0].coding[0].display, "Patient triggered inspiratory assistance (procedure)") - self.assertEqual(inst.orderDetail[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.orderDetail[0].text, "IPPB") - self.assertEqual(inst.orderDetail[1].text, " Initial Settings : Sens: -1 cm H20 Pressure 15 cm H2O moderate flow: Monitor VS every 15 minutes x 4 at the start of mechanical ventilation, then routine for unit OR every 5 hr") - self.assertEqual(inst.reasonCode[0].text, "chronic obstructive lung disease (COLD)") + self.assertEqual(inst.requisition.system, "http://bumc.org/requisitions") + self.assertEqual(inst.requisition.value, "req12345") self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.status, "generated") @@ -270,7 +262,7 @@ def implServiceRequest8(self, inst): self.assertEqual(inst.text.status, "generated") def testServiceRequest9(self): - inst = self.instantiate_from("servicerequest-example-pt.json") + inst = self.instantiate_from("servicerequest-example-appendectomy.json") self.assertIsNotNone(inst, "Must have instantiated a ServiceRequest instance") self.implServiceRequest9(inst) @@ -280,33 +272,17 @@ def testServiceRequest9(self): self.implServiceRequest9(inst2) def implServiceRequest9(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2016-09-20").date) - self.assertEqual(inst.authoredOn.as_json(), "2016-09-20") - self.assertEqual(inst.bodySite[0].coding[0].code, "36701003") - self.assertEqual(inst.bodySite[0].coding[0].display, "Both knees (body structure)") - self.assertEqual(inst.bodySite[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.bodySite[0].text, "Both knees") - self.assertEqual(inst.category[0].coding[0].code, "386053000") - self.assertEqual(inst.category[0].coding[0].display, "Evaluation procedure (procedure)") - self.assertEqual(inst.category[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.category[0].text, "Evaluation") - self.assertEqual(inst.code.coding[0].code, "710830005") - self.assertEqual(inst.code.coding[0].display, "Assessment of passive range of motion (procedure)") - self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.code.text, "Assessment of passive range of motion") - self.assertEqual(inst.id, "physical-therapy") + self.assertEqual(inst.code.text, "Appendectomy") + self.assertEqual(inst.id, "appendectomy-narrative") self.assertEqual(inst.intent, "order") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2016-09-27").date) - self.assertEqual(inst.occurrenceDateTime.as_json(), "2016-09-27") - self.assertEqual(inst.reasonCode[0].text, "assessment of mobility limitations due to osteoarthritis") self.assertEqual(inst.status, "completed") - self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.text.status, "additional") def testServiceRequest10(self): - inst = self.instantiate_from("servicerequest-example-di.json") + inst = self.instantiate_from("servicerequest-example-edu.json") self.assertIsNotNone(inst, "Must have instantiated a ServiceRequest instance") self.implServiceRequest10(inst) @@ -316,17 +292,24 @@ def testServiceRequest10(self): self.implServiceRequest10(inst2) def implServiceRequest10(self, inst): - self.assertEqual(inst.code.coding[0].code, "24627-2") - self.assertEqual(inst.code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.code.text, "Chest CT") - self.assertEqual(inst.id, "di") - self.assertEqual(inst.intent, "original-order") + self.assertEqual(inst.authoredOn.date, FHIRDate("2016-08-16").date) + self.assertEqual(inst.authoredOn.as_json(), "2016-08-16") + self.assertEqual(inst.category[0].coding[0].code, "311401005") + self.assertEqual(inst.category[0].coding[0].display, "Patient education (procedure)") + self.assertEqual(inst.category[0].coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.category[0].text, "Education") + self.assertEqual(inst.code.coding[0].code, "48023004") + self.assertEqual(inst.code.coding[0].display, "Breast self-examination technique education (procedure)") + self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.code.text, "Health education - breast examination") + self.assertEqual(inst.id, "education") + self.assertEqual(inst.intent, "order") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2013-05-08T09:33:27+07:00").date) - self.assertEqual(inst.occurrenceDateTime.as_json(), "2013-05-08T09:33:27+07:00") - self.assertEqual(inst.reasonCode[0].text, "Check for metastatic disease") - self.assertEqual(inst.status, "active") + self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.occurrenceDateTime.as_json(), "2014-08-16") + self.assertEqual(inst.reasonCode[0].text, "early detection of breast mass") + self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/signature.py b/fhirclient/models/signature.py index 873a37e8a..d651794ad 100644 --- a/fhirclient/models/signature.py +++ b/fhirclient/models/signature.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Signature) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Signature) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/slot.py b/fhirclient/models/slot.py index c052d631d..c17e79ffd 100644 --- a/fhirclient/models/slot.py +++ b/fhirclient/models/slot.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Slot) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Slot) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/slot_tests.py b/fhirclient/models/slot_tests.py index 63ec61e60..9652f55da 100644 --- a/fhirclient/models/slot_tests.py +++ b/fhirclient/models/slot_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return slot.Slot(js) def testSlot1(self): - inst = self.instantiate_from("slot-example-busy.json") + inst = self.instantiate_from("slot-example.json") self.assertIsNotNone(inst, "Must have instantiated a Slot instance") self.implSlot1(inst) @@ -32,25 +32,29 @@ def testSlot1(self): self.implSlot1(inst2) def implSlot1(self, inst): + self.assertEqual(inst.appointmentType.coding[0].code, "WALKIN") + self.assertEqual(inst.appointmentType.coding[0].display, "A previously unscheduled walk-in visit") + self.assertEqual(inst.appointmentType.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0276") self.assertEqual(inst.comment, "Assessments should be performed before requesting appointments in this slot.") - self.assertEqual(inst.end.date, FHIRDate("2013-12-25T09:15:00Z").date) - self.assertEqual(inst.end.as_json(), "2013-12-25T09:15:00Z") - self.assertEqual(inst.id, "1") - self.assertEqual(inst.identifier[0].system, "http://example.org/identifiers/slots") - self.assertEqual(inst.identifier[0].value, "123132") + self.assertEqual(inst.end.date, FHIRDate("2013-12-25T09:30:00Z").date) + self.assertEqual(inst.end.as_json(), "2013-12-25T09:30:00Z") + self.assertEqual(inst.id, "example") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertTrue(inst.overbooked) self.assertEqual(inst.serviceCategory[0].coding[0].code, "17") self.assertEqual(inst.serviceCategory[0].coding[0].display, "General Practice") - self.assertEqual(inst.start.date, FHIRDate("2013-12-25T09:00:00Z").date) - self.assertEqual(inst.start.as_json(), "2013-12-25T09:00:00Z") - self.assertEqual(inst.status, "busy") + self.assertEqual(inst.serviceType[0].coding[0].code, "57") + self.assertEqual(inst.serviceType[0].coding[0].display, "Immunization") + self.assertEqual(inst.specialty[0].coding[0].code, "408480009") + self.assertEqual(inst.specialty[0].coding[0].display, "Clinical immunology") + self.assertEqual(inst.start.date, FHIRDate("2013-12-25T09:15:00Z").date) + self.assertEqual(inst.start.as_json(), "2013-12-25T09:15:00Z") + self.assertEqual(inst.status, "free") self.assertEqual(inst.text.status, "generated") def testSlot2(self): - inst = self.instantiate_from("slot-example.json") + inst = self.instantiate_from("slot-example-busy.json") self.assertIsNotNone(inst, "Must have instantiated a Slot instance") self.implSlot2(inst) @@ -60,25 +64,21 @@ def testSlot2(self): self.implSlot2(inst2) def implSlot2(self, inst): - self.assertEqual(inst.appointmentType.coding[0].code, "WALKIN") - self.assertEqual(inst.appointmentType.coding[0].display, "A previously unscheduled walk-in visit") - self.assertEqual(inst.appointmentType.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0276") self.assertEqual(inst.comment, "Assessments should be performed before requesting appointments in this slot.") - self.assertEqual(inst.end.date, FHIRDate("2013-12-25T09:30:00Z").date) - self.assertEqual(inst.end.as_json(), "2013-12-25T09:30:00Z") - self.assertEqual(inst.id, "example") + self.assertEqual(inst.end.date, FHIRDate("2013-12-25T09:15:00Z").date) + self.assertEqual(inst.end.as_json(), "2013-12-25T09:15:00Z") + self.assertEqual(inst.id, "1") + self.assertEqual(inst.identifier[0].system, "http://example.org/identifiers/slots") + self.assertEqual(inst.identifier[0].value, "123132") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertTrue(inst.overbooked) self.assertEqual(inst.serviceCategory[0].coding[0].code, "17") self.assertEqual(inst.serviceCategory[0].coding[0].display, "General Practice") - self.assertEqual(inst.serviceType[0].coding[0].code, "57") - self.assertEqual(inst.serviceType[0].coding[0].display, "Immunization") - self.assertEqual(inst.specialty[0].coding[0].code, "408480009") - self.assertEqual(inst.specialty[0].coding[0].display, "Clinical immunology") - self.assertEqual(inst.start.date, FHIRDate("2013-12-25T09:15:00Z").date) - self.assertEqual(inst.start.as_json(), "2013-12-25T09:15:00Z") - self.assertEqual(inst.status, "free") + self.assertEqual(inst.start.date, FHIRDate("2013-12-25T09:00:00Z").date) + self.assertEqual(inst.start.as_json(), "2013-12-25T09:00:00Z") + self.assertEqual(inst.status, "busy") self.assertEqual(inst.text.status, "generated") def testSlot3(self): diff --git a/fhirclient/models/specimen.py b/fhirclient/models/specimen.py index e1dd9b5ba..7c2e6aa19 100644 --- a/fhirclient/models/specimen.py +++ b/fhirclient/models/specimen.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Specimen) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Specimen) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/specimen_tests.py b/fhirclient/models/specimen_tests.py index 21afe0aa2..1f172bc25 100644 --- a/fhirclient/models/specimen_tests.py +++ b/fhirclient/models/specimen_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return specimen.Specimen(js) def testSpecimen1(self): - inst = self.instantiate_from("specimen-example-isolate.json") + inst = self.instantiate_from("specimen-example.json") self.assertIsNotNone(inst, "Must have instantiated a Specimen instance") self.implSpecimen1(inst) @@ -33,27 +33,42 @@ def testSpecimen1(self): def implSpecimen1(self, inst): self.assertEqual(inst.accessionIdentifier.system, "http://lab.acme.org/specimens/2011") - self.assertEqual(inst.accessionIdentifier.value, "X352356-ISO1") - self.assertEqual(inst.collection.collectedDateTime.date, FHIRDate("2015-08-16T07:03:00Z").date) - self.assertEqual(inst.collection.collectedDateTime.as_json(), "2015-08-16T07:03:00Z") - self.assertEqual(inst.collection.method.coding[0].code, "BAP") + self.assertEqual(inst.accessionIdentifier.value, "X352356") + self.assertEqual(inst.collection.bodySite.coding[0].code, "49852007") + self.assertEqual(inst.collection.bodySite.coding[0].display, "Structure of median cubital vein (body structure)") + self.assertEqual(inst.collection.bodySite.coding[0].system, "http://snomed.info/sct") + self.assertEqual(inst.collection.bodySite.text, "Right median cubital vein") + self.assertEqual(inst.collection.collectedDateTime.date, FHIRDate("2011-05-30T06:15:00Z").date) + self.assertEqual(inst.collection.collectedDateTime.as_json(), "2011-05-30T06:15:00Z") + self.assertEqual(inst.collection.method.coding[0].code, "LNV") self.assertEqual(inst.collection.method.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0488") - self.assertEqual(inst.contained[0].id, "stool") - self.assertEqual(inst.id, "isolate") + self.assertEqual(inst.collection.quantity.unit, "mL") + self.assertEqual(inst.collection.quantity.value, 6) + self.assertEqual(inst.contained[0].id, "hep") + self.assertEqual(inst.container[0].capacity.unit, "mL") + self.assertEqual(inst.container[0].capacity.value, 10) + self.assertEqual(inst.container[0].description, "Green Gel tube") + self.assertEqual(inst.container[0].identifier[0].value, "48736-15394-75465") + self.assertEqual(inst.container[0].specimenQuantity.unit, "mL") + self.assertEqual(inst.container[0].specimenQuantity.value, 6) + self.assertEqual(inst.container[0].type.text, "Vacutainer") + self.assertEqual(inst.id, "101") + self.assertEqual(inst.identifier[0].system, "http://ehr.acme.org/identifiers/collections") + self.assertEqual(inst.identifier[0].value, "23234352356") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.note[0].text, "Patient dropped off specimen") - self.assertEqual(inst.receivedTime.date, FHIRDate("2015-08-18T07:03:00Z").date) - self.assertEqual(inst.receivedTime.as_json(), "2015-08-18T07:03:00Z") + self.assertEqual(inst.note[0].text, "Specimen is grossly lipemic") + self.assertEqual(inst.receivedTime.date, FHIRDate("2011-03-04T07:03:00Z").date) + self.assertEqual(inst.receivedTime.as_json(), "2011-03-04T07:03:00Z") self.assertEqual(inst.status, "available") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.coding[0].code, "429951000124103") - self.assertEqual(inst.type.coding[0].display, "Bacterial isolate specimen") + self.assertEqual(inst.type.coding[0].code, "122555007") + self.assertEqual(inst.type.coding[0].display, "Venous blood specimen") self.assertEqual(inst.type.coding[0].system, "http://snomed.info/sct") def testSpecimen2(self): - inst = self.instantiate_from("specimen-example-pooled-serum.json") + inst = self.instantiate_from("specimen-example-urine.json") self.assertIsNotNone(inst, "Must have instantiated a Specimen instance") self.implSpecimen2(inst) @@ -63,36 +78,6 @@ def testSpecimen2(self): self.implSpecimen2(inst2) def implSpecimen2(self, inst): - self.assertEqual(inst.accessionIdentifier.system, "https://vetmed.iastate.edu/vdl") - self.assertEqual(inst.accessionIdentifier.value, "20171120-1234") - self.assertEqual(inst.collection.collectedDateTime.date, FHIRDate("2017-11-14").date) - self.assertEqual(inst.collection.collectedDateTime.as_json(), "2017-11-14") - self.assertEqual(inst.container[0].type.coding[0].code, "RTT") - self.assertEqual(inst.container[0].type.coding[0].display, "Red Top Tube") - self.assertEqual(inst.container[0].type.coding[0].system, "https://vetmed.iastate.edu/vdl") - self.assertEqual(inst.container[0].type.text, "Red Top Blood Collection Tube") - self.assertEqual(inst.id, "pooled-serum") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.note[0].text, "Pooled serum sample from 30 individuals") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.coding[0].code, "Serum sample, pooled") - self.assertEqual(inst.type.coding[0].display, "Serum sample, pooled") - self.assertEqual(inst.type.coding[0].system, "https://vetmed.iastate.edu/vdl") - self.assertEqual(inst.type.text, "Pooled serum sample") - - def testSpecimen3(self): - inst = self.instantiate_from("specimen-example-urine.json") - self.assertIsNotNone(inst, "Must have instantiated a Specimen instance") - self.implSpecimen3(inst) - - js = inst.as_json() - self.assertEqual("Specimen", js["resourceType"]) - inst2 = specimen.Specimen(js) - self.implSpecimen3(inst2) - - def implSpecimen3(self, inst): self.assertEqual(inst.accessionIdentifier.system, "http://lab.acme.org/specimens/2015") self.assertEqual(inst.accessionIdentifier.value, "X352356") self.assertEqual(inst.collection.collectedDateTime.date, FHIRDate("2015-08-18T07:03:00Z").date) @@ -119,6 +104,36 @@ def implSpecimen3(self, inst): self.assertEqual(inst.type.coding[0].display, "Urine, Random") self.assertEqual(inst.type.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0487") + def testSpecimen3(self): + inst = self.instantiate_from("specimen-example-pooled-serum.json") + self.assertIsNotNone(inst, "Must have instantiated a Specimen instance") + self.implSpecimen3(inst) + + js = inst.as_json() + self.assertEqual("Specimen", js["resourceType"]) + inst2 = specimen.Specimen(js) + self.implSpecimen3(inst2) + + def implSpecimen3(self, inst): + self.assertEqual(inst.accessionIdentifier.system, "https://vetmed.iastate.edu/vdl") + self.assertEqual(inst.accessionIdentifier.value, "20171120-1234") + self.assertEqual(inst.collection.collectedDateTime.date, FHIRDate("2017-11-14").date) + self.assertEqual(inst.collection.collectedDateTime.as_json(), "2017-11-14") + self.assertEqual(inst.container[0].type.coding[0].code, "RTT") + self.assertEqual(inst.container[0].type.coding[0].display, "Red Top Tube") + self.assertEqual(inst.container[0].type.coding[0].system, "https://vetmed.iastate.edu/vdl") + self.assertEqual(inst.container[0].type.text, "Red Top Blood Collection Tube") + self.assertEqual(inst.id, "pooled-serum") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.note[0].text, "Pooled serum sample from 30 individuals") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.type.coding[0].code, "Serum sample, pooled") + self.assertEqual(inst.type.coding[0].display, "Serum sample, pooled") + self.assertEqual(inst.type.coding[0].system, "https://vetmed.iastate.edu/vdl") + self.assertEqual(inst.type.text, "Pooled serum sample") + def testSpecimen4(self): inst = self.instantiate_from("specimen-example-serum.json") self.assertIsNotNone(inst, "Must have instantiated a Specimen instance") @@ -147,7 +162,7 @@ def implSpecimen4(self, inst): self.assertEqual(inst.type.coding[0].system, "http://snomed.info/sct") def testSpecimen5(self): - inst = self.instantiate_from("specimen-example.json") + inst = self.instantiate_from("specimen-example-isolate.json") self.assertIsNotNone(inst, "Must have instantiated a Specimen instance") self.implSpecimen5(inst) @@ -158,37 +173,22 @@ def testSpecimen5(self): def implSpecimen5(self, inst): self.assertEqual(inst.accessionIdentifier.system, "http://lab.acme.org/specimens/2011") - self.assertEqual(inst.accessionIdentifier.value, "X352356") - self.assertEqual(inst.collection.bodySite.coding[0].code, "49852007") - self.assertEqual(inst.collection.bodySite.coding[0].display, "Structure of median cubital vein (body structure)") - self.assertEqual(inst.collection.bodySite.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.collection.bodySite.text, "Right median cubital vein") - self.assertEqual(inst.collection.collectedDateTime.date, FHIRDate("2011-05-30T06:15:00Z").date) - self.assertEqual(inst.collection.collectedDateTime.as_json(), "2011-05-30T06:15:00Z") - self.assertEqual(inst.collection.method.coding[0].code, "LNV") + self.assertEqual(inst.accessionIdentifier.value, "X352356-ISO1") + self.assertEqual(inst.collection.collectedDateTime.date, FHIRDate("2015-08-16T07:03:00Z").date) + self.assertEqual(inst.collection.collectedDateTime.as_json(), "2015-08-16T07:03:00Z") + self.assertEqual(inst.collection.method.coding[0].code, "BAP") self.assertEqual(inst.collection.method.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0488") - self.assertEqual(inst.collection.quantity.unit, "mL") - self.assertEqual(inst.collection.quantity.value, 6) - self.assertEqual(inst.contained[0].id, "hep") - self.assertEqual(inst.container[0].capacity.unit, "mL") - self.assertEqual(inst.container[0].capacity.value, 10) - self.assertEqual(inst.container[0].description, "Green Gel tube") - self.assertEqual(inst.container[0].identifier[0].value, "48736-15394-75465") - self.assertEqual(inst.container[0].specimenQuantity.unit, "mL") - self.assertEqual(inst.container[0].specimenQuantity.value, 6) - self.assertEqual(inst.container[0].type.text, "Vacutainer") - self.assertEqual(inst.id, "101") - self.assertEqual(inst.identifier[0].system, "http://ehr.acme.org/identifiers/collections") - self.assertEqual(inst.identifier[0].value, "23234352356") + self.assertEqual(inst.contained[0].id, "stool") + self.assertEqual(inst.id, "isolate") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.note[0].text, "Specimen is grossly lipemic") - self.assertEqual(inst.receivedTime.date, FHIRDate("2011-03-04T07:03:00Z").date) - self.assertEqual(inst.receivedTime.as_json(), "2011-03-04T07:03:00Z") + self.assertEqual(inst.note[0].text, "Patient dropped off specimen") + self.assertEqual(inst.receivedTime.date, FHIRDate("2015-08-18T07:03:00Z").date) + self.assertEqual(inst.receivedTime.as_json(), "2015-08-18T07:03:00Z") self.assertEqual(inst.status, "available") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.type.coding[0].code, "122555007") - self.assertEqual(inst.type.coding[0].display, "Venous blood specimen") + self.assertEqual(inst.type.coding[0].code, "429951000124103") + self.assertEqual(inst.type.coding[0].display, "Bacterial isolate specimen") self.assertEqual(inst.type.coding[0].system, "http://snomed.info/sct") diff --git a/fhirclient/models/specimendefinition.py b/fhirclient/models/specimendefinition.py index 06d070da7..7b201be3b 100644 --- a/fhirclient/models/specimendefinition.py +++ b/fhirclient/models/specimendefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/SpecimenDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SpecimenDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/specimendefinition_tests.py b/fhirclient/models/specimendefinition_tests.py index ed93dd43d..63b8c3f2d 100644 --- a/fhirclient/models/specimendefinition_tests.py +++ b/fhirclient/models/specimendefinition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/structuredefinition.py b/fhirclient/models/structuredefinition.py index 684031b5a..0193b4de1 100644 --- a/fhirclient/models/structuredefinition.py +++ b/fhirclient/models/structuredefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/StructureDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/StructureDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/structuredefinition_tests.py b/fhirclient/models/structuredefinition_tests.py index 322449678..8aa6faf3b 100644 --- a/fhirclient/models/structuredefinition_tests.py +++ b/fhirclient/models/structuredefinition_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/structuremap.py b/fhirclient/models/structuremap.py index a3ed67756..2bf0af663 100644 --- a/fhirclient/models/structuremap.py +++ b/fhirclient/models/structuremap.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/StructureMap) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/StructureMap) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -451,6 +451,10 @@ def __init__(self, jsondict=None, strict=True): """ Default value if no value exists. Type `str`. """ + self.defaultValueMeta = None + """ Default value if no value exists. + Type `Meta` (represented as `dict` in JSON). """ + self.defaultValueMoney = None """ Default value if no value exists. Type `Money` (represented as `dict` in JSON). """ @@ -599,6 +603,7 @@ def elementProperties(self): ("defaultValueInstant", "defaultValueInstant", fhirdate.FHIRDate, False, "defaultValue", False), ("defaultValueInteger", "defaultValueInteger", int, False, "defaultValue", False), ("defaultValueMarkdown", "defaultValueMarkdown", str, False, "defaultValue", False), + ("defaultValueMeta", "defaultValueMeta", meta.Meta, False, "defaultValue", False), ("defaultValueMoney", "defaultValueMoney", money.Money, False, "defaultValue", False), ("defaultValueOid", "defaultValueOid", str, False, "defaultValue", False), ("defaultValueParameterDefinition", "defaultValueParameterDefinition", parameterdefinition.ParameterDefinition, False, "defaultValue", False), @@ -865,6 +870,10 @@ def elementProperties(self): from . import identifier except ImportError: identifier = sys.modules[__package__ + '.identifier'] +try: + from . import meta +except ImportError: + meta = sys.modules[__package__ + '.meta'] try: from . import money except ImportError: diff --git a/fhirclient/models/structuremap_tests.py b/fhirclient/models/structuremap_tests.py index 04f57f7d2..f1e467bd5 100644 --- a/fhirclient/models/structuremap_tests.py +++ b/fhirclient/models/structuremap_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/subscription.py b/fhirclient/models/subscription.py index 104df3020..1444a3ada 100644 --- a/fhirclient/models/subscription.py +++ b/fhirclient/models/subscription.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Subscription) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Subscription) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/subscription_tests.py b/fhirclient/models/subscription_tests.py index 61934a379..f3f2b58d5 100644 --- a/fhirclient/models/subscription_tests.py +++ b/fhirclient/models/subscription_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/substance.py b/fhirclient/models/substance.py index 20f7995e7..4c6000018 100644 --- a/fhirclient/models/substance.py +++ b/fhirclient/models/substance.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Substance) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Substance) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/substance_tests.py b/fhirclient/models/substance_tests.py index 292977f55..5160f0ce5 100644 --- a/fhirclient/models/substance_tests.py +++ b/fhirclient/models/substance_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return substance.Substance(js) def testSubstance1(self): - inst = self.instantiate_from("substance-example-silver-nitrate-product.json") + inst = self.instantiate_from("substance-example-f202-staphylococcus.json") self.assertIsNotNone(inst, "Must have instantiated a Substance instance") self.implSubstance1(inst) @@ -32,31 +32,17 @@ def testSubstance1(self): self.implSubstance1(inst2) def implSubstance1(self, inst): - self.assertEqual(inst.category[0].coding[0].code, "chemical") - self.assertEqual(inst.category[0].coding[0].display, "Chemical") - self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/substance-category") - self.assertEqual(inst.code.coding[0].code, "333346007") - self.assertEqual(inst.code.coding[0].display, "Silver nitrate 20% solution (product)") + self.assertEqual(inst.code.coding[0].code, "3092008") + self.assertEqual(inst.code.coding[0].display, "Staphylococcus Aureus") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.description, "Solution for silver nitrate stain") - self.assertEqual(inst.id, "f204") - self.assertEqual(inst.identifier[0].system, "http://acme.org/identifiers/substances") - self.assertEqual(inst.identifier[0].value, "15970") - self.assertEqual(inst.instance[0].expiry.date, FHIRDate("2018-01-01").date) - self.assertEqual(inst.instance[0].expiry.as_json(), "2018-01-01") - self.assertEqual(inst.instance[0].identifier.system, "http://acme.org/identifiers/substances/lot") - self.assertEqual(inst.instance[0].identifier.value, "AB94687") - self.assertEqual(inst.instance[0].quantity.code, "mL") - self.assertEqual(inst.instance[0].quantity.system, "http://unitsofmeasure.org") - self.assertEqual(inst.instance[0].quantity.unit, "mL") - self.assertEqual(inst.instance[0].quantity.value, 100) + self.assertEqual(inst.id, "f202") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.text.status, "generated") def testSubstance2(self): - inst = self.instantiate_from("substance-example-amoxicillin-clavulanate.json") + inst = self.instantiate_from("substance-example.json") self.assertIsNotNone(inst, "Must have instantiated a Substance instance") self.implSubstance2(inst) @@ -66,6 +52,30 @@ def testSubstance2(self): self.implSubstance2(inst2) def implSubstance2(self, inst): + self.assertEqual(inst.category[0].coding[0].code, "allergen") + self.assertEqual(inst.category[0].coding[0].display, "Allergen") + self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/substance-category") + self.assertEqual(inst.code.text, "apitoxin (Honey Bee Venom)") + self.assertEqual(inst.id, "example") + self.assertEqual(inst.identifier[0].system, "http://acme.org/identifiers/substances") + self.assertEqual(inst.identifier[0].value, "1463") + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.status, "generated") + + def testSubstance3(self): + inst = self.instantiate_from("substance-example-amoxicillin-clavulanate.json") + self.assertIsNotNone(inst, "Must have instantiated a Substance instance") + self.implSubstance3(inst) + + js = inst.as_json() + self.assertEqual("Substance", js["resourceType"]) + inst2 = substance.Substance(js) + self.implSubstance3(inst2) + + def implSubstance3(self, inst): self.assertEqual(inst.category[0].coding[0].code, "drug") self.assertEqual(inst.category[0].coding[0].display, "Drug or Medicament") self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/substance-category") @@ -97,17 +107,17 @@ def implSubstance2(self, inst): self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.text.status, "generated") - def testSubstance3(self): + def testSubstance4(self): inst = self.instantiate_from("substance-example-f203-potassium.json") self.assertIsNotNone(inst, "Must have instantiated a Substance instance") - self.implSubstance3(inst) + self.implSubstance4(inst) js = inst.as_json() self.assertEqual("Substance", js["resourceType"]) inst2 = substance.Substance(js) - self.implSubstance3(inst2) + self.implSubstance4(inst2) - def implSubstance3(self, inst): + def implSubstance4(self, inst): self.assertEqual(inst.category[0].coding[0].code, "chemical") self.assertEqual(inst.category[0].coding[0].display, "Chemical") self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/substance-category") @@ -122,17 +132,17 @@ def implSubstance3(self, inst): self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.text.status, "generated") - def testSubstance4(self): + def testSubstance5(self): inst = self.instantiate_from("substance-example-f201-dust.json") self.assertIsNotNone(inst, "Must have instantiated a Substance instance") - self.implSubstance4(inst) + self.implSubstance5(inst) js = inst.as_json() self.assertEqual("Substance", js["resourceType"]) inst2 = substance.Substance(js) - self.implSubstance4(inst2) + self.implSubstance5(inst2) - def implSubstance4(self, inst): + def implSubstance5(self, inst): self.assertEqual(inst.code.coding[0].code, "406466009") self.assertEqual(inst.code.coding[0].display, "House dust allergen") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") @@ -142,32 +152,8 @@ def implSubstance4(self, inst): self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.text.status, "generated") - def testSubstance5(self): - inst = self.instantiate_from("substance-example.json") - self.assertIsNotNone(inst, "Must have instantiated a Substance instance") - self.implSubstance5(inst) - - js = inst.as_json() - self.assertEqual("Substance", js["resourceType"]) - inst2 = substance.Substance(js) - self.implSubstance5(inst2) - - def implSubstance5(self, inst): - self.assertEqual(inst.category[0].coding[0].code, "allergen") - self.assertEqual(inst.category[0].coding[0].display, "Allergen") - self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/substance-category") - self.assertEqual(inst.code.text, "apitoxin (Honey Bee Venom)") - self.assertEqual(inst.id, "example") - self.assertEqual(inst.identifier[0].system, "http://acme.org/identifiers/substances") - self.assertEqual(inst.identifier[0].value, "1463") - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "generated") - def testSubstance6(self): - inst = self.instantiate_from("substance-example-f202-staphylococcus.json") + inst = self.instantiate_from("substance-example-silver-nitrate-product.json") self.assertIsNotNone(inst, "Must have instantiated a Substance instance") self.implSubstance6(inst) @@ -177,10 +163,24 @@ def testSubstance6(self): self.implSubstance6(inst2) def implSubstance6(self, inst): - self.assertEqual(inst.code.coding[0].code, "3092008") - self.assertEqual(inst.code.coding[0].display, "Staphylococcus Aureus") + self.assertEqual(inst.category[0].coding[0].code, "chemical") + self.assertEqual(inst.category[0].coding[0].display, "Chemical") + self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/substance-category") + self.assertEqual(inst.code.coding[0].code, "333346007") + self.assertEqual(inst.code.coding[0].display, "Silver nitrate 20% solution (product)") self.assertEqual(inst.code.coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.id, "f202") + self.assertEqual(inst.description, "Solution for silver nitrate stain") + self.assertEqual(inst.id, "f204") + self.assertEqual(inst.identifier[0].system, "http://acme.org/identifiers/substances") + self.assertEqual(inst.identifier[0].value, "15970") + self.assertEqual(inst.instance[0].expiry.date, FHIRDate("2018-01-01").date) + self.assertEqual(inst.instance[0].expiry.as_json(), "2018-01-01") + self.assertEqual(inst.instance[0].identifier.system, "http://acme.org/identifiers/substances/lot") + self.assertEqual(inst.instance[0].identifier.value, "AB94687") + self.assertEqual(inst.instance[0].quantity.code, "mL") + self.assertEqual(inst.instance[0].quantity.system, "http://unitsofmeasure.org") + self.assertEqual(inst.instance[0].quantity.unit, "mL") + self.assertEqual(inst.instance[0].quantity.value, 100) self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") diff --git a/fhirclient/models/substanceamount.py b/fhirclient/models/substanceamount.py index dc3983faf..92f1ec83a 100644 --- a/fhirclient/models/substanceamount.py +++ b/fhirclient/models/substanceamount.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/SubstanceAmount) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceAmount) on 2024-07-15. +# 2024, SMART Health IT. from . import backboneelement diff --git a/fhirclient/models/substancenucleicacid.py b/fhirclient/models/substancenucleicacid.py index e688477b5..11eddb398 100644 --- a/fhirclient/models/substancenucleicacid.py +++ b/fhirclient/models/substancenucleicacid.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/SubstanceNucleicAcid) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceNucleicAcid) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/substancepolymer.py b/fhirclient/models/substancepolymer.py index da3ddbe65..213d32d17 100644 --- a/fhirclient/models/substancepolymer.py +++ b/fhirclient/models/substancepolymer.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/SubstancePolymer) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstancePolymer) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/substanceprotein.py b/fhirclient/models/substanceprotein.py index 4770bc693..41bed6c32 100644 --- a/fhirclient/models/substanceprotein.py +++ b/fhirclient/models/substanceprotein.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/SubstanceProtein) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceProtein) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/substancereferenceinformation.py b/fhirclient/models/substancereferenceinformation.py index 2f6fac14b..2ddff9f67 100644 --- a/fhirclient/models/substancereferenceinformation.py +++ b/fhirclient/models/substancereferenceinformation.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/SubstanceReferenceInformation) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceReferenceInformation) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/substancesourcematerial.py b/fhirclient/models/substancesourcematerial.py index 45c346b76..fa2db50ae 100644 --- a/fhirclient/models/substancesourcematerial.py +++ b/fhirclient/models/substancesourcematerial.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/SubstanceSourceMaterial) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceSourceMaterial) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/substancespecification.py b/fhirclient/models/substancespecification.py index aa9a14eae..747f2645f 100644 --- a/fhirclient/models/substancespecification.py +++ b/fhirclient/models/substancespecification.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/SubstanceSpecification) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceSpecification) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/substancespecification_tests.py b/fhirclient/models/substancespecification_tests.py index 64454c84e..e5f9a3fb8 100644 --- a/fhirclient/models/substancespecification_tests.py +++ b/fhirclient/models/substancespecification_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return substancespecification.SubstanceSpecification(js) def testSubstanceSpecification1(self): - inst = self.instantiate_from("substancesourcematerial-example.json") + inst = self.instantiate_from("substancepolymer-example.json") self.assertIsNotNone(inst, "Must have instantiated a SubstanceSpecification instance") self.implSubstanceSpecification1(inst) @@ -40,7 +40,7 @@ def implSubstanceSpecification1(self, inst): self.assertEqual(inst.text.status, "generated") def testSubstanceSpecification2(self): - inst = self.instantiate_from("substanceprotein-example.json") + inst = self.instantiate_from("substancereferenceinformation-example.json") self.assertIsNotNone(inst, "Must have instantiated a SubstanceSpecification instance") self.implSubstanceSpecification2(inst) @@ -58,7 +58,7 @@ def implSubstanceSpecification2(self, inst): self.assertEqual(inst.text.status, "generated") def testSubstanceSpecification3(self): - inst = self.instantiate_from("substancepolymer-example.json") + inst = self.instantiate_from("substancenucleicacid-example.json") self.assertIsNotNone(inst, "Must have instantiated a SubstanceSpecification instance") self.implSubstanceSpecification3(inst) @@ -76,7 +76,7 @@ def implSubstanceSpecification3(self, inst): self.assertEqual(inst.text.status, "generated") def testSubstanceSpecification4(self): - inst = self.instantiate_from("substancespecification-example.json") + inst = self.instantiate_from("substanceprotein-example.json") self.assertIsNotNone(inst, "Must have instantiated a SubstanceSpecification instance") self.implSubstanceSpecification4(inst) @@ -94,7 +94,7 @@ def implSubstanceSpecification4(self, inst): self.assertEqual(inst.text.status, "generated") def testSubstanceSpecification5(self): - inst = self.instantiate_from("substancereferenceinformation-example.json") + inst = self.instantiate_from("substancespecification-example.json") self.assertIsNotNone(inst, "Must have instantiated a SubstanceSpecification instance") self.implSubstanceSpecification5(inst) @@ -112,7 +112,7 @@ def implSubstanceSpecification5(self, inst): self.assertEqual(inst.text.status, "generated") def testSubstanceSpecification6(self): - inst = self.instantiate_from("substancenucleicacid-example.json") + inst = self.instantiate_from("substancesourcematerial-example.json") self.assertIsNotNone(inst, "Must have instantiated a SubstanceSpecification instance") self.implSubstanceSpecification6(inst) diff --git a/fhirclient/models/supplydelivery.py b/fhirclient/models/supplydelivery.py index 1d9ef8407..56e8b9b3b 100644 --- a/fhirclient/models/supplydelivery.py +++ b/fhirclient/models/supplydelivery.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/SupplyDelivery) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SupplyDelivery) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/supplydelivery_tests.py b/fhirclient/models/supplydelivery_tests.py index 85fb29c16..db0e8872a 100644 --- a/fhirclient/models/supplydelivery_tests.py +++ b/fhirclient/models/supplydelivery_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/supplyrequest.py b/fhirclient/models/supplyrequest.py index 35983ab2e..4cfbf7225 100644 --- a/fhirclient/models/supplyrequest.py +++ b/fhirclient/models/supplyrequest.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/SupplyRequest) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SupplyRequest) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/supplyrequest_tests.py b/fhirclient/models/supplyrequest_tests.py index f9203489d..07cc94ef9 100644 --- a/fhirclient/models/supplyrequest_tests.py +++ b/fhirclient/models/supplyrequest_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/task.py b/fhirclient/models/task.py index c3bc04454..d0f0bb3d7 100644 --- a/fhirclient/models/task.py +++ b/fhirclient/models/task.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Task) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Task) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource @@ -320,6 +320,10 @@ def __init__(self, jsondict=None, strict=True): """ Content to use in performing the task. Type `str`. """ + self.valueMeta = None + """ Content to use in performing the task. + Type `Meta` (represented as `dict` in JSON). """ + self.valueMoney = None """ Content to use in performing the task. Type `Money` (represented as `dict` in JSON). """ @@ -438,6 +442,7 @@ def elementProperties(self): ("valueInstant", "valueInstant", fhirdate.FHIRDate, False, "value", True), ("valueInteger", "valueInteger", int, False, "value", True), ("valueMarkdown", "valueMarkdown", str, False, "value", True), + ("valueMeta", "valueMeta", meta.Meta, False, "value", True), ("valueMoney", "valueMoney", money.Money, False, "value", True), ("valueOid", "valueOid", str, False, "value", True), ("valueParameterDefinition", "valueParameterDefinition", parameterdefinition.ParameterDefinition, False, "value", True), @@ -595,6 +600,10 @@ def __init__(self, jsondict=None, strict=True): """ Result of output. Type `str`. """ + self.valueMeta = None + """ Result of output. + Type `Meta` (represented as `dict` in JSON). """ + self.valueMoney = None """ Result of output. Type `Money` (represented as `dict` in JSON). """ @@ -713,6 +722,7 @@ def elementProperties(self): ("valueInstant", "valueInstant", fhirdate.FHIRDate, False, "value", True), ("valueInteger", "valueInteger", int, False, "value", True), ("valueMarkdown", "valueMarkdown", str, False, "value", True), + ("valueMeta", "valueMeta", meta.Meta, False, "value", True), ("valueMoney", "valueMoney", money.Money, False, "value", True), ("valueOid", "valueOid", str, False, "value", True), ("valueParameterDefinition", "valueParameterDefinition", parameterdefinition.ParameterDefinition, False, "value", True), @@ -857,6 +867,10 @@ def elementProperties(self): from . import identifier except ImportError: identifier = sys.modules[__package__ + '.identifier'] +try: + from . import meta +except ImportError: + meta = sys.modules[__package__ + '.meta'] try: from . import money except ImportError: diff --git a/fhirclient/models/task_tests.py b/fhirclient/models/task_tests.py index 380c4737d..99e2c61a7 100644 --- a/fhirclient/models/task_tests.py +++ b/fhirclient/models/task_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return task.Task(js) def testTask1(self): - inst = self.instantiate_from("task-example6.json") + inst = self.instantiate_from("task-example2.json") self.assertIsNotNone(inst, "Must have instantiated a Task instance") self.implTask1(inst) @@ -32,44 +32,38 @@ def testTask1(self): self.implTask1(inst2) def implTask1(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2016-10-31T08:25:05+10:00").date) - self.assertEqual(inst.authoredOn.as_json(), "2016-10-31T08:25:05+10:00") - self.assertEqual(inst.businessStatus.text, "test completed and posted") - self.assertEqual(inst.code.text, "Lipid Panel") - self.assertEqual(inst.description, "Create order for getting specimen, Set up inhouse testing, generate order for any sendouts and submit with specimen") - self.assertEqual(inst.executionPeriod.end.date, FHIRDate("2016-10-31T18:45:05+10:00").date) - self.assertEqual(inst.executionPeriod.end.as_json(), "2016-10-31T18:45:05+10:00") - self.assertEqual(inst.executionPeriod.start.date, FHIRDate("2016-10-31T08:25:05+10:00").date) - self.assertEqual(inst.executionPeriod.start.as_json(), "2016-10-31T08:25:05+10:00") + self.assertEqual(inst.authoredOn.date, FHIRDate("2016-10-31T08:45:05+10:00").date) + self.assertEqual(inst.authoredOn.as_json(), "2016-10-31T08:45:05+10:00") + self.assertEqual(inst.businessStatus.text, "waiting for patient") + self.assertEqual(inst.code.text, "Specimen Collection") + self.assertEqual(inst.executionPeriod.start.date, FHIRDate("2016-10-31T08:45:05+10:00").date) + self.assertEqual(inst.executionPeriod.start.as_json(), "2016-10-31T08:45:05+10:00") self.assertEqual(inst.groupIdentifier.system, "http:/goodhealth.org/accession/identifiers") self.assertEqual(inst.groupIdentifier.use, "official") self.assertEqual(inst.groupIdentifier.value, "G20170201-001") - self.assertEqual(inst.id, "example6") + self.assertEqual(inst.id, "example2") self.assertEqual(inst.identifier[0].system, "http:/goodhealth.org/identifiers") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "20170201-001") - self.assertEqual(inst.intent, "order") - self.assertEqual(inst.lastModified.date, FHIRDate("2016-10-31T18:45:05+10:00").date) - self.assertEqual(inst.lastModified.as_json(), "2016-10-31T18:45:05+10:00") + self.assertEqual(inst.identifier[0].value, "20170201-002") + self.assertEqual(inst.intent, "filler-order") + self.assertEqual(inst.lastModified.date, FHIRDate("2016-10-31T09:45:05+10:00").date) + self.assertEqual(inst.lastModified.as_json(), "2016-10-31T09:45:05+10:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.output[0].type.text, "DiagnosticReport generated") - self.assertEqual(inst.output[1].type.text, "collected specimen") self.assertEqual(inst.performerType[0].coding[0].code, "performer") self.assertEqual(inst.performerType[0].coding[0].display, "Performer") self.assertEqual(inst.performerType[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/task-performer-type") self.assertEqual(inst.performerType[0].text, "Performer") self.assertEqual(inst.priority, "routine") - self.assertEqual(inst.reasonCode.text, "The Task.reason should only be included if there is no Task.focus or if it differs from the reason indicated on the focus") - self.assertEqual(inst.restriction.period.end.date, FHIRDate("2016-11-02T09:45:05+10:00").date) - self.assertEqual(inst.restriction.period.end.as_json(), "2016-11-02T09:45:05+10:00") + self.assertEqual(inst.restriction.period.end.date, FHIRDate("2016-11-01T09:45:05+10:00").date) + self.assertEqual(inst.restriction.period.end.as_json(), "2016-11-01T09:45:05+10:00") self.assertEqual(inst.restriction.repetitions, 1) - self.assertEqual(inst.status, "completed") + self.assertEqual(inst.status, "accepted") self.assertEqual(inst.text.status, "generated") def testTask2(self): - inst = self.instantiate_from("task-example-fm-poll.json") + inst = self.instantiate_from("task-example4.json") self.assertIsNotNone(inst, "Must have instantiated a Task instance") self.implTask2(inst) @@ -79,35 +73,40 @@ def testTask2(self): self.implTask2(inst2) def implTask2(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2018-10-12T08:25:05+10:00").date) - self.assertEqual(inst.authoredOn.as_json(), "2018-10-12T08:25:05+10:00") - self.assertEqual(inst.code.coding[0].code, "poll") - self.assertEqual(inst.code.coding[0].system, "http://terminology.hl7.org/CodeSystem/financialtaskcode") - self.assertEqual(inst.id, "fm-example2") - self.assertEqual(inst.identifier[0].system, "http:/happyvalley.com/task") + self.assertEqual(inst.authoredOn.date, FHIRDate("2016-10-31T08:45:05+10:00").date) + self.assertEqual(inst.authoredOn.as_json(), "2016-10-31T08:45:05+10:00") + self.assertEqual(inst.code.text, "Specimen Collection") + self.assertEqual(inst.executionPeriod.end.date, FHIRDate("2016-10-31T14:45:05+10:00").date) + self.assertEqual(inst.executionPeriod.end.as_json(), "2016-10-31T14:45:05+10:00") + self.assertEqual(inst.executionPeriod.start.date, FHIRDate("2016-10-31T08:45:05+10:00").date) + self.assertEqual(inst.executionPeriod.start.as_json(), "2016-10-31T08:45:05+10:00") + self.assertEqual(inst.groupIdentifier.system, "http:/goodhealth.org/accession/identifiers") + self.assertEqual(inst.groupIdentifier.use, "official") + self.assertEqual(inst.groupIdentifier.value, "G20170201-001") + self.assertEqual(inst.id, "example4") + self.assertEqual(inst.identifier[0].system, "http:/goodhealth.org/identifiers") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "20181012-005") - self.assertEqual(inst.input[0].type.coding[0].code, "include") - self.assertEqual(inst.input[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/financialtaskinputtype") - self.assertEqual(inst.input[0].valueCode, "ClaimResponse") - self.assertEqual(inst.input[1].type.coding[0].code, "period") - self.assertEqual(inst.input[1].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/financialtaskinputtype") - self.assertEqual(inst.input[1].valuePeriod.end.date, FHIRDate("2018-10-12").date) - self.assertEqual(inst.input[1].valuePeriod.end.as_json(), "2018-10-12") - self.assertEqual(inst.input[1].valuePeriod.start.date, FHIRDate("2018-10-01").date) - self.assertEqual(inst.input[1].valuePeriod.start.as_json(), "2018-10-01") - self.assertEqual(inst.intent, "order") - self.assertEqual(inst.lastModified.date, FHIRDate("2018-10-12T08:25:05+10:00").date) - self.assertEqual(inst.lastModified.as_json(), "2018-10-12T08:25:05+10:00") + self.assertEqual(inst.identifier[0].value, "20170201-002") + self.assertEqual(inst.intent, "filler-order") + self.assertEqual(inst.lastModified.date, FHIRDate("2016-10-31T09:45:05+10:00").date) + self.assertEqual(inst.lastModified.as_json(), "2016-10-31T09:45:05+10:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.priority, "stat") - self.assertEqual(inst.status, "requested") + self.assertEqual(inst.output[0].type.text, "collected specimen") + self.assertEqual(inst.performerType[0].coding[0].code, "performer") + self.assertEqual(inst.performerType[0].coding[0].display, "Performer") + self.assertEqual(inst.performerType[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/task-performer-type") + self.assertEqual(inst.performerType[0].text, "Performer") + self.assertEqual(inst.priority, "routine") + self.assertEqual(inst.restriction.period.end.date, FHIRDate("2016-11-01T09:45:05+10:00").date) + self.assertEqual(inst.restriction.period.end.as_json(), "2016-11-01T09:45:05+10:00") + self.assertEqual(inst.restriction.repetitions, 1) + self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.status, "generated") def testTask3(self): - inst = self.instantiate_from("task-example1.json") + inst = self.instantiate_from("task-example3.json") self.assertIsNotNone(inst, "Must have instantiated a Task instance") self.implTask3(inst) @@ -117,41 +116,21 @@ def testTask3(self): self.implTask3(inst2) def implTask3(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2016-10-31T08:25:05+10:00").date) - self.assertEqual(inst.authoredOn.as_json(), "2016-10-31T08:25:05+10:00") - self.assertEqual(inst.businessStatus.text, "waiting for specimen") - self.assertEqual(inst.code.text, "Lipid Panel") - self.assertEqual(inst.contained[0].id, "signature") - self.assertEqual(inst.description, "Create order for getting specimen, Set up inhouse testing, generate order for any sendouts and submit with specimen") - self.assertEqual(inst.executionPeriod.start.date, FHIRDate("2016-10-31T08:25:05+10:00").date) - self.assertEqual(inst.executionPeriod.start.as_json(), "2016-10-31T08:25:05+10:00") - self.assertEqual(inst.groupIdentifier.system, "http:/goodhealth.org/accession/identifiers") - self.assertEqual(inst.groupIdentifier.use, "official") - self.assertEqual(inst.groupIdentifier.value, "G20170201-001") - self.assertEqual(inst.id, "example1") - self.assertEqual(inst.identifier[0].system, "http:/goodhealth.org/identifiers") - self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "20170201-001") + self.assertEqual(inst.authoredOn.date, FHIRDate("2016-03-10T22:39:32-04:00").date) + self.assertEqual(inst.authoredOn.as_json(), "2016-03-10T22:39:32-04:00") + self.assertEqual(inst.code.text, "Refill Request") + self.assertEqual(inst.id, "example3") self.assertEqual(inst.intent, "order") - self.assertEqual(inst.lastModified.date, FHIRDate("2016-10-31T09:45:05+10:00").date) - self.assertEqual(inst.lastModified.as_json(), "2016-10-31T09:45:05+10:00") + self.assertEqual(inst.lastModified.date, FHIRDate("2016-03-10T22:39:32-04:00").date) + self.assertEqual(inst.lastModified.as_json(), "2016-03-10T22:39:32-04:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.performerType[0].coding[0].code, "performer") - self.assertEqual(inst.performerType[0].coding[0].display, "Performer") - self.assertEqual(inst.performerType[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/task-performer-type") - self.assertEqual(inst.performerType[0].text, "Performer") - self.assertEqual(inst.priority, "routine") - self.assertEqual(inst.reasonCode.text, "The Task.reason should only be included if there is no Task.focus or if it differs from the reason indicated on the focus") - self.assertEqual(inst.restriction.period.end.date, FHIRDate("2016-11-02T09:45:05+10:00").date) - self.assertEqual(inst.restriction.period.end.as_json(), "2016-11-02T09:45:05+10:00") - self.assertEqual(inst.restriction.repetitions, 1) - self.assertEqual(inst.status, "in-progress") + self.assertEqual(inst.status, "draft") self.assertEqual(inst.text.status, "generated") def testTask4(self): - inst = self.instantiate_from("task-example-fm-reprocess.json") + inst = self.instantiate_from("task-example-fm-status-resp.json") self.assertIsNotNone(inst, "Must have instantiated a Task instance") self.implTask4(inst) @@ -163,35 +142,30 @@ def testTask4(self): def implTask4(self, inst): self.assertEqual(inst.authoredOn.date, FHIRDate("2018-10-04T08:25:05+10:00").date) self.assertEqual(inst.authoredOn.as_json(), "2018-10-04T08:25:05+10:00") - self.assertEqual(inst.code.coding[0].code, "reprocess") + self.assertEqual(inst.code.coding[0].code, "status") self.assertEqual(inst.code.coding[0].system, "http://terminology.hl7.org/CodeSystem/financialtaskcode") - self.assertEqual(inst.id, "fm-example4") + self.assertEqual(inst.id, "fm-example6") self.assertEqual(inst.identifier[0].system, "http:/happyvalley.com/task") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "20181012-006") - self.assertEqual(inst.input[0].type.coding[0].code, "origresponse") - self.assertEqual(inst.input[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/financialtaskinputtype") - self.assertEqual(inst.input[1].type.coding[0].code, "reference") - self.assertEqual(inst.input[1].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/financialtaskinputtype") - self.assertEqual(inst.input[1].valueString, "BR12345") - self.assertEqual(inst.input[2].type.coding[0].code, "item") - self.assertEqual(inst.input[2].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/financialtaskinputtype") - self.assertEqual(inst.input[2].valuePositiveInt, 2) - self.assertEqual(inst.input[3].type.coding[0].code, "item") - self.assertEqual(inst.input[3].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/financialtaskinputtype") - self.assertEqual(inst.input[3].valuePositiveInt, 3) + self.assertEqual(inst.identifier[0].value, "20181012-001") + self.assertEqual(inst.identifier[1].system, "http://nationalinsurers.com/identifiers/12345") + self.assertEqual(inst.identifier[1].use, "official") + self.assertEqual(inst.identifier[1].value, "123GB5674") self.assertEqual(inst.intent, "order") self.assertEqual(inst.lastModified.date, FHIRDate("2018-10-04T08:25:05+10:00").date) self.assertEqual(inst.lastModified.as_json(), "2018-10-04T08:25:05+10:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.output[0].type.coding[0].code, "status") + self.assertEqual(inst.output[0].type.coding[0].system, "http://hl7.org/financial-taskoutputtype") + self.assertEqual(inst.output[0].valueCode, "complete") self.assertEqual(inst.priority, "stat") - self.assertEqual(inst.status, "requested") + self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.status, "generated") def testTask5(self): - inst = self.instantiate_from("task-example3.json") + inst = self.instantiate_from("task-example-fm-cancel.json") self.assertIsNotNone(inst, "Must have instantiated a Task instance") self.implTask5(inst) @@ -201,21 +175,26 @@ def testTask5(self): self.implTask5(inst2) def implTask5(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2016-03-10T22:39:32-04:00").date) - self.assertEqual(inst.authoredOn.as_json(), "2016-03-10T22:39:32-04:00") - self.assertEqual(inst.code.text, "Refill Request") - self.assertEqual(inst.id, "example3") + self.assertEqual(inst.authoredOn.date, FHIRDate("2018-10-04T08:25:05+10:00").date) + self.assertEqual(inst.authoredOn.as_json(), "2018-10-04T08:25:05+10:00") + self.assertEqual(inst.code.coding[0].code, "cancel") + self.assertEqual(inst.code.coding[0].system, "http://terminology.hl7.org/CodeSystem/financialtaskcode") + self.assertEqual(inst.id, "fm-example1") + self.assertEqual(inst.identifier[0].system, "http:/happyvalley.com/task") + self.assertEqual(inst.identifier[0].use, "official") + self.assertEqual(inst.identifier[0].value, "20181012-001") self.assertEqual(inst.intent, "order") - self.assertEqual(inst.lastModified.date, FHIRDate("2016-03-10T22:39:32-04:00").date) - self.assertEqual(inst.lastModified.as_json(), "2016-03-10T22:39:32-04:00") + self.assertEqual(inst.lastModified.date, FHIRDate("2018-10-04T08:25:05+10:00").date) + self.assertEqual(inst.lastModified.as_json(), "2018-10-04T08:25:05+10:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.status, "draft") + self.assertEqual(inst.priority, "stat") + self.assertEqual(inst.status, "requested") self.assertEqual(inst.text.status, "generated") def testTask6(self): - inst = self.instantiate_from("task-example-fm-status-resp.json") + inst = self.instantiate_from("task-example-fm-poll.json") self.assertIsNotNone(inst, "Must have instantiated a Task instance") self.implTask6(inst) @@ -225,32 +204,35 @@ def testTask6(self): self.implTask6(inst2) def implTask6(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2018-10-04T08:25:05+10:00").date) - self.assertEqual(inst.authoredOn.as_json(), "2018-10-04T08:25:05+10:00") - self.assertEqual(inst.code.coding[0].code, "status") + self.assertEqual(inst.authoredOn.date, FHIRDate("2018-10-12T08:25:05+10:00").date) + self.assertEqual(inst.authoredOn.as_json(), "2018-10-12T08:25:05+10:00") + self.assertEqual(inst.code.coding[0].code, "poll") self.assertEqual(inst.code.coding[0].system, "http://terminology.hl7.org/CodeSystem/financialtaskcode") - self.assertEqual(inst.id, "fm-example6") + self.assertEqual(inst.id, "fm-example2") self.assertEqual(inst.identifier[0].system, "http:/happyvalley.com/task") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "20181012-001") - self.assertEqual(inst.identifier[1].system, "http://nationalinsurers.com/identifiers/12345") - self.assertEqual(inst.identifier[1].use, "official") - self.assertEqual(inst.identifier[1].value, "123GB5674") + self.assertEqual(inst.identifier[0].value, "20181012-005") + self.assertEqual(inst.input[0].type.coding[0].code, "include") + self.assertEqual(inst.input[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/financialtaskinputtype") + self.assertEqual(inst.input[0].valueCode, "ClaimResponse") + self.assertEqual(inst.input[1].type.coding[0].code, "period") + self.assertEqual(inst.input[1].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/financialtaskinputtype") + self.assertEqual(inst.input[1].valuePeriod.end.date, FHIRDate("2018-10-12").date) + self.assertEqual(inst.input[1].valuePeriod.end.as_json(), "2018-10-12") + self.assertEqual(inst.input[1].valuePeriod.start.date, FHIRDate("2018-10-01").date) + self.assertEqual(inst.input[1].valuePeriod.start.as_json(), "2018-10-01") self.assertEqual(inst.intent, "order") - self.assertEqual(inst.lastModified.date, FHIRDate("2018-10-04T08:25:05+10:00").date) - self.assertEqual(inst.lastModified.as_json(), "2018-10-04T08:25:05+10:00") + self.assertEqual(inst.lastModified.date, FHIRDate("2018-10-12T08:25:05+10:00").date) + self.assertEqual(inst.lastModified.as_json(), "2018-10-12T08:25:05+10:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.output[0].type.coding[0].code, "status") - self.assertEqual(inst.output[0].type.coding[0].system, "http://hl7.org/financial-taskoutputtype") - self.assertEqual(inst.output[0].valueCode, "complete") self.assertEqual(inst.priority, "stat") - self.assertEqual(inst.status, "completed") + self.assertEqual(inst.status, "requested") self.assertEqual(inst.text.status, "generated") def testTask7(self): - inst = self.instantiate_from("task-example2.json") + inst = self.instantiate_from("task-example6.json") self.assertIsNotNone(inst, "Must have instantiated a Task instance") self.implTask7(inst) @@ -260,38 +242,44 @@ def testTask7(self): self.implTask7(inst2) def implTask7(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2016-10-31T08:45:05+10:00").date) - self.assertEqual(inst.authoredOn.as_json(), "2016-10-31T08:45:05+10:00") - self.assertEqual(inst.businessStatus.text, "waiting for patient") - self.assertEqual(inst.code.text, "Specimen Collection") - self.assertEqual(inst.executionPeriod.start.date, FHIRDate("2016-10-31T08:45:05+10:00").date) - self.assertEqual(inst.executionPeriod.start.as_json(), "2016-10-31T08:45:05+10:00") + self.assertEqual(inst.authoredOn.date, FHIRDate("2016-10-31T08:25:05+10:00").date) + self.assertEqual(inst.authoredOn.as_json(), "2016-10-31T08:25:05+10:00") + self.assertEqual(inst.businessStatus.text, "test completed and posted") + self.assertEqual(inst.code.text, "Lipid Panel") + self.assertEqual(inst.description, "Create order for getting specimen, Set up inhouse testing, generate order for any sendouts and submit with specimen") + self.assertEqual(inst.executionPeriod.end.date, FHIRDate("2016-10-31T18:45:05+10:00").date) + self.assertEqual(inst.executionPeriod.end.as_json(), "2016-10-31T18:45:05+10:00") + self.assertEqual(inst.executionPeriod.start.date, FHIRDate("2016-10-31T08:25:05+10:00").date) + self.assertEqual(inst.executionPeriod.start.as_json(), "2016-10-31T08:25:05+10:00") self.assertEqual(inst.groupIdentifier.system, "http:/goodhealth.org/accession/identifiers") self.assertEqual(inst.groupIdentifier.use, "official") self.assertEqual(inst.groupIdentifier.value, "G20170201-001") - self.assertEqual(inst.id, "example2") + self.assertEqual(inst.id, "example6") self.assertEqual(inst.identifier[0].system, "http:/goodhealth.org/identifiers") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "20170201-002") - self.assertEqual(inst.intent, "filler-order") - self.assertEqual(inst.lastModified.date, FHIRDate("2016-10-31T09:45:05+10:00").date) - self.assertEqual(inst.lastModified.as_json(), "2016-10-31T09:45:05+10:00") + self.assertEqual(inst.identifier[0].value, "20170201-001") + self.assertEqual(inst.intent, "order") + self.assertEqual(inst.lastModified.date, FHIRDate("2016-10-31T18:45:05+10:00").date) + self.assertEqual(inst.lastModified.as_json(), "2016-10-31T18:45:05+10:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.output[0].type.text, "DiagnosticReport generated") + self.assertEqual(inst.output[1].type.text, "collected specimen") self.assertEqual(inst.performerType[0].coding[0].code, "performer") self.assertEqual(inst.performerType[0].coding[0].display, "Performer") self.assertEqual(inst.performerType[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/task-performer-type") self.assertEqual(inst.performerType[0].text, "Performer") self.assertEqual(inst.priority, "routine") - self.assertEqual(inst.restriction.period.end.date, FHIRDate("2016-11-01T09:45:05+10:00").date) - self.assertEqual(inst.restriction.period.end.as_json(), "2016-11-01T09:45:05+10:00") + self.assertEqual(inst.reasonCode.text, "The Task.reason should only be included if there is no Task.focus or if it differs from the reason indicated on the focus") + self.assertEqual(inst.restriction.period.end.date, FHIRDate("2016-11-02T09:45:05+10:00").date) + self.assertEqual(inst.restriction.period.end.as_json(), "2016-11-02T09:45:05+10:00") self.assertEqual(inst.restriction.repetitions, 1) - self.assertEqual(inst.status, "accepted") + self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.status, "generated") def testTask8(self): - inst = self.instantiate_from("task-example-fm-release.json") + inst = self.instantiate_from("task-example5.json") self.assertIsNotNone(inst, "Must have instantiated a Task instance") self.implTask8(inst) @@ -301,28 +289,41 @@ def testTask8(self): self.implTask8(inst2) def implTask8(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2018-10-04T08:25:05+10:00").date) - self.assertEqual(inst.authoredOn.as_json(), "2018-10-04T08:25:05+10:00") - self.assertEqual(inst.code.coding[0].code, "release") - self.assertEqual(inst.code.coding[0].system, "http://terminology.hl7.org/CodeSystem/financialtaskcode") - self.assertEqual(inst.id, "fm-example3") - self.assertEqual(inst.identifier[0].system, "http:/happyvalley.com/task") + self.assertEqual(inst.authoredOn.date, FHIRDate("2016-10-31T08:25:05+10:00").date) + self.assertEqual(inst.authoredOn.as_json(), "2016-10-31T08:25:05+10:00") + self.assertEqual(inst.businessStatus.text, "specimen received, test in progress") + self.assertEqual(inst.code.text, "Lipid Panel") + self.assertEqual(inst.description, "Create order for getting specimen, Set up inhouse testing, generate order for any sendouts and submit with specimen") + self.assertEqual(inst.executionPeriod.start.date, FHIRDate("2016-10-31T08:25:05+10:00").date) + self.assertEqual(inst.executionPeriod.start.as_json(), "2016-10-31T08:25:05+10:00") + self.assertEqual(inst.groupIdentifier.system, "http:/goodhealth.org/accession/identifiers") + self.assertEqual(inst.groupIdentifier.use, "official") + self.assertEqual(inst.groupIdentifier.value, "G20170201-001") + self.assertEqual(inst.id, "example5") + self.assertEqual(inst.identifier[0].system, "http:/goodhealth.org/identifiers") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "20181012-001") - self.assertEqual(inst.input[0].type.coding[0].code, "origresponse") - self.assertEqual(inst.input[0].type.coding[0].system, "http://hl7.org/financial-taskinputtype") + self.assertEqual(inst.identifier[0].value, "20170201-001") self.assertEqual(inst.intent, "order") - self.assertEqual(inst.lastModified.date, FHIRDate("2018-10-04T08:25:05+10:00").date) - self.assertEqual(inst.lastModified.as_json(), "2018-10-04T08:25:05+10:00") + self.assertEqual(inst.lastModified.date, FHIRDate("2016-10-31T16:45:05+10:00").date) + self.assertEqual(inst.lastModified.as_json(), "2016-10-31T16:45:05+10:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.priority, "stat") - self.assertEqual(inst.status, "requested") + self.assertEqual(inst.output[0].type.text, "collected specimen") + self.assertEqual(inst.performerType[0].coding[0].code, "performer") + self.assertEqual(inst.performerType[0].coding[0].display, "Performer") + self.assertEqual(inst.performerType[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/task-performer-type") + self.assertEqual(inst.performerType[0].text, "Performer") + self.assertEqual(inst.priority, "routine") + self.assertEqual(inst.reasonCode.text, "The Task.reason should only be included if there is no Task.focus or if it differs from the reason indicated on the focus") + self.assertEqual(inst.restriction.period.end.date, FHIRDate("2016-11-02T09:45:05+10:00").date) + self.assertEqual(inst.restriction.period.end.as_json(), "2016-11-02T09:45:05+10:00") + self.assertEqual(inst.restriction.repetitions, 1) + self.assertEqual(inst.status, "in-progress") self.assertEqual(inst.text.status, "generated") def testTask9(self): - inst = self.instantiate_from("task-example-fm-cancel.json") + inst = self.instantiate_from("task-example-fm-release.json") self.assertIsNotNone(inst, "Must have instantiated a Task instance") self.implTask9(inst) @@ -334,12 +335,14 @@ def testTask9(self): def implTask9(self, inst): self.assertEqual(inst.authoredOn.date, FHIRDate("2018-10-04T08:25:05+10:00").date) self.assertEqual(inst.authoredOn.as_json(), "2018-10-04T08:25:05+10:00") - self.assertEqual(inst.code.coding[0].code, "cancel") + self.assertEqual(inst.code.coding[0].code, "release") self.assertEqual(inst.code.coding[0].system, "http://terminology.hl7.org/CodeSystem/financialtaskcode") - self.assertEqual(inst.id, "fm-example1") + self.assertEqual(inst.id, "fm-example3") self.assertEqual(inst.identifier[0].system, "http:/happyvalley.com/task") self.assertEqual(inst.identifier[0].use, "official") self.assertEqual(inst.identifier[0].value, "20181012-001") + self.assertEqual(inst.input[0].type.coding[0].code, "origresponse") + self.assertEqual(inst.input[0].type.coding[0].system, "http://hl7.org/financial-taskinputtype") self.assertEqual(inst.intent, "order") self.assertEqual(inst.lastModified.date, FHIRDate("2018-10-04T08:25:05+10:00").date) self.assertEqual(inst.lastModified.as_json(), "2018-10-04T08:25:05+10:00") @@ -351,7 +354,7 @@ def implTask9(self, inst): self.assertEqual(inst.text.status, "generated") def testTask10(self): - inst = self.instantiate_from("task-example5.json") + inst = self.instantiate_from("task-example-fm-status.json") self.assertIsNotNone(inst, "Must have instantiated a Task instance") self.implTask10(inst) @@ -361,36 +364,21 @@ def testTask10(self): self.implTask10(inst2) def implTask10(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2016-10-31T08:25:05+10:00").date) - self.assertEqual(inst.authoredOn.as_json(), "2016-10-31T08:25:05+10:00") - self.assertEqual(inst.businessStatus.text, "specimen received, test in progress") - self.assertEqual(inst.code.text, "Lipid Panel") - self.assertEqual(inst.description, "Create order for getting specimen, Set up inhouse testing, generate order for any sendouts and submit with specimen") - self.assertEqual(inst.executionPeriod.start.date, FHIRDate("2016-10-31T08:25:05+10:00").date) - self.assertEqual(inst.executionPeriod.start.as_json(), "2016-10-31T08:25:05+10:00") - self.assertEqual(inst.groupIdentifier.system, "http:/goodhealth.org/accession/identifiers") - self.assertEqual(inst.groupIdentifier.use, "official") - self.assertEqual(inst.groupIdentifier.value, "G20170201-001") - self.assertEqual(inst.id, "example5") - self.assertEqual(inst.identifier[0].system, "http:/goodhealth.org/identifiers") + self.assertEqual(inst.authoredOn.date, FHIRDate("2018-10-04T08:25:05+10:00").date) + self.assertEqual(inst.authoredOn.as_json(), "2018-10-04T08:25:05+10:00") + self.assertEqual(inst.code.coding[0].code, "status") + self.assertEqual(inst.code.coding[0].system, "http://terminology.hl7.org/CodeSystem/financialtaskcode") + self.assertEqual(inst.id, "fm-example5") + self.assertEqual(inst.identifier[0].system, "http:/happyvalley.com/task") self.assertEqual(inst.identifier[0].use, "official") - self.assertEqual(inst.identifier[0].value, "20170201-001") + self.assertEqual(inst.identifier[0].value, "20181012-001") self.assertEqual(inst.intent, "order") - self.assertEqual(inst.lastModified.date, FHIRDate("2016-10-31T16:45:05+10:00").date) - self.assertEqual(inst.lastModified.as_json(), "2016-10-31T16:45:05+10:00") + self.assertEqual(inst.lastModified.date, FHIRDate("2018-10-04T08:25:05+10:00").date) + self.assertEqual(inst.lastModified.as_json(), "2018-10-04T08:25:05+10:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.output[0].type.text, "collected specimen") - self.assertEqual(inst.performerType[0].coding[0].code, "performer") - self.assertEqual(inst.performerType[0].coding[0].display, "Performer") - self.assertEqual(inst.performerType[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/task-performer-type") - self.assertEqual(inst.performerType[0].text, "Performer") - self.assertEqual(inst.priority, "routine") - self.assertEqual(inst.reasonCode.text, "The Task.reason should only be included if there is no Task.focus or if it differs from the reason indicated on the focus") - self.assertEqual(inst.restriction.period.end.date, FHIRDate("2016-11-02T09:45:05+10:00").date) - self.assertEqual(inst.restriction.period.end.as_json(), "2016-11-02T09:45:05+10:00") - self.assertEqual(inst.restriction.repetitions, 1) - self.assertEqual(inst.status, "in-progress") + self.assertEqual(inst.priority, "stat") + self.assertEqual(inst.status, "requested") self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/models/terminologycapabilities.py b/fhirclient/models/terminologycapabilities.py index e18e3dc8a..a60058f95 100644 --- a/fhirclient/models/terminologycapabilities.py +++ b/fhirclient/models/terminologycapabilities.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/terminologycapabilities_tests.py b/fhirclient/models/terminologycapabilities_tests.py index c4558073f..8da96e516 100644 --- a/fhirclient/models/terminologycapabilities_tests.py +++ b/fhirclient/models/terminologycapabilities_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/testreport.py b/fhirclient/models/testreport.py index 14ea7085c..bf3723fee 100644 --- a/fhirclient/models/testreport.py +++ b/fhirclient/models/testreport.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/TestReport) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/TestReport) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/testreport_tests.py b/fhirclient/models/testreport_tests.py index 9108e005e..0bb926394 100644 --- a/fhirclient/models/testreport_tests.py +++ b/fhirclient/models/testreport_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/testscript.py b/fhirclient/models/testscript.py index f85d0ad7f..73cc28607 100644 --- a/fhirclient/models/testscript.py +++ b/fhirclient/models/testscript.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/TestScript) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/TestScript) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/testscript_tests.py b/fhirclient/models/testscript_tests.py index 5f1f74adf..664f0f36b 100644 --- a/fhirclient/models/testscript_tests.py +++ b/fhirclient/models/testscript_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return testscript.TestScript(js) def testTestScript1(self): - inst = self.instantiate_from("testscript-example-multisystem.json") + inst = self.instantiate_from("testscript-example-search.json") self.assertIsNotNone(inst, "Must have instantiated a TestScript instance") self.implTestScript1(inst) @@ -39,118 +39,130 @@ def implTestScript1(self, inst): self.assertEqual(inst.copyright, "© HL7.org 2011+") self.assertEqual(inst.date.date, FHIRDate("2017-01-18").date) self.assertEqual(inst.date.as_json(), "2017-01-18") - self.assertEqual(inst.destination[0].index, 1) - self.assertEqual(inst.destination[0].profile.code, "FHIR-Server") - self.assertEqual(inst.destination[1].index, 2) - self.assertEqual(inst.destination[1].profile.code, "FHIR-Server") + self.assertEqual(inst.description, "TestScript example resource with simple Patient search test. The read tests will utilize user defined dynamic variables that will hold the Patient search parameter values.") self.assertTrue(inst.experimental) - self.assertEqual(inst.id, "testscript-example-multisystem") + self.assertFalse(inst.fixture[0].autocreate) + self.assertFalse(inst.fixture[0].autodelete) + self.assertEqual(inst.fixture[0].id, "fixture-patient-create") + self.assertEqual(inst.id, "testscript-example-search") self.assertEqual(inst.identifier.system, "urn:ietf:rfc:3986") - self.assertEqual(inst.identifier.value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9878") + self.assertEqual(inst.identifier.value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9881") self.assertEqual(inst.jurisdiction[0].coding[0].code, "US") self.assertEqual(inst.jurisdiction[0].coding[0].display, "United States of America (the)") self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") self.assertEqual(inst.metadata.capability[0].capabilities, "CapabilityStatement/example") - self.assertEqual(inst.metadata.capability[0].description, "Patient Read Operation") - self.assertEqual(inst.metadata.capability[0].destination, 1) - self.assertEqual(inst.metadata.capability[0].link[0], "http://hl7.org/fhir/http.html#read") - self.assertEqual(inst.metadata.capability[0].origin[0], 1) + self.assertEqual(inst.metadata.capability[0].description, "Patient Search Operation") + self.assertEqual(inst.metadata.capability[0].link[0], "http://hl7.org/fhir/http.html#search") self.assertTrue(inst.metadata.capability[0].required) self.assertFalse(inst.metadata.capability[0].validated) - self.assertEqual(inst.metadata.capability[1].capabilities, "CapabilityStatement/example") - self.assertEqual(inst.metadata.capability[1].description, "Patient Read Operation") - self.assertEqual(inst.metadata.capability[1].destination, 2) - self.assertEqual(inst.metadata.capability[1].link[0], "http://hl7.org/fhir/http.html#read") - self.assertEqual(inst.metadata.capability[1].origin[0], 1) - self.assertTrue(inst.metadata.capability[1].required) - self.assertFalse(inst.metadata.capability[1].validated) self.assertEqual(inst.metadata.link[0].description, "Demographics and other administrative information about an individual or animal receiving care or other health-related services.") self.assertEqual(inst.metadata.link[0].url, "http://hl7.org/fhir/patient.html") - self.assertEqual(inst.name, "testscript-example-multisystem") - self.assertEqual(inst.origin[0].index, 1) - self.assertEqual(inst.origin[0].profile.code, "FHIR-Client") + self.assertEqual(inst.name, "TestScript Example Search") self.assertEqual(inst.publisher, "HL7") - self.assertEqual(inst.purpose, "Patient Read Operation") + self.assertEqual(inst.purpose, "Patient Search Operation") + self.assertEqual(inst.setup.action[0].operation.accept, "xml") + self.assertEqual(inst.setup.action[0].operation.description, "Test simple search to verify server support.") + self.assertTrue(inst.setup.action[0].operation.encodeRequestUrl) + self.assertEqual(inst.setup.action[0].operation.params, "?family=DONTEXPECTAMATCH&given=DONTEXPECTAMATCH") + self.assertEqual(inst.setup.action[0].operation.resource, "Patient") + self.assertEqual(inst.setup.action[0].operation.type.code, "search") + self.assertEqual(inst.setup.action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") + self.assertEqual(inst.setup.action[1].assert_fhir.description, "Confirm that the request url contains the family search parameter.") + self.assertEqual(inst.setup.action[1].assert_fhir.direction, "request") + self.assertEqual(inst.setup.action[1].assert_fhir.operator, "contains") + self.assertEqual(inst.setup.action[1].assert_fhir.requestURL, "family") + self.assertFalse(inst.setup.action[1].assert_fhir.warningOnly) + self.assertEqual(inst.setup.action[2].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") + self.assertEqual(inst.setup.action[2].assert_fhir.direction, "response") + self.assertEqual(inst.setup.action[2].assert_fhir.responseCode, "200") + self.assertFalse(inst.setup.action[2].assert_fhir.warningOnly) + self.assertEqual(inst.setup.action[3].assert_fhir.description, "Confirm that the returned resource type is Bundle.") + self.assertEqual(inst.setup.action[3].assert_fhir.resource, "Bundle") + self.assertFalse(inst.setup.action[3].assert_fhir.warningOnly) + self.assertEqual(inst.setup.action[4].assert_fhir.description, "Confirm that the returned Bundle correctly defines the navigation links.") + self.assertTrue(inst.setup.action[4].assert_fhir.navigationLinks) + self.assertFalse(inst.setup.action[4].assert_fhir.warningOnly) self.assertEqual(inst.status, "draft") self.assertEqual(inst.test[0].action[0].operation.accept, "xml") self.assertEqual(inst.test[0].action[0].operation.contentType, "xml") - self.assertEqual(inst.test[0].action[0].operation.description, "Read a Patient from the first destination test system and perform basic validation.") - self.assertEqual(inst.test[0].action[0].operation.destination, 1) + self.assertEqual(inst.test[0].action[0].operation.description, "Create a Patient resource and capture the returned HTTP Header Location.") self.assertTrue(inst.test[0].action[0].operation.encodeRequestUrl) - self.assertEqual(inst.test[0].action[0].operation.origin, 1) - self.assertEqual(inst.test[0].action[0].operation.params, "/${Dest1PatientResourceId}") - self.assertEqual(inst.test[0].action[0].operation.requestId, "request-read-patient-01") self.assertEqual(inst.test[0].action[0].operation.resource, "Patient") - self.assertEqual(inst.test[0].action[0].operation.type.code, "read") + self.assertEqual(inst.test[0].action[0].operation.responseId, "PatientCreateResponse") + self.assertEqual(inst.test[0].action[0].operation.sourceId, "fixture-patient-create") + self.assertEqual(inst.test[0].action[0].operation.type.code, "create") self.assertEqual(inst.test[0].action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") - self.assertEqual(inst.test[0].action[1].assert_fhir.description, "Confirm that the request method GET was sent by the client system under test.") - self.assertEqual(inst.test[0].action[1].assert_fhir.requestMethod, "get") + self.assertEqual(inst.test[0].action[1].assert_fhir.description, "Confirm that the returned HTTP status is 201(Created).") + self.assertEqual(inst.test[0].action[1].assert_fhir.response, "created") self.assertFalse(inst.test[0].action[1].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[2].assert_fhir.description, "Confirm that the client requested an Accept of xml.") - self.assertEqual(inst.test[0].action[2].assert_fhir.direction, "request") - self.assertEqual(inst.test[0].action[2].assert_fhir.headerField, "Accept") - self.assertEqual(inst.test[0].action[2].assert_fhir.operator, "contains") - self.assertEqual(inst.test[0].action[2].assert_fhir.value, "xml") + self.assertEqual(inst.test[0].action[2].assert_fhir.description, "Confirm that the returned HTTP Header Location is present.") + self.assertEqual(inst.test[0].action[2].assert_fhir.direction, "response") + self.assertEqual(inst.test[0].action[2].assert_fhir.headerField, "Location") + self.assertEqual(inst.test[0].action[2].assert_fhir.operator, "notEmpty") self.assertFalse(inst.test[0].action[2].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[3].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") - self.assertEqual(inst.test[0].action[3].assert_fhir.direction, "response") - self.assertEqual(inst.test[0].action[3].assert_fhir.response, "okay") - self.assertFalse(inst.test[0].action[3].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[4].assert_fhir.contentType, "xml") - self.assertEqual(inst.test[0].action[4].assert_fhir.description, "Confirm that the returned format is XML.") - self.assertEqual(inst.test[0].action[4].assert_fhir.direction, "response") + self.assertEqual(inst.test[0].action[3].operation.accept, "xml") + self.assertEqual(inst.test[0].action[3].operation.description, "Read the created Patient using the captured Location URL value.") + self.assertTrue(inst.test[0].action[3].operation.encodeRequestUrl) + self.assertEqual(inst.test[0].action[3].operation.type.code, "read") + self.assertEqual(inst.test[0].action[3].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") + self.assertEqual(inst.test[0].action[3].operation.url, "${PatientCreateLocation}") + self.assertEqual(inst.test[0].action[4].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") + self.assertEqual(inst.test[0].action[4].assert_fhir.response, "okay") self.assertFalse(inst.test[0].action[4].assert_fhir.warningOnly) self.assertEqual(inst.test[0].action[5].assert_fhir.description, "Confirm that the returned resource type is Patient.") - self.assertEqual(inst.test[0].action[5].assert_fhir.direction, "response") self.assertEqual(inst.test[0].action[5].assert_fhir.resource, "Patient") self.assertFalse(inst.test[0].action[5].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].description, "Read a Patient from the first destination test system using the user defined dynamic variable ${Dest1PatientResourceId}. Perform basic validation.") - self.assertEqual(inst.test[0].id, "01-ReadPatient-Destination1") - self.assertEqual(inst.test[0].name, "ReadPatient-Destination1") + self.assertEqual(inst.test[0].description, "Create a Patient resource and capture the returned HTTP Header Location. Then search for (read) that Patient using the Location URL value and validate the response.") + self.assertEqual(inst.test[0].id, "01-PatientCreateSearch") + self.assertEqual(inst.test[0].name, "Patient Create Search") self.assertEqual(inst.test[1].action[0].operation.accept, "xml") - self.assertEqual(inst.test[1].action[0].operation.contentType, "xml") - self.assertEqual(inst.test[1].action[0].operation.description, "Read a Patient from the second destination test system and perform basic validation.") - self.assertEqual(inst.test[1].action[0].operation.destination, 2) + self.assertEqual(inst.test[1].action[0].operation.description, "Search for Patient resources on the destination test system.") self.assertTrue(inst.test[1].action[0].operation.encodeRequestUrl) - self.assertEqual(inst.test[1].action[0].operation.origin, 1) - self.assertEqual(inst.test[1].action[0].operation.params, "/${Dest2PatientResourceId}") - self.assertEqual(inst.test[1].action[0].operation.requestHeader[0].field, "Accept-Charset") - self.assertEqual(inst.test[1].action[0].operation.requestHeader[0].value, "utf-8") + self.assertEqual(inst.test[1].action[0].operation.params, "?family=${PatientSearchFamilyName}&given=${PatientSearchGivenName}") self.assertEqual(inst.test[1].action[0].operation.resource, "Patient") - self.assertEqual(inst.test[1].action[0].operation.type.code, "read") + self.assertEqual(inst.test[1].action[0].operation.type.code, "search") self.assertEqual(inst.test[1].action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") - self.assertEqual(inst.test[1].action[1].assert_fhir.description, "Confirm that the client requested an Accept of xml.") - self.assertEqual(inst.test[1].action[1].assert_fhir.direction, "request") - self.assertEqual(inst.test[1].action[1].assert_fhir.headerField, "Accept") - self.assertEqual(inst.test[1].action[1].assert_fhir.operator, "contains") - self.assertEqual(inst.test[1].action[1].assert_fhir.value, "xml") + self.assertEqual(inst.test[1].action[1].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") + self.assertEqual(inst.test[1].action[1].assert_fhir.response, "okay") self.assertFalse(inst.test[1].action[1].assert_fhir.warningOnly) - self.assertEqual(inst.test[1].action[2].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") - self.assertEqual(inst.test[1].action[2].assert_fhir.direction, "response") - self.assertEqual(inst.test[1].action[2].assert_fhir.response, "okay") + self.assertEqual(inst.test[1].action[2].assert_fhir.contentType, "xml") + self.assertEqual(inst.test[1].action[2].assert_fhir.description, "Confirm that the returned format is XML.") self.assertFalse(inst.test[1].action[2].assert_fhir.warningOnly) - self.assertEqual(inst.test[1].action[3].assert_fhir.contentType, "xml") - self.assertEqual(inst.test[1].action[3].assert_fhir.description, "Confirm that the returned format is XML.") - self.assertEqual(inst.test[1].action[3].assert_fhir.direction, "response") + self.assertEqual(inst.test[1].action[3].assert_fhir.description, "Confirm that the returned resource type is Bundle.") + self.assertEqual(inst.test[1].action[3].assert_fhir.resource, "Bundle") self.assertFalse(inst.test[1].action[3].assert_fhir.warningOnly) - self.assertEqual(inst.test[1].action[4].assert_fhir.description, "Confirm that the returned resource type is Patient.") - self.assertEqual(inst.test[1].action[4].assert_fhir.direction, "response") - self.assertEqual(inst.test[1].action[4].assert_fhir.resource, "Patient") + self.assertEqual(inst.test[1].action[4].assert_fhir.description, "Confirm that the returned Bundle conforms to the base FHIR specification.") + self.assertEqual(inst.test[1].action[4].assert_fhir.validateProfileId, "bundle-profile") self.assertFalse(inst.test[1].action[4].assert_fhir.warningOnly) - self.assertEqual(inst.test[1].description, "Read a Patient from the second destination test system using the user defined dynamic variable ${Dest2PatientResourceId}. Perform basic validation.") - self.assertEqual(inst.test[1].id, "02-ReadPatient-Destination2") - self.assertEqual(inst.test[1].name, "ReadPatient-Destination2") + self.assertEqual(inst.test[1].action[5].assert_fhir.description, "Confirm that the returned Bundle type equals 'searchset'.") + self.assertEqual(inst.test[1].action[5].assert_fhir.operator, "equals") + self.assertEqual(inst.test[1].action[5].assert_fhir.path, "fhir:Bundle/fhir:type/@value") + self.assertEqual(inst.test[1].action[5].assert_fhir.value, "searchset") + self.assertFalse(inst.test[1].action[5].assert_fhir.warningOnly) + self.assertEqual(inst.test[1].action[6].assert_fhir.description, "Confirm that the returned Bundle total is greater than or equal to the number of returned entries.") + self.assertEqual(inst.test[1].action[6].assert_fhir.expression, "Bundle.total.toInteger() >= entry.count()") + self.assertFalse(inst.test[1].action[6].assert_fhir.warningOnly) + self.assertEqual(inst.test[1].description, "Search for Patient resources using the user defined dynamic variables ${PatientSearchFamilyName} and ${PatientSearchGivenName} and validate response.") + self.assertEqual(inst.test[1].id, "02-PatientSearchDynamic") + self.assertEqual(inst.test[1].name, "Patient Search Dynamic") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.title, "Multisystem Test Script") - self.assertEqual(inst.url, "http://hl7.org/fhir/TestScript/testscript-example-multisystem") - self.assertEqual(inst.variable[0].defaultValue, "example") - self.assertEqual(inst.variable[0].name, "Dest1PatientResourceId") - self.assertEqual(inst.variable[1].defaultValue, "example") - self.assertEqual(inst.variable[1].name, "Dest2PatientResourceId") + self.assertEqual(inst.url, "http://hl7.org/fhir/TestScript/testscript-example-search") + self.assertEqual(inst.variable[0].headerField, "Location") + self.assertEqual(inst.variable[0].name, "PatientCreateLocation") + self.assertEqual(inst.variable[0].sourceId, "PatientCreateResponse") + self.assertEqual(inst.variable[1].description, "Enter patient search criteria for a known family name on the target system") + self.assertEqual(inst.variable[1].hint, "[Family name]") + self.assertEqual(inst.variable[1].name, "PatientSearchFamilyName") + self.assertEqual(inst.variable[2].description, "Enter patient search criteria for a known given name on the target system") + self.assertEqual(inst.variable[2].hint, "[Given name]") + self.assertEqual(inst.variable[2].name, "PatientSearchGivenName") + self.assertEqual(inst.variable[3].description, "Evaluate the returned Patient searchset Bundle.total value") + self.assertEqual(inst.variable[3].expression, "Bundle.total.toInteger()") + self.assertEqual(inst.variable[3].name, "PatientSearchBundleTotal") self.assertEqual(inst.version, "1.0") def testTestScript2(self): - inst = self.instantiate_from("testscript-example-history.json") + inst = self.instantiate_from("testscript-example.json") self.assertIsNotNone(inst, "Must have instantiated a TestScript instance") self.implTestScript2(inst) @@ -167,31 +179,32 @@ def implTestScript2(self, inst): self.assertEqual(inst.copyright, "© HL7.org 2011+") self.assertEqual(inst.date.date, FHIRDate("2017-01-18").date) self.assertEqual(inst.date.as_json(), "2017-01-18") + self.assertEqual(inst.description, "TestScript example resource with setup to delete if present and create a new instance of a Patient; and single test definition to read the created Patient with various asserts.") self.assertTrue(inst.experimental) self.assertFalse(inst.fixture[0].autocreate) self.assertFalse(inst.fixture[0].autodelete) self.assertEqual(inst.fixture[0].id, "fixture-patient-create") self.assertFalse(inst.fixture[1].autocreate) self.assertFalse(inst.fixture[1].autodelete) - self.assertEqual(inst.fixture[1].id, "fixture-patient-update") - self.assertEqual(inst.id, "testscript-example-history") + self.assertEqual(inst.fixture[1].id, "fixture-patient-minimum") + self.assertEqual(inst.id, "testscript-example") self.assertEqual(inst.identifier.system, "urn:ietf:rfc:3986") - self.assertEqual(inst.identifier.value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9877") + self.assertEqual(inst.identifier.value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9876") self.assertEqual(inst.jurisdiction[0].coding[0].code, "US") self.assertEqual(inst.jurisdiction[0].coding[0].display, "United States of America (the)") self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") self.assertEqual(inst.metadata.capability[0].capabilities, "CapabilityStatement/example") - self.assertEqual(inst.metadata.capability[0].description, "Patient Update, Delete and History (Instance) Operations") - self.assertEqual(inst.metadata.capability[0].link[0], "http://hl7.org/fhir/http.html#update") - self.assertEqual(inst.metadata.capability[0].link[1], "http://hl7.org/fhir/http.html#delete") - self.assertEqual(inst.metadata.capability[0].link[2], "http://hl7.org/fhir/http.html#history") + self.assertEqual(inst.metadata.capability[0].description, "Patient Update, Read and Delete Operations") + self.assertEqual(inst.metadata.capability[0].link[0], "http://hl7.org/fhir/http.html#delete") + self.assertEqual(inst.metadata.capability[0].link[1], "http://hl7.org/fhir/http.html#read") + self.assertEqual(inst.metadata.capability[0].link[2], "http://hl7.org/fhir/http.html#update") self.assertTrue(inst.metadata.capability[0].required) self.assertFalse(inst.metadata.capability[0].validated) self.assertEqual(inst.metadata.link[0].description, "Demographics and other administrative information about an individual or animal receiving care or other health-related services.") self.assertEqual(inst.metadata.link[0].url, "http://hl7.org/fhir/patient.html") - self.assertEqual(inst.name, "TestScript Example History") + self.assertEqual(inst.name, "TestScript Example") self.assertEqual(inst.publisher, "HL7") - self.assertEqual(inst.purpose, "Patient (Conditional) Create, Update, Delete and History (Instance) Operations") + self.assertEqual(inst.purpose, "Patient Conditional Create (Update), Read and Delete Operations") self.assertEqual(inst.setup.action[0].operation.accept, "json") self.assertEqual(inst.setup.action[0].operation.description, "Execute a delete operation to insure the patient does not exist on the server.") self.assertTrue(inst.setup.action[0].operation.encodeRequestUrl) @@ -219,62 +232,98 @@ def implTestScript2(self, inst): self.assertEqual(inst.setup.action[3].assert_fhir.direction, "response") self.assertEqual(inst.setup.action[3].assert_fhir.responseCode, "201") self.assertFalse(inst.setup.action[3].assert_fhir.warningOnly) - self.assertEqual(inst.setup.action[4].operation.accept, "json") - self.assertEqual(inst.setup.action[4].operation.contentType, "json") - self.assertEqual(inst.setup.action[4].operation.description, "Update patient resource on test server using the contents of fixture-patient-update") + self.assertEqual(inst.setup.action[4].operation.description, "Read the created patient resource on the test server using the id from fixture-patient-create. Verify contents.") self.assertTrue(inst.setup.action[4].operation.encodeRequestUrl) - self.assertEqual(inst.setup.action[4].operation.label, "SetupUpdatePatient") - self.assertEqual(inst.setup.action[4].operation.params, "/${createResourceId}") self.assertEqual(inst.setup.action[4].operation.resource, "Patient") - self.assertEqual(inst.setup.action[4].operation.sourceId, "fixture-patient-update") - self.assertEqual(inst.setup.action[4].operation.type.code, "update") + self.assertEqual(inst.setup.action[4].operation.targetId, "fixture-patient-create") + self.assertEqual(inst.setup.action[4].operation.type.code, "read") self.assertEqual(inst.setup.action[4].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") self.assertEqual(inst.setup.action[5].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") self.assertEqual(inst.setup.action[5].assert_fhir.direction, "response") - self.assertEqual(inst.setup.action[5].assert_fhir.responseCode, "200") + self.assertEqual(inst.setup.action[5].assert_fhir.response, "okay") self.assertFalse(inst.setup.action[5].assert_fhir.warningOnly) + self.assertEqual(inst.setup.action[6].assert_fhir.compareToSourceExpression, "Patient.name.first().family") + self.assertEqual(inst.setup.action[6].assert_fhir.compareToSourceId, "fixture-patient-create") + self.assertEqual(inst.setup.action[6].assert_fhir.description, "Confirm that the returned Patient contains the expected family name 'Chalmers'. Uses explicit compareToSourceId reference to fixture-patient-create used to create the Patient.") + self.assertEqual(inst.setup.action[6].assert_fhir.operator, "equals") + self.assertFalse(inst.setup.action[6].assert_fhir.warningOnly) self.assertEqual(inst.status, "draft") - self.assertEqual(inst.test[0].action[0].operation.accept, "json") - self.assertEqual(inst.test[0].action[0].operation.contentType, "json") - self.assertEqual(inst.test[0].action[0].operation.description, "Get the Patient history on the test server using the id from fixture-patient-create.") - self.assertTrue(inst.test[0].action[0].operation.encodeRequestUrl) + self.assertEqual(inst.teardown.action[0].operation.description, "Delete the patient resource on the test server using the id from fixture-patient-create.") + self.assertTrue(inst.teardown.action[0].operation.encodeRequestUrl) + self.assertEqual(inst.teardown.action[0].operation.resource, "Patient") + self.assertEqual(inst.teardown.action[0].operation.targetId, "fixture-patient-create") + self.assertEqual(inst.teardown.action[0].operation.type.code, "delete") + self.assertEqual(inst.teardown.action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") + self.assertEqual(inst.test[0].action[0].operation.description, "Read the patient resource on the test server using the id from fixture-patient-create. Prevent URL encoding of the request.") + self.assertFalse(inst.test[0].action[0].operation.encodeRequestUrl) self.assertEqual(inst.test[0].action[0].operation.resource, "Patient") + self.assertEqual(inst.test[0].action[0].operation.responseId, "fixture-patient-read") self.assertEqual(inst.test[0].action[0].operation.targetId, "fixture-patient-create") - self.assertEqual(inst.test[0].action[0].operation.type.code, "history") + self.assertEqual(inst.test[0].action[0].operation.type.code, "read") self.assertEqual(inst.test[0].action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") self.assertEqual(inst.test[0].action[1].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") self.assertEqual(inst.test[0].action[1].assert_fhir.direction, "response") + self.assertEqual(inst.test[0].action[1].assert_fhir.label, "01-ReadPatientOK") self.assertEqual(inst.test[0].action[1].assert_fhir.response, "okay") self.assertFalse(inst.test[0].action[1].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[2].assert_fhir.description, "Confirm that the returned resource type is Bundle.") - self.assertEqual(inst.test[0].action[2].assert_fhir.resource, "Bundle") - self.assertFalse(inst.test[0].action[2].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[3].assert_fhir.description, "Confirm that the returned Bundle conforms to the base FHIR specification.") - self.assertEqual(inst.test[0].action[3].assert_fhir.validateProfileId, "bundle-profile") + self.assertEqual(inst.test[0].action[2].assert_fhir.description, "Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server might not support versioning.") + self.assertEqual(inst.test[0].action[2].assert_fhir.direction, "response") + self.assertEqual(inst.test[0].action[2].assert_fhir.headerField, "Last-Modified") + self.assertEqual(inst.test[0].action[2].assert_fhir.operator, "notEmpty") + self.assertTrue(inst.test[0].action[2].assert_fhir.warningOnly) + self.assertEqual(inst.test[0].action[3].assert_fhir.description, "Confirm that the returned resource type is Patient.") + self.assertEqual(inst.test[0].action[3].assert_fhir.resource, "Patient") self.assertFalse(inst.test[0].action[3].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[4].assert_fhir.description, "Confirm that the returned Bundle type equals 'history'.") - self.assertEqual(inst.test[0].action[4].assert_fhir.operator, "equals") - self.assertEqual(inst.test[0].action[4].assert_fhir.path, "fhir:Bundle/fhir:type/@value") - self.assertEqual(inst.test[0].action[4].assert_fhir.value, "history") + self.assertEqual(inst.test[0].action[4].assert_fhir.description, "Confirm that the returned Patient conforms to the base FHIR specification.") + self.assertEqual(inst.test[0].action[4].assert_fhir.validateProfileId, "patient-profile") self.assertFalse(inst.test[0].action[4].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].description, "Get the history for a known Patient and validate response.") - self.assertEqual(inst.test[0].id, "01-HistoryPatient") - self.assertEqual(inst.test[0].name, "History Patient") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.url, "http://hl7.org/fhir/TestScript/testscript-example-history") - self.assertEqual(inst.variable[0].name, "createResourceId") - self.assertEqual(inst.variable[0].path, "Patient/id") - self.assertEqual(inst.variable[0].sourceId, "fixture-patient-create") - self.assertEqual(inst.version, "1.0") - - def testTestScript3(self): - inst = self.instantiate_from("testscript-example-update.json") - self.assertIsNotNone(inst, "Must have instantiated a TestScript instance") - self.implTestScript3(inst) - - js = inst.as_json() - self.assertEqual("TestScript", js["resourceType"]) - inst2 = testscript.TestScript(js) + self.assertEqual(inst.test[0].action[5].assert_fhir.description, "Confirm that the returned Patient contains the expected family name 'Chalmers'. Uses explicit sourceId reference to read responseId fixture.") + self.assertEqual(inst.test[0].action[5].assert_fhir.operator, "equals") + self.assertEqual(inst.test[0].action[5].assert_fhir.path, "fhir:Patient/fhir:name/fhir:family/@value") + self.assertEqual(inst.test[0].action[5].assert_fhir.sourceId, "fixture-patient-read") + self.assertEqual(inst.test[0].action[5].assert_fhir.value, "Chalmers") + self.assertFalse(inst.test[0].action[5].assert_fhir.warningOnly) + self.assertEqual(inst.test[0].action[6].assert_fhir.description, "Confirm that the returned Patient contains the expected given name 'Peter'. Uses explicit sourceId reference to read responseId fixture.") + self.assertEqual(inst.test[0].action[6].assert_fhir.operator, "equals") + self.assertEqual(inst.test[0].action[6].assert_fhir.path, "fhir:Patient/fhir:name/fhir:given/@value") + self.assertEqual(inst.test[0].action[6].assert_fhir.sourceId, "fixture-patient-read") + self.assertEqual(inst.test[0].action[6].assert_fhir.value, "Peter") + self.assertFalse(inst.test[0].action[6].assert_fhir.warningOnly) + self.assertEqual(inst.test[0].action[7].assert_fhir.compareToSourceId, "fixture-patient-create") + self.assertEqual(inst.test[0].action[7].assert_fhir.compareToSourcePath, "fhir:Patient/fhir:name/fhir:family/@value") + self.assertEqual(inst.test[0].action[7].assert_fhir.operator, "equals") + self.assertEqual(inst.test[0].action[7].assert_fhir.path, "fhir:Patient/fhir:name/fhir:family/@value") + self.assertFalse(inst.test[0].action[7].assert_fhir.warningOnly) + self.assertEqual(inst.test[0].action[8].assert_fhir.compareToSourceId, "fixture-patient-create") + self.assertEqual(inst.test[0].action[8].assert_fhir.compareToSourcePath, "fhir:Patient/fhir:name/fhir:given/@value") + self.assertEqual(inst.test[0].action[8].assert_fhir.path, "fhir:Patient/fhir:name/fhir:given/@value") + self.assertEqual(inst.test[0].action[8].assert_fhir.sourceId, "fixture-patient-read") + self.assertFalse(inst.test[0].action[8].assert_fhir.warningOnly) + self.assertEqual(inst.test[0].action[9].assert_fhir.description, "Confirm that the returned resource contains the expected retained elements and values. Warning only to provide users with reviewable results.") + self.assertEqual(inst.test[0].action[9].assert_fhir.minimumId, "fixture-patient-minimum") + self.assertTrue(inst.test[0].action[9].assert_fhir.warningOnly) + self.assertEqual(inst.test[0].description, "Read a Patient and validate response.") + self.assertEqual(inst.test[0].id, "01-ReadPatient") + self.assertEqual(inst.test[0].name, "Read Patient") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.url, "http://hl7.org/fhir/TestScript/testscript-example") + self.assertEqual(inst.useContext[0].code.code, "focus") + self.assertEqual(inst.useContext[0].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") + self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].code, "positive") + self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].system, "http://terminology.hl7.org/CodeSystem/variant-state") + self.assertEqual(inst.variable[0].name, "createResourceId") + self.assertEqual(inst.variable[0].path, "Patient/id") + self.assertEqual(inst.variable[0].sourceId, "fixture-patient-create") + self.assertEqual(inst.version, "1.0") + + def testTestScript3(self): + inst = self.instantiate_from("testscript-example-readtest.json") + self.assertIsNotNone(inst, "Must have instantiated a TestScript instance") + self.implTestScript3(inst) + + js = inst.as_json() + self.assertEqual("TestScript", js["resourceType"]) + inst2 = testscript.TestScript(js) self.implTestScript3(inst2) def implTestScript3(self, inst): @@ -285,68 +334,31 @@ def implTestScript3(self, inst): self.assertEqual(inst.copyright, "© HL7.org 2011+") self.assertEqual(inst.date.date, FHIRDate("2017-01-18").date) self.assertEqual(inst.date.as_json(), "2017-01-18") - self.assertEqual(inst.description, "TestScript example resource with setup to delete if present and create a new instance of a Patient; and single test definition to update that Patient with various asserts.") + self.assertEqual(inst.description, "TestScript example resource with ported Sprinkler basic read tests R001, R002, R003, R004. The read tests will utilize user defined dynamic variables that will hold the Patient resource id values.") self.assertTrue(inst.experimental) - self.assertFalse(inst.fixture[0].autocreate) - self.assertFalse(inst.fixture[0].autodelete) - self.assertEqual(inst.fixture[0].id, "fixture-patient-create") - self.assertFalse(inst.fixture[1].autocreate) - self.assertFalse(inst.fixture[1].autodelete) - self.assertEqual(inst.fixture[1].id, "fixture-patient-update") - self.assertEqual(inst.id, "testscript-example-update") + self.assertEqual(inst.id, "testscript-example-readtest") self.assertEqual(inst.identifier.system, "urn:ietf:rfc:3986") - self.assertEqual(inst.identifier.value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9882") + self.assertEqual(inst.identifier.value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9879") self.assertEqual(inst.jurisdiction[0].coding[0].code, "US") self.assertEqual(inst.jurisdiction[0].coding[0].display, "United States of America (the)") self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") self.assertEqual(inst.metadata.capability[0].capabilities, "CapabilityStatement/example") - self.assertEqual(inst.metadata.capability[0].description, "Patient Update and Delete Operations") - self.assertEqual(inst.metadata.capability[0].link[0], "http://hl7.org/fhir/http.html#update") - self.assertEqual(inst.metadata.capability[0].link[1], "http://hl7.org/fhir/http.html#delete") + self.assertEqual(inst.metadata.capability[0].description, "Patient Read Operation") + self.assertEqual(inst.metadata.capability[0].link[0], "http://hl7.org/fhir/http.html#read") self.assertTrue(inst.metadata.capability[0].required) self.assertFalse(inst.metadata.capability[0].validated) self.assertEqual(inst.metadata.link[0].description, "Demographics and other administrative information about an individual or animal receiving care or other health-related services.") self.assertEqual(inst.metadata.link[0].url, "http://hl7.org/fhir/patient.html") - self.assertEqual(inst.name, "TestScript Example Update") + self.assertEqual(inst.name, "TestScript Example Read Test") self.assertEqual(inst.publisher, "HL7") - self.assertEqual(inst.purpose, "Patient (Conditional) Create, Update, Delete Operations") - self.assertEqual(inst.setup.action[0].operation.accept, "xml") - self.assertEqual(inst.setup.action[0].operation.description, "Execute a delete operation to insure the patient does not exist on the server.") - self.assertTrue(inst.setup.action[0].operation.encodeRequestUrl) - self.assertEqual(inst.setup.action[0].operation.label, "SetupDeletePatient") - self.assertEqual(inst.setup.action[0].operation.params, "/${createResourceId}") - self.assertEqual(inst.setup.action[0].operation.resource, "Patient") - self.assertEqual(inst.setup.action[0].operation.type.code, "delete") - self.assertEqual(inst.setup.action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") - self.assertEqual(inst.setup.action[1].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK) or 204(No Content).") - self.assertEqual(inst.setup.action[1].assert_fhir.direction, "response") - self.assertEqual(inst.setup.action[1].assert_fhir.operator, "in") - self.assertEqual(inst.setup.action[1].assert_fhir.responseCode, "200,204") - self.assertFalse(inst.setup.action[1].assert_fhir.warningOnly) - self.assertEqual(inst.setup.action[2].operation.accept, "xml") - self.assertEqual(inst.setup.action[2].operation.contentType, "xml") - self.assertEqual(inst.setup.action[2].operation.description, "Create patient resource on test server using the contents of fixture-patient-create") - self.assertTrue(inst.setup.action[2].operation.encodeRequestUrl) - self.assertEqual(inst.setup.action[2].operation.label, "SetupCreatePatient") - self.assertEqual(inst.setup.action[2].operation.params, "/${createResourceId}") - self.assertEqual(inst.setup.action[2].operation.resource, "Patient") - self.assertEqual(inst.setup.action[2].operation.sourceId, "fixture-patient-create") - self.assertEqual(inst.setup.action[2].operation.type.code, "update") - self.assertEqual(inst.setup.action[2].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") - self.assertEqual(inst.setup.action[3].assert_fhir.description, "Confirm that the returned HTTP status is 201(Created).") - self.assertEqual(inst.setup.action[3].assert_fhir.direction, "response") - self.assertEqual(inst.setup.action[3].assert_fhir.responseCode, "201") - self.assertFalse(inst.setup.action[3].assert_fhir.warningOnly) + self.assertEqual(inst.purpose, "Patient Read Operation") self.assertEqual(inst.status, "draft") self.assertEqual(inst.test[0].action[0].operation.accept, "xml") - self.assertEqual(inst.test[0].action[0].operation.contentType, "xml") - self.assertEqual(inst.test[0].action[0].operation.description, "Update patient resource on test server using the contents of fixture-patient-update") + self.assertEqual(inst.test[0].action[0].operation.description, "Read the known Patient resource on the destination test system using the user defined dynamic variable ${KnownPatientResourceId}.") self.assertTrue(inst.test[0].action[0].operation.encodeRequestUrl) - self.assertEqual(inst.test[0].action[0].operation.label, "SetupUpdatePatient") - self.assertEqual(inst.test[0].action[0].operation.params, "/${createResourceId}") + self.assertEqual(inst.test[0].action[0].operation.params, "/${KnownPatientResourceId}") self.assertEqual(inst.test[0].action[0].operation.resource, "Patient") - self.assertEqual(inst.test[0].action[0].operation.sourceId, "fixture-patient-update") - self.assertEqual(inst.test[0].action[0].operation.type.code, "update") + self.assertEqual(inst.test[0].action[0].operation.type.code, "read") self.assertEqual(inst.test[0].action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") self.assertEqual(inst.test[0].action[1].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") self.assertEqual(inst.test[0].action[1].assert_fhir.response, "okay") @@ -358,18 +370,63 @@ def implTestScript3(self, inst): self.assertEqual(inst.test[0].action[3].assert_fhir.headerField, "Last-Modified") self.assertEqual(inst.test[0].action[3].assert_fhir.operator, "notEmpty") self.assertTrue(inst.test[0].action[3].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].description, "Update a Patient and validate response.") - self.assertEqual(inst.test[0].id, "01-UpdatePatient") - self.assertEqual(inst.test[0].name, "Update Patient") + self.assertEqual(inst.test[0].action[4].assert_fhir.description, "Confirm that the returned resource type is Patient.") + self.assertEqual(inst.test[0].action[4].assert_fhir.resource, "Patient") + self.assertFalse(inst.test[0].action[4].assert_fhir.warningOnly) + self.assertEqual(inst.test[0].action[5].assert_fhir.description, "Confirm that the returned Patient conforms to the base FHIR specification.") + self.assertEqual(inst.test[0].action[5].assert_fhir.validateProfileId, "patient-profile") + self.assertFalse(inst.test[0].action[5].assert_fhir.warningOnly) + self.assertEqual(inst.test[0].description, "Read a known Patient and validate response.") + self.assertEqual(inst.test[0].id, "R001") + self.assertEqual(inst.test[0].name, "Sprinkler Read Test R001") + self.assertEqual(inst.test[1].action[0].operation.accept, "xml") + self.assertTrue(inst.test[1].action[0].operation.encodeRequestUrl) + self.assertEqual(inst.test[1].action[0].operation.params, "/1") + self.assertEqual(inst.test[1].action[0].operation.resource, "Patient") + self.assertEqual(inst.test[1].action[0].operation.type.code, "read") + self.assertEqual(inst.test[1].action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") + self.assertEqual(inst.test[1].action[1].assert_fhir.description, "Confirm that the returned HTTP status is 404(Not Found).") + self.assertEqual(inst.test[1].action[1].assert_fhir.response, "notFound") + self.assertFalse(inst.test[1].action[1].assert_fhir.warningOnly) + self.assertEqual(inst.test[1].description, "Read an unknown Resource Type and validate response.") + self.assertEqual(inst.test[1].id, "R002") + self.assertEqual(inst.test[1].name, "Sprinkler Read Test R002") + self.assertEqual(inst.test[2].action[0].operation.accept, "xml") + self.assertEqual(inst.test[2].action[0].operation.description, "Attempt to read the non-existing Patient resource on the destination test system using the user defined dynamic variable ${NonExistsPatientResourceId}.") + self.assertTrue(inst.test[2].action[0].operation.encodeRequestUrl) + self.assertEqual(inst.test[2].action[0].operation.params, "/${NonExistsPatientResourceId}") + self.assertEqual(inst.test[2].action[0].operation.resource, "Patient") + self.assertEqual(inst.test[2].action[0].operation.type.code, "read") + self.assertEqual(inst.test[2].action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") + self.assertEqual(inst.test[2].action[1].assert_fhir.description, "Confirm that the returned HTTP status is 404(Not Found).") + self.assertEqual(inst.test[2].action[1].assert_fhir.response, "notFound") + self.assertFalse(inst.test[2].action[1].assert_fhir.warningOnly) + self.assertEqual(inst.test[2].description, "Read a known, non-existing Patient and validate response.") + self.assertEqual(inst.test[2].id, "R003") + self.assertEqual(inst.test[2].name, "Sprinkler Read Test R003") + self.assertEqual(inst.test[3].action[0].operation.accept, "xml") + self.assertEqual(inst.test[3].action[0].operation.description, "Attempt to read a Patient resource on the destination test system using known bad formatted resource id.") + self.assertTrue(inst.test[3].action[0].operation.encodeRequestUrl) + self.assertEqual(inst.test[3].action[0].operation.params, "/ID-may-not-contain-CAPITALS") + self.assertEqual(inst.test[3].action[0].operation.resource, "Patient") + self.assertEqual(inst.test[3].action[0].operation.type.code, "read") + self.assertEqual(inst.test[3].action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") + self.assertEqual(inst.test[3].action[1].assert_fhir.description, "Confirm that the returned HTTP status is 400(Bad Request).") + self.assertEqual(inst.test[3].action[1].assert_fhir.response, "bad") + self.assertFalse(inst.test[3].action[1].assert_fhir.warningOnly) + self.assertEqual(inst.test[3].description, "Read a Patient using a known bad formatted resource id and validate response.") + self.assertEqual(inst.test[3].id, "R004") + self.assertEqual(inst.test[3].name, "Sprinkler Read Test R004") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.url, "http://hl7.org/fhir/TestScript/testscript-example-update") - self.assertEqual(inst.variable[0].name, "createResourceId") - self.assertEqual(inst.variable[0].path, "Patient/id") - self.assertEqual(inst.variable[0].sourceId, "fixture-patient-create") + self.assertEqual(inst.url, "http://hl7.org/fhir/TestScript/testscript-example-readtest") + self.assertEqual(inst.variable[0].defaultValue, "example") + self.assertEqual(inst.variable[0].name, "KnownPatientResourceId") + self.assertEqual(inst.variable[1].defaultValue, "does-not-exist") + self.assertEqual(inst.variable[1].name, "NonExistsPatientResourceId") self.assertEqual(inst.version, "1.0") def testTestScript4(self): - inst = self.instantiate_from("testscript-example-search.json") + inst = self.instantiate_from("testscript-example-multisystem.json") self.assertIsNotNone(inst, "Must have instantiated a TestScript instance") self.implTestScript4(inst) @@ -386,130 +443,118 @@ def implTestScript4(self, inst): self.assertEqual(inst.copyright, "© HL7.org 2011+") self.assertEqual(inst.date.date, FHIRDate("2017-01-18").date) self.assertEqual(inst.date.as_json(), "2017-01-18") - self.assertEqual(inst.description, "TestScript example resource with simple Patient search test. The read tests will utilize user defined dynamic variables that will hold the Patient search parameter values.") + self.assertEqual(inst.destination[0].index, 1) + self.assertEqual(inst.destination[0].profile.code, "FHIR-Server") + self.assertEqual(inst.destination[1].index, 2) + self.assertEqual(inst.destination[1].profile.code, "FHIR-Server") self.assertTrue(inst.experimental) - self.assertFalse(inst.fixture[0].autocreate) - self.assertFalse(inst.fixture[0].autodelete) - self.assertEqual(inst.fixture[0].id, "fixture-patient-create") - self.assertEqual(inst.id, "testscript-example-search") + self.assertEqual(inst.id, "testscript-example-multisystem") self.assertEqual(inst.identifier.system, "urn:ietf:rfc:3986") - self.assertEqual(inst.identifier.value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9881") + self.assertEqual(inst.identifier.value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9878") self.assertEqual(inst.jurisdiction[0].coding[0].code, "US") self.assertEqual(inst.jurisdiction[0].coding[0].display, "United States of America (the)") self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") self.assertEqual(inst.metadata.capability[0].capabilities, "CapabilityStatement/example") - self.assertEqual(inst.metadata.capability[0].description, "Patient Search Operation") - self.assertEqual(inst.metadata.capability[0].link[0], "http://hl7.org/fhir/http.html#search") + self.assertEqual(inst.metadata.capability[0].description, "Patient Read Operation") + self.assertEqual(inst.metadata.capability[0].destination, 1) + self.assertEqual(inst.metadata.capability[0].link[0], "http://hl7.org/fhir/http.html#read") + self.assertEqual(inst.metadata.capability[0].origin[0], 1) self.assertTrue(inst.metadata.capability[0].required) self.assertFalse(inst.metadata.capability[0].validated) + self.assertEqual(inst.metadata.capability[1].capabilities, "CapabilityStatement/example") + self.assertEqual(inst.metadata.capability[1].description, "Patient Read Operation") + self.assertEqual(inst.metadata.capability[1].destination, 2) + self.assertEqual(inst.metadata.capability[1].link[0], "http://hl7.org/fhir/http.html#read") + self.assertEqual(inst.metadata.capability[1].origin[0], 1) + self.assertTrue(inst.metadata.capability[1].required) + self.assertFalse(inst.metadata.capability[1].validated) self.assertEqual(inst.metadata.link[0].description, "Demographics and other administrative information about an individual or animal receiving care or other health-related services.") self.assertEqual(inst.metadata.link[0].url, "http://hl7.org/fhir/patient.html") - self.assertEqual(inst.name, "TestScript Example Search") + self.assertEqual(inst.name, "testscript-example-multisystem") + self.assertEqual(inst.origin[0].index, 1) + self.assertEqual(inst.origin[0].profile.code, "FHIR-Client") self.assertEqual(inst.publisher, "HL7") - self.assertEqual(inst.purpose, "Patient Search Operation") - self.assertEqual(inst.setup.action[0].operation.accept, "xml") - self.assertEqual(inst.setup.action[0].operation.description, "Test simple search to verify server support.") - self.assertTrue(inst.setup.action[0].operation.encodeRequestUrl) - self.assertEqual(inst.setup.action[0].operation.params, "?family=DONTEXPECTAMATCH&given=DONTEXPECTAMATCH") - self.assertEqual(inst.setup.action[0].operation.resource, "Patient") - self.assertEqual(inst.setup.action[0].operation.type.code, "search") - self.assertEqual(inst.setup.action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") - self.assertEqual(inst.setup.action[1].assert_fhir.description, "Confirm that the request url contains the family search parameter.") - self.assertEqual(inst.setup.action[1].assert_fhir.direction, "request") - self.assertEqual(inst.setup.action[1].assert_fhir.operator, "contains") - self.assertEqual(inst.setup.action[1].assert_fhir.requestURL, "family") - self.assertFalse(inst.setup.action[1].assert_fhir.warningOnly) - self.assertEqual(inst.setup.action[2].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") - self.assertEqual(inst.setup.action[2].assert_fhir.direction, "response") - self.assertEqual(inst.setup.action[2].assert_fhir.responseCode, "200") - self.assertFalse(inst.setup.action[2].assert_fhir.warningOnly) - self.assertEqual(inst.setup.action[3].assert_fhir.description, "Confirm that the returned resource type is Bundle.") - self.assertEqual(inst.setup.action[3].assert_fhir.resource, "Bundle") - self.assertFalse(inst.setup.action[3].assert_fhir.warningOnly) - self.assertEqual(inst.setup.action[4].assert_fhir.description, "Confirm that the returned Bundle correctly defines the navigation links.") - self.assertTrue(inst.setup.action[4].assert_fhir.navigationLinks) - self.assertFalse(inst.setup.action[4].assert_fhir.warningOnly) + self.assertEqual(inst.purpose, "Patient Read Operation") self.assertEqual(inst.status, "draft") self.assertEqual(inst.test[0].action[0].operation.accept, "xml") self.assertEqual(inst.test[0].action[0].operation.contentType, "xml") - self.assertEqual(inst.test[0].action[0].operation.description, "Create a Patient resource and capture the returned HTTP Header Location.") + self.assertEqual(inst.test[0].action[0].operation.description, "Read a Patient from the first destination test system and perform basic validation.") + self.assertEqual(inst.test[0].action[0].operation.destination, 1) self.assertTrue(inst.test[0].action[0].operation.encodeRequestUrl) + self.assertEqual(inst.test[0].action[0].operation.origin, 1) + self.assertEqual(inst.test[0].action[0].operation.params, "/${Dest1PatientResourceId}") + self.assertEqual(inst.test[0].action[0].operation.requestId, "request-read-patient-01") self.assertEqual(inst.test[0].action[0].operation.resource, "Patient") - self.assertEqual(inst.test[0].action[0].operation.responseId, "PatientCreateResponse") - self.assertEqual(inst.test[0].action[0].operation.sourceId, "fixture-patient-create") - self.assertEqual(inst.test[0].action[0].operation.type.code, "create") + self.assertEqual(inst.test[0].action[0].operation.type.code, "read") self.assertEqual(inst.test[0].action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") - self.assertEqual(inst.test[0].action[1].assert_fhir.description, "Confirm that the returned HTTP status is 201(Created).") - self.assertEqual(inst.test[0].action[1].assert_fhir.response, "created") + self.assertEqual(inst.test[0].action[1].assert_fhir.description, "Confirm that the request method GET was sent by the client system under test.") + self.assertEqual(inst.test[0].action[1].assert_fhir.requestMethod, "get") self.assertFalse(inst.test[0].action[1].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[2].assert_fhir.description, "Confirm that the returned HTTP Header Location is present.") - self.assertEqual(inst.test[0].action[2].assert_fhir.direction, "response") - self.assertEqual(inst.test[0].action[2].assert_fhir.headerField, "Location") - self.assertEqual(inst.test[0].action[2].assert_fhir.operator, "notEmpty") + self.assertEqual(inst.test[0].action[2].assert_fhir.description, "Confirm that the client requested an Accept of xml.") + self.assertEqual(inst.test[0].action[2].assert_fhir.direction, "request") + self.assertEqual(inst.test[0].action[2].assert_fhir.headerField, "Accept") + self.assertEqual(inst.test[0].action[2].assert_fhir.operator, "contains") + self.assertEqual(inst.test[0].action[2].assert_fhir.value, "xml") self.assertFalse(inst.test[0].action[2].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[3].operation.accept, "xml") - self.assertEqual(inst.test[0].action[3].operation.description, "Read the created Patient using the captured Location URL value.") - self.assertTrue(inst.test[0].action[3].operation.encodeRequestUrl) - self.assertEqual(inst.test[0].action[3].operation.type.code, "read") - self.assertEqual(inst.test[0].action[3].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") - self.assertEqual(inst.test[0].action[3].operation.url, "${PatientCreateLocation}") - self.assertEqual(inst.test[0].action[4].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") - self.assertEqual(inst.test[0].action[4].assert_fhir.response, "okay") + self.assertEqual(inst.test[0].action[3].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") + self.assertEqual(inst.test[0].action[3].assert_fhir.direction, "response") + self.assertEqual(inst.test[0].action[3].assert_fhir.response, "okay") + self.assertFalse(inst.test[0].action[3].assert_fhir.warningOnly) + self.assertEqual(inst.test[0].action[4].assert_fhir.contentType, "xml") + self.assertEqual(inst.test[0].action[4].assert_fhir.description, "Confirm that the returned format is XML.") + self.assertEqual(inst.test[0].action[4].assert_fhir.direction, "response") self.assertFalse(inst.test[0].action[4].assert_fhir.warningOnly) self.assertEqual(inst.test[0].action[5].assert_fhir.description, "Confirm that the returned resource type is Patient.") + self.assertEqual(inst.test[0].action[5].assert_fhir.direction, "response") self.assertEqual(inst.test[0].action[5].assert_fhir.resource, "Patient") self.assertFalse(inst.test[0].action[5].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].description, "Create a Patient resource and capture the returned HTTP Header Location. Then search for (read) that Patient using the Location URL value and validate the response.") - self.assertEqual(inst.test[0].id, "01-PatientCreateSearch") - self.assertEqual(inst.test[0].name, "Patient Create Search") + self.assertEqual(inst.test[0].description, "Read a Patient from the first destination test system using the user defined dynamic variable ${Dest1PatientResourceId}. Perform basic validation.") + self.assertEqual(inst.test[0].id, "01-ReadPatient-Destination1") + self.assertEqual(inst.test[0].name, "ReadPatient-Destination1") self.assertEqual(inst.test[1].action[0].operation.accept, "xml") - self.assertEqual(inst.test[1].action[0].operation.description, "Search for Patient resources on the destination test system.") + self.assertEqual(inst.test[1].action[0].operation.contentType, "xml") + self.assertEqual(inst.test[1].action[0].operation.description, "Read a Patient from the second destination test system and perform basic validation.") + self.assertEqual(inst.test[1].action[0].operation.destination, 2) self.assertTrue(inst.test[1].action[0].operation.encodeRequestUrl) - self.assertEqual(inst.test[1].action[0].operation.params, "?family=${PatientSearchFamilyName}&given=${PatientSearchGivenName}") + self.assertEqual(inst.test[1].action[0].operation.origin, 1) + self.assertEqual(inst.test[1].action[0].operation.params, "/${Dest2PatientResourceId}") + self.assertEqual(inst.test[1].action[0].operation.requestHeader[0].field, "Accept-Charset") + self.assertEqual(inst.test[1].action[0].operation.requestHeader[0].value, "utf-8") self.assertEqual(inst.test[1].action[0].operation.resource, "Patient") - self.assertEqual(inst.test[1].action[0].operation.type.code, "search") + self.assertEqual(inst.test[1].action[0].operation.type.code, "read") self.assertEqual(inst.test[1].action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") - self.assertEqual(inst.test[1].action[1].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") - self.assertEqual(inst.test[1].action[1].assert_fhir.response, "okay") + self.assertEqual(inst.test[1].action[1].assert_fhir.description, "Confirm that the client requested an Accept of xml.") + self.assertEqual(inst.test[1].action[1].assert_fhir.direction, "request") + self.assertEqual(inst.test[1].action[1].assert_fhir.headerField, "Accept") + self.assertEqual(inst.test[1].action[1].assert_fhir.operator, "contains") + self.assertEqual(inst.test[1].action[1].assert_fhir.value, "xml") self.assertFalse(inst.test[1].action[1].assert_fhir.warningOnly) - self.assertEqual(inst.test[1].action[2].assert_fhir.contentType, "xml") - self.assertEqual(inst.test[1].action[2].assert_fhir.description, "Confirm that the returned format is XML.") + self.assertEqual(inst.test[1].action[2].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") + self.assertEqual(inst.test[1].action[2].assert_fhir.direction, "response") + self.assertEqual(inst.test[1].action[2].assert_fhir.response, "okay") self.assertFalse(inst.test[1].action[2].assert_fhir.warningOnly) - self.assertEqual(inst.test[1].action[3].assert_fhir.description, "Confirm that the returned resource type is Bundle.") - self.assertEqual(inst.test[1].action[3].assert_fhir.resource, "Bundle") + self.assertEqual(inst.test[1].action[3].assert_fhir.contentType, "xml") + self.assertEqual(inst.test[1].action[3].assert_fhir.description, "Confirm that the returned format is XML.") + self.assertEqual(inst.test[1].action[3].assert_fhir.direction, "response") self.assertFalse(inst.test[1].action[3].assert_fhir.warningOnly) - self.assertEqual(inst.test[1].action[4].assert_fhir.description, "Confirm that the returned Bundle conforms to the base FHIR specification.") - self.assertEqual(inst.test[1].action[4].assert_fhir.validateProfileId, "bundle-profile") + self.assertEqual(inst.test[1].action[4].assert_fhir.description, "Confirm that the returned resource type is Patient.") + self.assertEqual(inst.test[1].action[4].assert_fhir.direction, "response") + self.assertEqual(inst.test[1].action[4].assert_fhir.resource, "Patient") self.assertFalse(inst.test[1].action[4].assert_fhir.warningOnly) - self.assertEqual(inst.test[1].action[5].assert_fhir.description, "Confirm that the returned Bundle type equals 'searchset'.") - self.assertEqual(inst.test[1].action[5].assert_fhir.operator, "equals") - self.assertEqual(inst.test[1].action[5].assert_fhir.path, "fhir:Bundle/fhir:type/@value") - self.assertEqual(inst.test[1].action[5].assert_fhir.value, "searchset") - self.assertFalse(inst.test[1].action[5].assert_fhir.warningOnly) - self.assertEqual(inst.test[1].action[6].assert_fhir.description, "Confirm that the returned Bundle total is greater than or equal to the number of returned entries.") - self.assertEqual(inst.test[1].action[6].assert_fhir.expression, "Bundle.total.toInteger() >= entry.count()") - self.assertFalse(inst.test[1].action[6].assert_fhir.warningOnly) - self.assertEqual(inst.test[1].description, "Search for Patient resources using the user defined dynamic variables ${PatientSearchFamilyName} and ${PatientSearchGivenName} and validate response.") - self.assertEqual(inst.test[1].id, "02-PatientSearchDynamic") - self.assertEqual(inst.test[1].name, "Patient Search Dynamic") + self.assertEqual(inst.test[1].description, "Read a Patient from the second destination test system using the user defined dynamic variable ${Dest2PatientResourceId}. Perform basic validation.") + self.assertEqual(inst.test[1].id, "02-ReadPatient-Destination2") + self.assertEqual(inst.test[1].name, "ReadPatient-Destination2") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.url, "http://hl7.org/fhir/TestScript/testscript-example-search") - self.assertEqual(inst.variable[0].headerField, "Location") - self.assertEqual(inst.variable[0].name, "PatientCreateLocation") - self.assertEqual(inst.variable[0].sourceId, "PatientCreateResponse") - self.assertEqual(inst.variable[1].description, "Enter patient search criteria for a known family name on the target system") - self.assertEqual(inst.variable[1].hint, "[Family name]") - self.assertEqual(inst.variable[1].name, "PatientSearchFamilyName") - self.assertEqual(inst.variable[2].description, "Enter patient search criteria for a known given name on the target system") - self.assertEqual(inst.variable[2].hint, "[Given name]") - self.assertEqual(inst.variable[2].name, "PatientSearchGivenName") - self.assertEqual(inst.variable[3].description, "Evaluate the returned Patient searchset Bundle.total value") - self.assertEqual(inst.variable[3].expression, "Bundle.total.toInteger()") - self.assertEqual(inst.variable[3].name, "PatientSearchBundleTotal") + self.assertEqual(inst.title, "Multisystem Test Script") + self.assertEqual(inst.url, "http://hl7.org/fhir/TestScript/testscript-example-multisystem") + self.assertEqual(inst.variable[0].defaultValue, "example") + self.assertEqual(inst.variable[0].name, "Dest1PatientResourceId") + self.assertEqual(inst.variable[1].defaultValue, "example") + self.assertEqual(inst.variable[1].name, "Dest2PatientResourceId") self.assertEqual(inst.version, "1.0") def testTestScript5(self): - inst = self.instantiate_from("testscript-example.json") + inst = self.instantiate_from("testscript-example-update.json") self.assertIsNotNone(inst, "Must have instantiated a TestScript instance") self.implTestScript5(inst) @@ -526,33 +571,32 @@ def implTestScript5(self, inst): self.assertEqual(inst.copyright, "© HL7.org 2011+") self.assertEqual(inst.date.date, FHIRDate("2017-01-18").date) self.assertEqual(inst.date.as_json(), "2017-01-18") - self.assertEqual(inst.description, "TestScript example resource with setup to delete if present and create a new instance of a Patient; and single test definition to read the created Patient with various asserts.") + self.assertEqual(inst.description, "TestScript example resource with setup to delete if present and create a new instance of a Patient; and single test definition to update that Patient with various asserts.") self.assertTrue(inst.experimental) self.assertFalse(inst.fixture[0].autocreate) self.assertFalse(inst.fixture[0].autodelete) self.assertEqual(inst.fixture[0].id, "fixture-patient-create") self.assertFalse(inst.fixture[1].autocreate) self.assertFalse(inst.fixture[1].autodelete) - self.assertEqual(inst.fixture[1].id, "fixture-patient-minimum") - self.assertEqual(inst.id, "testscript-example") + self.assertEqual(inst.fixture[1].id, "fixture-patient-update") + self.assertEqual(inst.id, "testscript-example-update") self.assertEqual(inst.identifier.system, "urn:ietf:rfc:3986") - self.assertEqual(inst.identifier.value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9876") + self.assertEqual(inst.identifier.value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9882") self.assertEqual(inst.jurisdiction[0].coding[0].code, "US") self.assertEqual(inst.jurisdiction[0].coding[0].display, "United States of America (the)") self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") self.assertEqual(inst.metadata.capability[0].capabilities, "CapabilityStatement/example") - self.assertEqual(inst.metadata.capability[0].description, "Patient Update, Read and Delete Operations") - self.assertEqual(inst.metadata.capability[0].link[0], "http://hl7.org/fhir/http.html#delete") - self.assertEqual(inst.metadata.capability[0].link[1], "http://hl7.org/fhir/http.html#read") - self.assertEqual(inst.metadata.capability[0].link[2], "http://hl7.org/fhir/http.html#update") + self.assertEqual(inst.metadata.capability[0].description, "Patient Update and Delete Operations") + self.assertEqual(inst.metadata.capability[0].link[0], "http://hl7.org/fhir/http.html#update") + self.assertEqual(inst.metadata.capability[0].link[1], "http://hl7.org/fhir/http.html#delete") self.assertTrue(inst.metadata.capability[0].required) self.assertFalse(inst.metadata.capability[0].validated) self.assertEqual(inst.metadata.link[0].description, "Demographics and other administrative information about an individual or animal receiving care or other health-related services.") self.assertEqual(inst.metadata.link[0].url, "http://hl7.org/fhir/patient.html") - self.assertEqual(inst.name, "TestScript Example") + self.assertEqual(inst.name, "TestScript Example Update") self.assertEqual(inst.publisher, "HL7") - self.assertEqual(inst.purpose, "Patient Conditional Create (Update), Read and Delete Operations") - self.assertEqual(inst.setup.action[0].operation.accept, "json") + self.assertEqual(inst.purpose, "Patient (Conditional) Create, Update, Delete Operations") + self.assertEqual(inst.setup.action[0].operation.accept, "xml") self.assertEqual(inst.setup.action[0].operation.description, "Execute a delete operation to insure the patient does not exist on the server.") self.assertTrue(inst.setup.action[0].operation.encodeRequestUrl) self.assertEqual(inst.setup.action[0].operation.label, "SetupDeletePatient") @@ -565,8 +609,8 @@ def implTestScript5(self, inst): self.assertEqual(inst.setup.action[1].assert_fhir.operator, "in") self.assertEqual(inst.setup.action[1].assert_fhir.responseCode, "200,204") self.assertFalse(inst.setup.action[1].assert_fhir.warningOnly) - self.assertEqual(inst.setup.action[2].operation.accept, "json") - self.assertEqual(inst.setup.action[2].operation.contentType, "json") + self.assertEqual(inst.setup.action[2].operation.accept, "xml") + self.assertEqual(inst.setup.action[2].operation.contentType, "xml") self.assertEqual(inst.setup.action[2].operation.description, "Create patient resource on test server using the contents of fixture-patient-create") self.assertTrue(inst.setup.action[2].operation.encodeRequestUrl) self.assertEqual(inst.setup.action[2].operation.label, "SetupCreatePatient") @@ -579,92 +623,39 @@ def implTestScript5(self, inst): self.assertEqual(inst.setup.action[3].assert_fhir.direction, "response") self.assertEqual(inst.setup.action[3].assert_fhir.responseCode, "201") self.assertFalse(inst.setup.action[3].assert_fhir.warningOnly) - self.assertEqual(inst.setup.action[4].operation.description, "Read the created patient resource on the test server using the id from fixture-patient-create. Verify contents.") - self.assertTrue(inst.setup.action[4].operation.encodeRequestUrl) - self.assertEqual(inst.setup.action[4].operation.resource, "Patient") - self.assertEqual(inst.setup.action[4].operation.targetId, "fixture-patient-create") - self.assertEqual(inst.setup.action[4].operation.type.code, "read") - self.assertEqual(inst.setup.action[4].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") - self.assertEqual(inst.setup.action[5].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") - self.assertEqual(inst.setup.action[5].assert_fhir.direction, "response") - self.assertEqual(inst.setup.action[5].assert_fhir.response, "okay") - self.assertFalse(inst.setup.action[5].assert_fhir.warningOnly) - self.assertEqual(inst.setup.action[6].assert_fhir.compareToSourceExpression, "Patient.name.first().family") - self.assertEqual(inst.setup.action[6].assert_fhir.compareToSourceId, "fixture-patient-create") - self.assertEqual(inst.setup.action[6].assert_fhir.description, "Confirm that the returned Patient contains the expected family name 'Chalmers'. Uses explicit compareToSourceId reference to fixture-patient-create used to create the Patient.") - self.assertEqual(inst.setup.action[6].assert_fhir.operator, "equals") - self.assertFalse(inst.setup.action[6].assert_fhir.warningOnly) self.assertEqual(inst.status, "draft") - self.assertEqual(inst.teardown.action[0].operation.description, "Delete the patient resource on the test server using the id from fixture-patient-create.") - self.assertTrue(inst.teardown.action[0].operation.encodeRequestUrl) - self.assertEqual(inst.teardown.action[0].operation.resource, "Patient") - self.assertEqual(inst.teardown.action[0].operation.targetId, "fixture-patient-create") - self.assertEqual(inst.teardown.action[0].operation.type.code, "delete") - self.assertEqual(inst.teardown.action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") - self.assertEqual(inst.test[0].action[0].operation.description, "Read the patient resource on the test server using the id from fixture-patient-create. Prevent URL encoding of the request.") - self.assertFalse(inst.test[0].action[0].operation.encodeRequestUrl) + self.assertEqual(inst.test[0].action[0].operation.accept, "xml") + self.assertEqual(inst.test[0].action[0].operation.contentType, "xml") + self.assertEqual(inst.test[0].action[0].operation.description, "Update patient resource on test server using the contents of fixture-patient-update") + self.assertTrue(inst.test[0].action[0].operation.encodeRequestUrl) + self.assertEqual(inst.test[0].action[0].operation.label, "SetupUpdatePatient") + self.assertEqual(inst.test[0].action[0].operation.params, "/${createResourceId}") self.assertEqual(inst.test[0].action[0].operation.resource, "Patient") - self.assertEqual(inst.test[0].action[0].operation.responseId, "fixture-patient-read") - self.assertEqual(inst.test[0].action[0].operation.targetId, "fixture-patient-create") - self.assertEqual(inst.test[0].action[0].operation.type.code, "read") + self.assertEqual(inst.test[0].action[0].operation.sourceId, "fixture-patient-update") + self.assertEqual(inst.test[0].action[0].operation.type.code, "update") self.assertEqual(inst.test[0].action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") self.assertEqual(inst.test[0].action[1].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") - self.assertEqual(inst.test[0].action[1].assert_fhir.direction, "response") - self.assertEqual(inst.test[0].action[1].assert_fhir.label, "01-ReadPatientOK") self.assertEqual(inst.test[0].action[1].assert_fhir.response, "okay") self.assertFalse(inst.test[0].action[1].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[2].assert_fhir.description, "Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server might not support versioning.") - self.assertEqual(inst.test[0].action[2].assert_fhir.direction, "response") - self.assertEqual(inst.test[0].action[2].assert_fhir.headerField, "Last-Modified") - self.assertEqual(inst.test[0].action[2].assert_fhir.operator, "notEmpty") - self.assertTrue(inst.test[0].action[2].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[3].assert_fhir.description, "Confirm that the returned resource type is Patient.") - self.assertEqual(inst.test[0].action[3].assert_fhir.resource, "Patient") - self.assertFalse(inst.test[0].action[3].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[4].assert_fhir.description, "Confirm that the returned Patient conforms to the base FHIR specification.") - self.assertEqual(inst.test[0].action[4].assert_fhir.validateProfileId, "patient-profile") - self.assertFalse(inst.test[0].action[4].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[5].assert_fhir.description, "Confirm that the returned Patient contains the expected family name 'Chalmers'. Uses explicit sourceId reference to read responseId fixture.") - self.assertEqual(inst.test[0].action[5].assert_fhir.operator, "equals") - self.assertEqual(inst.test[0].action[5].assert_fhir.path, "fhir:Patient/fhir:name/fhir:family/@value") - self.assertEqual(inst.test[0].action[5].assert_fhir.sourceId, "fixture-patient-read") - self.assertEqual(inst.test[0].action[5].assert_fhir.value, "Chalmers") - self.assertFalse(inst.test[0].action[5].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[6].assert_fhir.description, "Confirm that the returned Patient contains the expected given name 'Peter'. Uses explicit sourceId reference to read responseId fixture.") - self.assertEqual(inst.test[0].action[6].assert_fhir.operator, "equals") - self.assertEqual(inst.test[0].action[6].assert_fhir.path, "fhir:Patient/fhir:name/fhir:given/@value") - self.assertEqual(inst.test[0].action[6].assert_fhir.sourceId, "fixture-patient-read") - self.assertEqual(inst.test[0].action[6].assert_fhir.value, "Peter") - self.assertFalse(inst.test[0].action[6].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[7].assert_fhir.compareToSourceId, "fixture-patient-create") - self.assertEqual(inst.test[0].action[7].assert_fhir.compareToSourcePath, "fhir:Patient/fhir:name/fhir:family/@value") - self.assertEqual(inst.test[0].action[7].assert_fhir.operator, "equals") - self.assertEqual(inst.test[0].action[7].assert_fhir.path, "fhir:Patient/fhir:name/fhir:family/@value") - self.assertFalse(inst.test[0].action[7].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[8].assert_fhir.compareToSourceId, "fixture-patient-create") - self.assertEqual(inst.test[0].action[8].assert_fhir.compareToSourcePath, "fhir:Patient/fhir:name/fhir:given/@value") - self.assertEqual(inst.test[0].action[8].assert_fhir.path, "fhir:Patient/fhir:name/fhir:given/@value") - self.assertEqual(inst.test[0].action[8].assert_fhir.sourceId, "fixture-patient-read") - self.assertFalse(inst.test[0].action[8].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[9].assert_fhir.description, "Confirm that the returned resource contains the expected retained elements and values. Warning only to provide users with reviewable results.") - self.assertEqual(inst.test[0].action[9].assert_fhir.minimumId, "fixture-patient-minimum") - self.assertTrue(inst.test[0].action[9].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].description, "Read a Patient and validate response.") - self.assertEqual(inst.test[0].id, "01-ReadPatient") - self.assertEqual(inst.test[0].name, "Read Patient") + self.assertEqual(inst.test[0].action[2].assert_fhir.contentType, "xml") + self.assertEqual(inst.test[0].action[2].assert_fhir.description, "Confirm that the returned format is XML.") + self.assertFalse(inst.test[0].action[2].assert_fhir.warningOnly) + self.assertEqual(inst.test[0].action[3].assert_fhir.description, "Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server might not support versioning.") + self.assertEqual(inst.test[0].action[3].assert_fhir.headerField, "Last-Modified") + self.assertEqual(inst.test[0].action[3].assert_fhir.operator, "notEmpty") + self.assertTrue(inst.test[0].action[3].assert_fhir.warningOnly) + self.assertEqual(inst.test[0].description, "Update a Patient and validate response.") + self.assertEqual(inst.test[0].id, "01-UpdatePatient") + self.assertEqual(inst.test[0].name, "Update Patient") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.url, "http://hl7.org/fhir/TestScript/testscript-example") - self.assertEqual(inst.useContext[0].code.code, "focus") - self.assertEqual(inst.useContext[0].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") - self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].code, "positive") - self.assertEqual(inst.useContext[0].valueCodeableConcept.coding[0].system, "http://terminology.hl7.org/CodeSystem/variant-state") + self.assertEqual(inst.url, "http://hl7.org/fhir/TestScript/testscript-example-update") self.assertEqual(inst.variable[0].name, "createResourceId") self.assertEqual(inst.variable[0].path, "Patient/id") self.assertEqual(inst.variable[0].sourceId, "fixture-patient-create") self.assertEqual(inst.version, "1.0") def testTestScript6(self): - inst = self.instantiate_from("testscript-example-readtest.json") + inst = self.instantiate_from("testscript-example-history.json") self.assertIsNotNone(inst, "Must have instantiated a TestScript instance") self.implTestScript6(inst) @@ -681,94 +672,103 @@ def implTestScript6(self, inst): self.assertEqual(inst.copyright, "© HL7.org 2011+") self.assertEqual(inst.date.date, FHIRDate("2017-01-18").date) self.assertEqual(inst.date.as_json(), "2017-01-18") - self.assertEqual(inst.description, "TestScript example resource with ported Sprinkler basic read tests R001, R002, R003, R004. The read tests will utilize user defined dynamic variables that will hold the Patient resource id values.") self.assertTrue(inst.experimental) - self.assertEqual(inst.id, "testscript-example-readtest") + self.assertFalse(inst.fixture[0].autocreate) + self.assertFalse(inst.fixture[0].autodelete) + self.assertEqual(inst.fixture[0].id, "fixture-patient-create") + self.assertFalse(inst.fixture[1].autocreate) + self.assertFalse(inst.fixture[1].autodelete) + self.assertEqual(inst.fixture[1].id, "fixture-patient-update") + self.assertEqual(inst.id, "testscript-example-history") self.assertEqual(inst.identifier.system, "urn:ietf:rfc:3986") - self.assertEqual(inst.identifier.value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9879") + self.assertEqual(inst.identifier.value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9877") self.assertEqual(inst.jurisdiction[0].coding[0].code, "US") self.assertEqual(inst.jurisdiction[0].coding[0].display, "United States of America (the)") self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") self.assertEqual(inst.metadata.capability[0].capabilities, "CapabilityStatement/example") - self.assertEqual(inst.metadata.capability[0].description, "Patient Read Operation") - self.assertEqual(inst.metadata.capability[0].link[0], "http://hl7.org/fhir/http.html#read") + self.assertEqual(inst.metadata.capability[0].description, "Patient Update, Delete and History (Instance) Operations") + self.assertEqual(inst.metadata.capability[0].link[0], "http://hl7.org/fhir/http.html#update") + self.assertEqual(inst.metadata.capability[0].link[1], "http://hl7.org/fhir/http.html#delete") + self.assertEqual(inst.metadata.capability[0].link[2], "http://hl7.org/fhir/http.html#history") self.assertTrue(inst.metadata.capability[0].required) self.assertFalse(inst.metadata.capability[0].validated) self.assertEqual(inst.metadata.link[0].description, "Demographics and other administrative information about an individual or animal receiving care or other health-related services.") self.assertEqual(inst.metadata.link[0].url, "http://hl7.org/fhir/patient.html") - self.assertEqual(inst.name, "TestScript Example Read Test") + self.assertEqual(inst.name, "TestScript Example History") self.assertEqual(inst.publisher, "HL7") - self.assertEqual(inst.purpose, "Patient Read Operation") + self.assertEqual(inst.purpose, "Patient (Conditional) Create, Update, Delete and History (Instance) Operations") + self.assertEqual(inst.setup.action[0].operation.accept, "json") + self.assertEqual(inst.setup.action[0].operation.description, "Execute a delete operation to insure the patient does not exist on the server.") + self.assertTrue(inst.setup.action[0].operation.encodeRequestUrl) + self.assertEqual(inst.setup.action[0].operation.label, "SetupDeletePatient") + self.assertEqual(inst.setup.action[0].operation.params, "/${createResourceId}") + self.assertEqual(inst.setup.action[0].operation.resource, "Patient") + self.assertEqual(inst.setup.action[0].operation.type.code, "delete") + self.assertEqual(inst.setup.action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") + self.assertEqual(inst.setup.action[1].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK) or 204(No Content).") + self.assertEqual(inst.setup.action[1].assert_fhir.direction, "response") + self.assertEqual(inst.setup.action[1].assert_fhir.operator, "in") + self.assertEqual(inst.setup.action[1].assert_fhir.responseCode, "200,204") + self.assertFalse(inst.setup.action[1].assert_fhir.warningOnly) + self.assertEqual(inst.setup.action[2].operation.accept, "json") + self.assertEqual(inst.setup.action[2].operation.contentType, "json") + self.assertEqual(inst.setup.action[2].operation.description, "Create patient resource on test server using the contents of fixture-patient-create") + self.assertTrue(inst.setup.action[2].operation.encodeRequestUrl) + self.assertEqual(inst.setup.action[2].operation.label, "SetupCreatePatient") + self.assertEqual(inst.setup.action[2].operation.params, "/${createResourceId}") + self.assertEqual(inst.setup.action[2].operation.resource, "Patient") + self.assertEqual(inst.setup.action[2].operation.sourceId, "fixture-patient-create") + self.assertEqual(inst.setup.action[2].operation.type.code, "update") + self.assertEqual(inst.setup.action[2].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") + self.assertEqual(inst.setup.action[3].assert_fhir.description, "Confirm that the returned HTTP status is 201(Created).") + self.assertEqual(inst.setup.action[3].assert_fhir.direction, "response") + self.assertEqual(inst.setup.action[3].assert_fhir.responseCode, "201") + self.assertFalse(inst.setup.action[3].assert_fhir.warningOnly) + self.assertEqual(inst.setup.action[4].operation.accept, "json") + self.assertEqual(inst.setup.action[4].operation.contentType, "json") + self.assertEqual(inst.setup.action[4].operation.description, "Update patient resource on test server using the contents of fixture-patient-update") + self.assertTrue(inst.setup.action[4].operation.encodeRequestUrl) + self.assertEqual(inst.setup.action[4].operation.label, "SetupUpdatePatient") + self.assertEqual(inst.setup.action[4].operation.params, "/${createResourceId}") + self.assertEqual(inst.setup.action[4].operation.resource, "Patient") + self.assertEqual(inst.setup.action[4].operation.sourceId, "fixture-patient-update") + self.assertEqual(inst.setup.action[4].operation.type.code, "update") + self.assertEqual(inst.setup.action[4].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") + self.assertEqual(inst.setup.action[5].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") + self.assertEqual(inst.setup.action[5].assert_fhir.direction, "response") + self.assertEqual(inst.setup.action[5].assert_fhir.responseCode, "200") + self.assertFalse(inst.setup.action[5].assert_fhir.warningOnly) self.assertEqual(inst.status, "draft") - self.assertEqual(inst.test[0].action[0].operation.accept, "xml") - self.assertEqual(inst.test[0].action[0].operation.description, "Read the known Patient resource on the destination test system using the user defined dynamic variable ${KnownPatientResourceId}.") + self.assertEqual(inst.test[0].action[0].operation.accept, "json") + self.assertEqual(inst.test[0].action[0].operation.contentType, "json") + self.assertEqual(inst.test[0].action[0].operation.description, "Get the Patient history on the test server using the id from fixture-patient-create.") self.assertTrue(inst.test[0].action[0].operation.encodeRequestUrl) - self.assertEqual(inst.test[0].action[0].operation.params, "/${KnownPatientResourceId}") self.assertEqual(inst.test[0].action[0].operation.resource, "Patient") - self.assertEqual(inst.test[0].action[0].operation.type.code, "read") + self.assertEqual(inst.test[0].action[0].operation.targetId, "fixture-patient-create") + self.assertEqual(inst.test[0].action[0].operation.type.code, "history") self.assertEqual(inst.test[0].action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") self.assertEqual(inst.test[0].action[1].assert_fhir.description, "Confirm that the returned HTTP status is 200(OK).") + self.assertEqual(inst.test[0].action[1].assert_fhir.direction, "response") self.assertEqual(inst.test[0].action[1].assert_fhir.response, "okay") self.assertFalse(inst.test[0].action[1].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[2].assert_fhir.contentType, "xml") - self.assertEqual(inst.test[0].action[2].assert_fhir.description, "Confirm that the returned format is XML.") + self.assertEqual(inst.test[0].action[2].assert_fhir.description, "Confirm that the returned resource type is Bundle.") + self.assertEqual(inst.test[0].action[2].assert_fhir.resource, "Bundle") self.assertFalse(inst.test[0].action[2].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[3].assert_fhir.description, "Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server might not support versioning.") - self.assertEqual(inst.test[0].action[3].assert_fhir.headerField, "Last-Modified") - self.assertEqual(inst.test[0].action[3].assert_fhir.operator, "notEmpty") - self.assertTrue(inst.test[0].action[3].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[4].assert_fhir.description, "Confirm that the returned resource type is Patient.") - self.assertEqual(inst.test[0].action[4].assert_fhir.resource, "Patient") + self.assertEqual(inst.test[0].action[3].assert_fhir.description, "Confirm that the returned Bundle conforms to the base FHIR specification.") + self.assertEqual(inst.test[0].action[3].assert_fhir.validateProfileId, "bundle-profile") + self.assertFalse(inst.test[0].action[3].assert_fhir.warningOnly) + self.assertEqual(inst.test[0].action[4].assert_fhir.description, "Confirm that the returned Bundle type equals 'history'.") + self.assertEqual(inst.test[0].action[4].assert_fhir.operator, "equals") + self.assertEqual(inst.test[0].action[4].assert_fhir.path, "fhir:Bundle/fhir:type/@value") + self.assertEqual(inst.test[0].action[4].assert_fhir.value, "history") self.assertFalse(inst.test[0].action[4].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].action[5].assert_fhir.description, "Confirm that the returned Patient conforms to the base FHIR specification.") - self.assertEqual(inst.test[0].action[5].assert_fhir.validateProfileId, "patient-profile") - self.assertFalse(inst.test[0].action[5].assert_fhir.warningOnly) - self.assertEqual(inst.test[0].description, "Read a known Patient and validate response.") - self.assertEqual(inst.test[0].id, "R001") - self.assertEqual(inst.test[0].name, "Sprinkler Read Test R001") - self.assertEqual(inst.test[1].action[0].operation.accept, "xml") - self.assertTrue(inst.test[1].action[0].operation.encodeRequestUrl) - self.assertEqual(inst.test[1].action[0].operation.params, "/1") - self.assertEqual(inst.test[1].action[0].operation.resource, "Patient") - self.assertEqual(inst.test[1].action[0].operation.type.code, "read") - self.assertEqual(inst.test[1].action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") - self.assertEqual(inst.test[1].action[1].assert_fhir.description, "Confirm that the returned HTTP status is 404(Not Found).") - self.assertEqual(inst.test[1].action[1].assert_fhir.response, "notFound") - self.assertFalse(inst.test[1].action[1].assert_fhir.warningOnly) - self.assertEqual(inst.test[1].description, "Read an unknown Resource Type and validate response.") - self.assertEqual(inst.test[1].id, "R002") - self.assertEqual(inst.test[1].name, "Sprinkler Read Test R002") - self.assertEqual(inst.test[2].action[0].operation.accept, "xml") - self.assertEqual(inst.test[2].action[0].operation.description, "Attempt to read the non-existing Patient resource on the destination test system using the user defined dynamic variable ${NonExistsPatientResourceId}.") - self.assertTrue(inst.test[2].action[0].operation.encodeRequestUrl) - self.assertEqual(inst.test[2].action[0].operation.params, "/${NonExistsPatientResourceId}") - self.assertEqual(inst.test[2].action[0].operation.resource, "Patient") - self.assertEqual(inst.test[2].action[0].operation.type.code, "read") - self.assertEqual(inst.test[2].action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") - self.assertEqual(inst.test[2].action[1].assert_fhir.description, "Confirm that the returned HTTP status is 404(Not Found).") - self.assertEqual(inst.test[2].action[1].assert_fhir.response, "notFound") - self.assertFalse(inst.test[2].action[1].assert_fhir.warningOnly) - self.assertEqual(inst.test[2].description, "Read a known, non-existing Patient and validate response.") - self.assertEqual(inst.test[2].id, "R003") - self.assertEqual(inst.test[2].name, "Sprinkler Read Test R003") - self.assertEqual(inst.test[3].action[0].operation.accept, "xml") - self.assertEqual(inst.test[3].action[0].operation.description, "Attempt to read a Patient resource on the destination test system using known bad formatted resource id.") - self.assertTrue(inst.test[3].action[0].operation.encodeRequestUrl) - self.assertEqual(inst.test[3].action[0].operation.params, "/ID-may-not-contain-CAPITALS") - self.assertEqual(inst.test[3].action[0].operation.resource, "Patient") - self.assertEqual(inst.test[3].action[0].operation.type.code, "read") - self.assertEqual(inst.test[3].action[0].operation.type.system, "http://terminology.hl7.org/CodeSystem/testscript-operation-codes") - self.assertEqual(inst.test[3].action[1].assert_fhir.description, "Confirm that the returned HTTP status is 400(Bad Request).") - self.assertEqual(inst.test[3].action[1].assert_fhir.response, "bad") - self.assertFalse(inst.test[3].action[1].assert_fhir.warningOnly) - self.assertEqual(inst.test[3].description, "Read a Patient using a known bad formatted resource id and validate response.") - self.assertEqual(inst.test[3].id, "R004") - self.assertEqual(inst.test[3].name, "Sprinkler Read Test R004") + self.assertEqual(inst.test[0].description, "Get the history for a known Patient and validate response.") + self.assertEqual(inst.test[0].id, "01-HistoryPatient") + self.assertEqual(inst.test[0].name, "History Patient") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.url, "http://hl7.org/fhir/TestScript/testscript-example-readtest") - self.assertEqual(inst.variable[0].defaultValue, "example") - self.assertEqual(inst.variable[0].name, "KnownPatientResourceId") - self.assertEqual(inst.variable[1].defaultValue, "does-not-exist") - self.assertEqual(inst.variable[1].name, "NonExistsPatientResourceId") + self.assertEqual(inst.url, "http://hl7.org/fhir/TestScript/testscript-example-history") + self.assertEqual(inst.variable[0].name, "createResourceId") + self.assertEqual(inst.variable[0].path, "Patient/id") + self.assertEqual(inst.variable[0].sourceId, "fixture-patient-create") self.assertEqual(inst.version, "1.0") diff --git a/fhirclient/models/timing.py b/fhirclient/models/timing.py index 9b10bc131..dd94d17d1 100644 --- a/fhirclient/models/timing.py +++ b/fhirclient/models/timing.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Timing) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Timing) on 2024-07-15. +# 2024, SMART Health IT. from . import backboneelement diff --git a/fhirclient/models/triggerdefinition.py b/fhirclient/models/triggerdefinition.py index b3004606e..8b0d25c55 100644 --- a/fhirclient/models/triggerdefinition.py +++ b/fhirclient/models/triggerdefinition.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/TriggerDefinition) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/TriggerDefinition) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/usagecontext.py b/fhirclient/models/usagecontext.py index 24056aed8..8fc103ab4 100644 --- a/fhirclient/models/usagecontext.py +++ b/fhirclient/models/usagecontext.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/UsageContext) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/UsageContext) on 2024-07-15. +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/valueset.py b/fhirclient/models/valueset.py index 5465bdabd..204c23d39 100644 --- a/fhirclient/models/valueset.py +++ b/fhirclient/models/valueset.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/ValueSet) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ValueSet) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/valueset_tests.py b/fhirclient/models/valueset_tests.py index 385ad8979..778cf68f3 100644 --- a/fhirclient/models/valueset_tests.py +++ b/fhirclient/models/valueset_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return valueset.ValueSet(js) def testValueSet1(self): - inst = self.instantiate_from("valueset-example.json") + inst = self.instantiate_from("valueset-example-hierarchical.json") self.assertIsNotNone(inst, "Must have instantiated a ValueSet instance") self.implValueSet1(inst) @@ -32,59 +32,6 @@ def testValueSet1(self): self.implValueSet1(inst2) def implValueSet1(self, inst): - self.assertTrue(inst.compose.inactive) - self.assertEqual(inst.compose.include[0].concept[0].code, "14647-2") - self.assertEqual(inst.compose.include[0].concept[0].display, "Cholesterol [Moles/Volume]") - self.assertEqual(inst.compose.include[0].concept[1].code, "2093-3") - self.assertEqual(inst.compose.include[0].concept[1].display, "Cholesterol [Mass/Volume]") - self.assertEqual(inst.compose.include[0].concept[2].code, "35200-5") - self.assertEqual(inst.compose.include[0].concept[2].display, "Cholesterol [Mass Or Moles/Volume]") - self.assertEqual(inst.compose.include[0].concept[3].code, "9342-7") - self.assertEqual(inst.compose.include[0].concept[3].display, "Cholesterol [Percentile]") - self.assertEqual(inst.compose.include[0].system, "http://loinc.org") - self.assertEqual(inst.compose.include[0].version, "2.36") - self.assertEqual(inst.compose.lockedDate.date, FHIRDate("2012-06-13").date) - self.assertEqual(inst.compose.lockedDate.as_json(), "2012-06-13") - self.assertEqual(inst.contact[0].name, "FHIR project team") - self.assertEqual(inst.contact[0].telecom[0].system, "url") - self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org/fhir") - self.assertEqual(inst.copyright, "This content from LOINC ® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use.") - self.assertEqual(inst.date.date, FHIRDate("2015-06-22").date) - self.assertEqual(inst.date.as_json(), "2015-06-22") - self.assertEqual(inst.description, "This is an example value set that includes all the LOINC codes for serum/plasma cholesterol from v2.36.") - self.assertTrue(inst.experimental) - self.assertEqual(inst.id, "example-extensional") - self.assertEqual(inst.identifier[0].system, "http://acme.com/identifiers/valuesets") - self.assertEqual(inst.identifier[0].value, "loinc-cholesterol-int") - self.assertEqual(inst.jurisdiction[0].coding[0].code, "US") - self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") - self.assertEqual(inst.meta.profile[0], "http://hl7.org/fhir/StructureDefinition/shareablevalueset") - self.assertEqual(inst.name, "LOINC Codes for Cholesterol in Serum/Plasma") - self.assertEqual(inst.publisher, "HL7 International") - self.assertEqual(inst.purpose, "This value set was published by ACME Inc in order to make clear which codes are used for Cholesterol by AcmeClinicals (Adult Ambulatory care support in USA)") - self.assertEqual(inst.status, "draft") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.url, "http://hl7.org/fhir/ValueSet/example-extensional") - self.assertEqual(inst.useContext[0].code.code, "age") - self.assertEqual(inst.useContext[0].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") - self.assertEqual(inst.useContext[0].valueQuantity.code, "a") - self.assertEqual(inst.useContext[0].valueQuantity.comparator, ">") - self.assertEqual(inst.useContext[0].valueQuantity.system, "http://unitsofmeasure.org") - self.assertEqual(inst.useContext[0].valueQuantity.unit, "yrs") - self.assertEqual(inst.useContext[0].valueQuantity.value, 18) - self.assertEqual(inst.version, "20150622") - - def testValueSet2(self): - inst = self.instantiate_from("valueset-example-hierarchical.json") - self.assertIsNotNone(inst, "Must have instantiated a ValueSet instance") - self.implValueSet2(inst) - - js = inst.as_json() - self.assertEqual("ValueSet", js["resourceType"]) - inst2 = valueset.ValueSet(js) - self.implValueSet2(inst2) - - def implValueSet2(self, inst): self.assertEqual(inst.compose.include[0].concept[0].code, "invalid") self.assertEqual(inst.compose.include[0].concept[1].code, "structure") self.assertEqual(inst.compose.include[0].concept[2].code, "required") @@ -105,32 +52,32 @@ def implValueSet2(self, inst): self.assertEqual(inst.compose.include[0].extension[1].extension[2].valueCode, "conflict") self.assertEqual(inst.compose.include[0].extension[1].url, "http://hl7.org/fhir/StructureDefinition/valueset-expand-group") self.assertEqual(inst.compose.include[0].extension[2].extension[0].url, "code") - self.assertEqual(inst.compose.include[0].extension[2].extension[0].valueString, "processing") + self.assertEqual(inst.compose.include[0].extension[2].extension[0].valueCode, "processing") self.assertEqual(inst.compose.include[0].extension[2].extension[1].url, "member") self.assertEqual(inst.compose.include[0].extension[2].extension[1].valueCode, "duplicate") self.assertEqual(inst.compose.include[0].extension[2].extension[2].url, "member") self.assertEqual(inst.compose.include[0].extension[2].extension[2].valueCode, "not-found") self.assertEqual(inst.compose.include[0].extension[2].url, "http://hl7.org/fhir/StructureDefinition/valueset-expand-group") self.assertEqual(inst.compose.include[0].extension[3].extension[0].url, "code") - self.assertEqual(inst.compose.include[0].extension[3].extension[0].valueString, "invalid") + self.assertEqual(inst.compose.include[0].extension[3].extension[0].valueCode, "invalid") self.assertEqual(inst.compose.include[0].extension[3].extension[1].url, "member") self.assertEqual(inst.compose.include[0].extension[3].extension[1].valueCode, "structure") self.assertEqual(inst.compose.include[0].extension[3].extension[2].url, "member") self.assertEqual(inst.compose.include[0].extension[3].extension[2].valueCode, "required") - self.assertEqual(inst.compose.include[0].extension[3].extension[3].url, "value") - self.assertEqual(inst.compose.include[0].extension[3].extension[3].valueCode, "required") + self.assertEqual(inst.compose.include[0].extension[3].extension[3].url, "member") + self.assertEqual(inst.compose.include[0].extension[3].extension[3].valueCode, "value") self.assertEqual(inst.compose.include[0].extension[3].url, "http://hl7.org/fhir/StructureDefinition/valueset-expand-group") self.assertEqual(inst.compose.include[0].extension[4].extension[0].url, "code") - self.assertEqual(inst.compose.include[0].extension[4].extension[0].valueString, "transient") + self.assertEqual(inst.compose.include[0].extension[4].extension[0].valueCode, "transient") self.assertEqual(inst.compose.include[0].extension[4].extension[1].url, "member") self.assertEqual(inst.compose.include[0].extension[4].extension[1].valueCode, "lock") self.assertEqual(inst.compose.include[0].extension[4].extension[2].url, "member") self.assertEqual(inst.compose.include[0].extension[4].extension[2].valueCode, "exception") - self.assertEqual(inst.compose.include[0].extension[4].extension[3].url, "value") + self.assertEqual(inst.compose.include[0].extension[4].extension[3].url, "member") self.assertEqual(inst.compose.include[0].extension[4].extension[3].valueCode, "throttled") self.assertEqual(inst.compose.include[0].extension[4].url, "http://hl7.org/fhir/StructureDefinition/valueset-expand-group") self.assertEqual(inst.compose.include[0].extension[5].extension[0].url, "code") - self.assertEqual(inst.compose.include[0].extension[5].extension[0].valueString, "security") + self.assertEqual(inst.compose.include[0].extension[5].extension[0].valueCode, "security") self.assertEqual(inst.compose.include[0].extension[5].extension[1].url, "member") self.assertEqual(inst.compose.include[0].extension[5].extension[1].valueCode, "login") self.assertEqual(inst.compose.include[0].extension[5].extension[2].url, "member") @@ -209,19 +156,19 @@ def implValueSet2(self, inst): self.assertEqual(inst.status, "draft") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.url, "http://hl7.org/fhir/ValueSet/example-hierarchical") - self.assertEqual(inst.version, "4.0.0") + self.assertEqual(inst.version, "4.0.1") - def testValueSet3(self): + def testValueSet2(self): inst = self.instantiate_from("valueset-example-expansion.json") self.assertIsNotNone(inst, "Must have instantiated a ValueSet instance") - self.implValueSet3(inst) + self.implValueSet2(inst) js = inst.as_json() self.assertEqual("ValueSet", js["resourceType"]) inst2 = valueset.ValueSet(js) - self.implValueSet3(inst2) + self.implValueSet2(inst2) - def implValueSet3(self, inst): + def implValueSet2(self, inst): self.assertEqual(inst.compose.include[0].filter[0].op, "=") self.assertEqual(inst.compose.include[0].filter[0].property, "parent") self.assertEqual(inst.compose.include[0].filter[0].value, "LP43571-6") @@ -287,8 +234,47 @@ def implValueSet3(self, inst): self.assertEqual(inst.url, "http://hl7.org/fhir/ValueSet/example-expansion") self.assertEqual(inst.version, "20150622") + def testValueSet3(self): + inst = self.instantiate_from("valueset-list-example-codes.json") + self.assertIsNotNone(inst, "Must have instantiated a ValueSet instance") + self.implValueSet3(inst) + + js = inst.as_json() + self.assertEqual("ValueSet", js["resourceType"]) + inst2 = valueset.ValueSet(js) + self.implValueSet3(inst2) + + def implValueSet3(self, inst): + self.assertEqual(inst.compose.include[0].system, "http://terminology.hl7.org/CodeSystem/list-example-use-codes") + self.assertEqual(inst.contact[0].telecom[0].system, "url") + self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org/fhir") + self.assertEqual(inst.date.date, FHIRDate("2019-11-01T09:29:23+11:00").date) + self.assertEqual(inst.date.as_json(), "2019-11-01T09:29:23+11:00") + self.assertEqual(inst.description, "Example use codes for the List resource - typical kinds of use.") + self.assertFalse(inst.experimental) + self.assertEqual(inst.extension[0].url, "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg") + self.assertEqual(inst.extension[0].valueCode, "fhir") + self.assertEqual(inst.extension[1].url, "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status") + self.assertEqual(inst.extension[1].valueCode, "draft") + self.assertEqual(inst.extension[2].url, "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm") + self.assertEqual(inst.extension[2].valueInteger, 1) + self.assertEqual(inst.id, "list-example-codes") + self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") + self.assertEqual(inst.identifier[0].value, "urn:oid:2.16.840.1.113883.4.642.3.316") + self.assertTrue(inst.immutable) + self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2019-11-01T09:29:23.356+11:00").date) + self.assertEqual(inst.meta.lastUpdated.as_json(), "2019-11-01T09:29:23.356+11:00") + self.assertEqual(inst.meta.profile[0], "http://hl7.org/fhir/StructureDefinition/shareablevalueset") + self.assertEqual(inst.name, "ExampleUseCodesForList") + self.assertEqual(inst.publisher, "FHIR Project") + self.assertEqual(inst.status, "draft") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.title, "Example Use Codes for List") + self.assertEqual(inst.url, "http://hl7.org/fhir/ValueSet/list-example-codes") + self.assertEqual(inst.version, "4.0.1") + def testValueSet4(self): - inst = self.instantiate_from("valueset-example-inactive.json") + inst = self.instantiate_from("valueset-example-yesnodontknow.json") self.assertIsNotNone(inst, "Must have instantiated a ValueSet instance") self.implValueSet4(inst) @@ -298,41 +284,32 @@ def testValueSet4(self): self.implValueSet4(inst2) def implValueSet4(self, inst): - self.assertTrue(inst.compose.inactive) - self.assertEqual(inst.compose.include[0].filter[0].op, "descendent-of") - self.assertEqual(inst.compose.include[0].filter[0].property, "concept") - self.assertEqual(inst.compose.include[0].filter[0].value, "_ActMoodPredicate") - self.assertEqual(inst.compose.include[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActMood") - self.assertEqual(inst.description, "HL7 v3 ActMood Predicate codes, including inactive codes") - self.assertEqual(inst.expansion.contains[0].code, "CRT") - self.assertEqual(inst.expansion.contains[0].display, "criterion") - self.assertTrue(inst.expansion.contains[0].inactive) - self.assertEqual(inst.expansion.contains[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActMood") - self.assertEqual(inst.expansion.contains[1].code, "EXPEC") - self.assertEqual(inst.expansion.contains[1].contains[0].code, "GOL") - self.assertEqual(inst.expansion.contains[1].contains[0].display, "goal") - self.assertEqual(inst.expansion.contains[1].contains[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActMood") - self.assertEqual(inst.expansion.contains[1].contains[1].code, "RSK") - self.assertEqual(inst.expansion.contains[1].contains[1].display, "risk") - self.assertEqual(inst.expansion.contains[1].contains[1].system, "http://terminology.hl7.org/CodeSystem/v3-ActMood") - self.assertEqual(inst.expansion.contains[1].display, "expectation") - self.assertEqual(inst.expansion.contains[1].system, "http://terminology.hl7.org/CodeSystem/v3-ActMood") - self.assertEqual(inst.expansion.contains[2].code, "OPT") - self.assertEqual(inst.expansion.contains[2].display, "option") - self.assertEqual(inst.expansion.contains[2].system, "http://terminology.hl7.org/CodeSystem/v3-ActMood") - self.assertEqual(inst.expansion.identifier, "urn:uuid:46c00b3f-003a-4f31-9d4b-ea2de58b2a99") - self.assertEqual(inst.expansion.timestamp.date, FHIRDate("2017-02-26T10:00:00Z").date) - self.assertEqual(inst.expansion.timestamp.as_json(), "2017-02-26T10:00:00Z") - self.assertEqual(inst.id, "inactive") - self.assertEqual(inst.name, "Example-inactive") + self.assertEqual(inst.compose.include[0].valueSet[0], "http://terminology.hl7.org/ValueSet/v2-0136") + self.assertEqual(inst.compose.include[1].concept[0].code, "asked-unknown") + self.assertEqual(inst.compose.include[1].concept[0].display, "Don't know") + self.assertEqual(inst.compose.include[1].system, "http://terminology.hl7.org/CodeSystem/data-absent-reason") + self.assertEqual(inst.description, "For Capturing simple yes-no-don't know answers") + self.assertEqual(inst.expansion.contains[0].code, "Y") + self.assertEqual(inst.expansion.contains[0].display, "Yes") + self.assertEqual(inst.expansion.contains[0].system, "http://terminology.hl7.org/CodeSystem/v2-0136") + self.assertEqual(inst.expansion.contains[1].code, "N") + self.assertEqual(inst.expansion.contains[1].display, "No") + self.assertEqual(inst.expansion.contains[1].system, "http://terminology.hl7.org/CodeSystem/v2-0136") + self.assertEqual(inst.expansion.contains[2].code, "asked-unknown") + self.assertEqual(inst.expansion.contains[2].display, "Don't know") + self.assertEqual(inst.expansion.contains[2].system, "http://terminology.hl7.org/CodeSystem/data-absent-reason") + self.assertEqual(inst.expansion.identifier, "urn:uuid:bf99fe50-2c2b-41ad-bd63-bee6919810b4") + self.assertEqual(inst.expansion.timestamp.date, FHIRDate("2015-07-14T10:00:00Z").date) + self.assertEqual(inst.expansion.timestamp.as_json(), "2015-07-14T10:00:00Z") + self.assertEqual(inst.id, "yesnodontknow") + self.assertEqual(inst.name, "Yes/No/Don't Know") self.assertEqual(inst.status, "draft") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.title, "Example with inactive codes") - self.assertEqual(inst.url, "http://hl7.org/fhir/ValueSet/inactive") - self.assertEqual(inst.version, "4.0.0") + self.assertEqual(inst.url, "http://hl7.org/fhir/ValueSet/yesnodontknow") + self.assertEqual(inst.version, "4.0.1") def testValueSet5(self): - inst = self.instantiate_from("valueset-example-filter.json") + inst = self.instantiate_from("valueset-example.json") self.assertIsNotNone(inst, "Must have instantiated a ValueSet instance") self.implValueSet5(inst) @@ -342,6 +319,59 @@ def testValueSet5(self): self.implValueSet5(inst2) def implValueSet5(self, inst): + self.assertTrue(inst.compose.inactive) + self.assertEqual(inst.compose.include[0].concept[0].code, "14647-2") + self.assertEqual(inst.compose.include[0].concept[0].display, "Cholesterol [Moles/Volume]") + self.assertEqual(inst.compose.include[0].concept[1].code, "2093-3") + self.assertEqual(inst.compose.include[0].concept[1].display, "Cholesterol [Mass/Volume]") + self.assertEqual(inst.compose.include[0].concept[2].code, "35200-5") + self.assertEqual(inst.compose.include[0].concept[2].display, "Cholesterol [Mass Or Moles/Volume]") + self.assertEqual(inst.compose.include[0].concept[3].code, "9342-7") + self.assertEqual(inst.compose.include[0].concept[3].display, "Cholesterol [Percentile]") + self.assertEqual(inst.compose.include[0].system, "http://loinc.org") + self.assertEqual(inst.compose.include[0].version, "2.36") + self.assertEqual(inst.compose.lockedDate.date, FHIRDate("2012-06-13").date) + self.assertEqual(inst.compose.lockedDate.as_json(), "2012-06-13") + self.assertEqual(inst.contact[0].name, "FHIR project team") + self.assertEqual(inst.contact[0].telecom[0].system, "url") + self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org/fhir") + self.assertEqual(inst.copyright, "This content from LOINC ® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use.") + self.assertEqual(inst.date.date, FHIRDate("2015-06-22").date) + self.assertEqual(inst.date.as_json(), "2015-06-22") + self.assertEqual(inst.description, "This is an example value set that includes all the LOINC codes for serum/plasma cholesterol from v2.36.") + self.assertTrue(inst.experimental) + self.assertEqual(inst.id, "example-extensional") + self.assertEqual(inst.identifier[0].system, "http://acme.com/identifiers/valuesets") + self.assertEqual(inst.identifier[0].value, "loinc-cholesterol-int") + self.assertEqual(inst.jurisdiction[0].coding[0].code, "US") + self.assertEqual(inst.jurisdiction[0].coding[0].system, "urn:iso:std:iso:3166") + self.assertEqual(inst.meta.profile[0], "http://hl7.org/fhir/StructureDefinition/shareablevalueset") + self.assertEqual(inst.name, "LOINC Codes for Cholesterol in Serum/Plasma") + self.assertEqual(inst.publisher, "HL7 International") + self.assertEqual(inst.purpose, "This value set was published by ACME Inc in order to make clear which codes are used for Cholesterol by AcmeClinicals (Adult Ambulatory care support in USA)") + self.assertEqual(inst.status, "draft") + self.assertEqual(inst.text.status, "generated") + self.assertEqual(inst.url, "http://hl7.org/fhir/ValueSet/example-extensional") + self.assertEqual(inst.useContext[0].code.code, "age") + self.assertEqual(inst.useContext[0].code.system, "http://terminology.hl7.org/CodeSystem/usage-context-type") + self.assertEqual(inst.useContext[0].valueQuantity.code, "a") + self.assertEqual(inst.useContext[0].valueQuantity.comparator, ">") + self.assertEqual(inst.useContext[0].valueQuantity.system, "http://unitsofmeasure.org") + self.assertEqual(inst.useContext[0].valueQuantity.unit, "yrs") + self.assertEqual(inst.useContext[0].valueQuantity.value, 18) + self.assertEqual(inst.version, "20150622") + + def testValueSet6(self): + inst = self.instantiate_from("valueset-example-filter.json") + self.assertIsNotNone(inst, "Must have instantiated a ValueSet instance") + self.implValueSet6(inst) + + js = inst.as_json() + self.assertEqual("ValueSet", js["resourceType"]) + inst2 = valueset.ValueSet(js) + self.implValueSet6(inst2) + + def implValueSet6(self, inst): self.assertEqual(inst.compose.include[0].filter[0].op, "=") self.assertEqual(inst.compose.include[0].filter[0].property, "acme-plasma") self.assertEqual(inst.compose.include[0].filter[0].value, "true") @@ -360,61 +390,70 @@ def implValueSet5(self, inst): self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.title, "ACME Codes for Cholesterol: Plasma only") self.assertEqual(inst.url, "http://hl7.org/fhir/ValueSet/example-filter") - self.assertEqual(inst.version, "4.0.0") + self.assertEqual(inst.version, "4.0.1") - def testValueSet6(self): - inst = self.instantiate_from("valueset-example-yesnodontknow.json") + def testValueSet7(self): + inst = self.instantiate_from("valueset-example-inactive.json") self.assertIsNotNone(inst, "Must have instantiated a ValueSet instance") - self.implValueSet6(inst) + self.implValueSet7(inst) js = inst.as_json() self.assertEqual("ValueSet", js["resourceType"]) inst2 = valueset.ValueSet(js) - self.implValueSet6(inst2) + self.implValueSet7(inst2) - def implValueSet6(self, inst): - self.assertEqual(inst.compose.include[0].valueSet[0], "http://terminology.hl7.org/ValueSet/v2-0136") - self.assertEqual(inst.compose.include[1].concept[0].code, "asked-unknown") - self.assertEqual(inst.compose.include[1].concept[0].display, "Don't know") - self.assertEqual(inst.compose.include[1].system, "http://terminology.hl7.org/CodeSystem/data-absent-reason") - self.assertEqual(inst.description, "For Capturing simple yes-no-don't know answers") - self.assertEqual(inst.expansion.contains[0].code, "Y") - self.assertEqual(inst.expansion.contains[0].display, "Yes") - self.assertEqual(inst.expansion.contains[0].system, "http://terminology.hl7.org/CodeSystem/v2-0136") - self.assertEqual(inst.expansion.contains[1].code, "N") - self.assertEqual(inst.expansion.contains[1].display, "No") - self.assertEqual(inst.expansion.contains[1].system, "http://terminology.hl7.org/CodeSystem/v2-0136") - self.assertEqual(inst.expansion.contains[2].code, "asked-unknown") - self.assertEqual(inst.expansion.contains[2].display, "Don't know") - self.assertEqual(inst.expansion.contains[2].system, "http://terminology.hl7.org/CodeSystem/data-absent-reason") - self.assertEqual(inst.expansion.identifier, "urn:uuid:bf99fe50-2c2b-41ad-bd63-bee6919810b4") - self.assertEqual(inst.expansion.timestamp.date, FHIRDate("2015-07-14T10:00:00Z").date) - self.assertEqual(inst.expansion.timestamp.as_json(), "2015-07-14T10:00:00Z") - self.assertEqual(inst.id, "yesnodontknow") - self.assertEqual(inst.name, "Yes/No/Don't Know") + def implValueSet7(self, inst): + self.assertTrue(inst.compose.inactive) + self.assertEqual(inst.compose.include[0].filter[0].op, "descendent-of") + self.assertEqual(inst.compose.include[0].filter[0].property, "concept") + self.assertEqual(inst.compose.include[0].filter[0].value, "_ActMoodPredicate") + self.assertEqual(inst.compose.include[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActMood") + self.assertEqual(inst.description, "HL7 v3 ActMood Predicate codes, including inactive codes") + self.assertEqual(inst.expansion.contains[0].code, "CRT") + self.assertEqual(inst.expansion.contains[0].display, "criterion") + self.assertTrue(inst.expansion.contains[0].inactive) + self.assertEqual(inst.expansion.contains[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActMood") + self.assertEqual(inst.expansion.contains[1].code, "EXPEC") + self.assertEqual(inst.expansion.contains[1].contains[0].code, "GOL") + self.assertEqual(inst.expansion.contains[1].contains[0].display, "goal") + self.assertEqual(inst.expansion.contains[1].contains[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActMood") + self.assertEqual(inst.expansion.contains[1].contains[1].code, "RSK") + self.assertEqual(inst.expansion.contains[1].contains[1].display, "risk") + self.assertEqual(inst.expansion.contains[1].contains[1].system, "http://terminology.hl7.org/CodeSystem/v3-ActMood") + self.assertEqual(inst.expansion.contains[1].display, "expectation") + self.assertEqual(inst.expansion.contains[1].system, "http://terminology.hl7.org/CodeSystem/v3-ActMood") + self.assertEqual(inst.expansion.contains[2].code, "OPT") + self.assertEqual(inst.expansion.contains[2].display, "option") + self.assertEqual(inst.expansion.contains[2].system, "http://terminology.hl7.org/CodeSystem/v3-ActMood") + self.assertEqual(inst.expansion.identifier, "urn:uuid:46c00b3f-003a-4f31-9d4b-ea2de58b2a99") + self.assertEqual(inst.expansion.timestamp.date, FHIRDate("2017-02-26T10:00:00Z").date) + self.assertEqual(inst.expansion.timestamp.as_json(), "2017-02-26T10:00:00Z") + self.assertEqual(inst.id, "inactive") + self.assertEqual(inst.name, "Example-inactive") self.assertEqual(inst.status, "draft") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.url, "http://hl7.org/fhir/ValueSet/yesnodontknow") - self.assertEqual(inst.version, "4.0.0") + self.assertEqual(inst.title, "Example with inactive codes") + self.assertEqual(inst.url, "http://hl7.org/fhir/ValueSet/inactive") + self.assertEqual(inst.version, "4.0.1") - def testValueSet7(self): + def testValueSet8(self): inst = self.instantiate_from("valueset-examplescenario-actor-type.json") self.assertIsNotNone(inst, "Must have instantiated a ValueSet instance") - self.implValueSet7(inst) + self.implValueSet8(inst) js = inst.as_json() self.assertEqual("ValueSet", js["resourceType"]) inst2 = valueset.ValueSet(js) - self.implValueSet7(inst2) + self.implValueSet8(inst2) - def implValueSet7(self, inst): + def implValueSet8(self, inst): self.assertEqual(inst.compose.include[0].system, "http://hl7.org/fhir/examplescenario-actor-type") self.assertEqual(inst.contact[0].telecom[0].system, "url") self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org/fhir") self.assertEqual(inst.contact[0].telecom[1].system, "email") self.assertEqual(inst.contact[0].telecom[1].value, "fhir@lists.hl7.org") - self.assertEqual(inst.date.date, FHIRDate("2018-12-27T22:37:54+11:00").date) - self.assertEqual(inst.date.as_json(), "2018-12-27T22:37:54+11:00") + self.assertEqual(inst.date.date, FHIRDate("2019-11-01T09:29:23+11:00").date) + self.assertEqual(inst.date.as_json(), "2019-11-01T09:29:23+11:00") self.assertEqual(inst.description, "The type of actor - system or human.") self.assertFalse(inst.experimental) self.assertEqual(inst.extension[0].url, "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg") @@ -427,8 +466,8 @@ def implValueSet7(self, inst): self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") self.assertEqual(inst.identifier[0].value, "urn:oid:2.16.840.1.113883.4.642.3.858") self.assertTrue(inst.immutable) - self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2018-12-27T22:37:54.724+11:00").date) - self.assertEqual(inst.meta.lastUpdated.as_json(), "2018-12-27T22:37:54.724+11:00") + self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2019-11-01T09:29:23.356+11:00").date) + self.assertEqual(inst.meta.lastUpdated.as_json(), "2019-11-01T09:29:23.356+11:00") self.assertEqual(inst.meta.profile[0], "http://hl7.org/fhir/StructureDefinition/shareablevalueset") self.assertEqual(inst.name, "ExampleScenarioActorType") self.assertEqual(inst.publisher, "HL7 (FHIR Project)") @@ -436,46 +475,7 @@ def implValueSet7(self, inst): self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.title, "ExampleScenarioActorType") self.assertEqual(inst.url, "http://hl7.org/fhir/ValueSet/examplescenario-actor-type") - self.assertEqual(inst.version, "4.0.0") - - def testValueSet8(self): - inst = self.instantiate_from("valueset-list-example-codes.json") - self.assertIsNotNone(inst, "Must have instantiated a ValueSet instance") - self.implValueSet8(inst) - - js = inst.as_json() - self.assertEqual("ValueSet", js["resourceType"]) - inst2 = valueset.ValueSet(js) - self.implValueSet8(inst2) - - def implValueSet8(self, inst): - self.assertEqual(inst.compose.include[0].system, "http://terminology.hl7.org/CodeSystem/list-example-use-codes") - self.assertEqual(inst.contact[0].telecom[0].system, "url") - self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org/fhir") - self.assertEqual(inst.date.date, FHIRDate("2018-12-27T22:37:54+11:00").date) - self.assertEqual(inst.date.as_json(), "2018-12-27T22:37:54+11:00") - self.assertEqual(inst.description, "Example use codes for the List resource - typical kinds of use.") - self.assertFalse(inst.experimental) - self.assertEqual(inst.extension[0].url, "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg") - self.assertEqual(inst.extension[0].valueCode, "fhir") - self.assertEqual(inst.extension[1].url, "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status") - self.assertEqual(inst.extension[1].valueCode, "draft") - self.assertEqual(inst.extension[2].url, "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm") - self.assertEqual(inst.extension[2].valueInteger, 1) - self.assertEqual(inst.id, "list-example-codes") - self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") - self.assertEqual(inst.identifier[0].value, "urn:oid:2.16.840.1.113883.4.642.3.316") - self.assertTrue(inst.immutable) - self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2018-12-27T22:37:54.724+11:00").date) - self.assertEqual(inst.meta.lastUpdated.as_json(), "2018-12-27T22:37:54.724+11:00") - self.assertEqual(inst.meta.profile[0], "http://hl7.org/fhir/StructureDefinition/shareablevalueset") - self.assertEqual(inst.name, "ExampleUseCodesForList") - self.assertEqual(inst.publisher, "FHIR Project") - self.assertEqual(inst.status, "draft") - self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.title, "Example Use Codes for List") - self.assertEqual(inst.url, "http://hl7.org/fhir/ValueSet/list-example-codes") - self.assertEqual(inst.version, "4.0.0") + self.assertEqual(inst.version, "4.0.1") def testValueSet9(self): inst = self.instantiate_from("valueset-example-intensional.json") diff --git a/fhirclient/models/verificationresult.py b/fhirclient/models/verificationresult.py index 6231f5508..b5aa4c5aa 100644 --- a/fhirclient/models/verificationresult.py +++ b/fhirclient/models/verificationresult.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/VerificationResult) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/VerificationResult) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/verificationresult_tests.py b/fhirclient/models/verificationresult_tests.py index 4e96e66dd..3d5e20954 100644 --- a/fhirclient/models/verificationresult_tests.py +++ b/fhirclient/models/verificationresult_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os diff --git a/fhirclient/models/visionprescription.py b/fhirclient/models/visionprescription.py index e94052e81..110103e53 100644 --- a/fhirclient/models/visionprescription.py +++ b/fhirclient/models/visionprescription.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/VisionPrescription) on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/VisionPrescription) on 2024-07-15. +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/visionprescription_tests.py b/fhirclient/models/visionprescription_tests.py index 01a2d0a9d..e9723a46b 100644 --- a/fhirclient/models/visionprescription_tests.py +++ b/fhirclient/models/visionprescription_tests.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07. -# 2019, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# 2024, SMART Health IT. import os @@ -22,7 +22,7 @@ def instantiate_from(self, filename): return visionprescription.VisionPrescription(js) def testVisionPrescription1(self): - inst = self.instantiate_from("visionprescription-example-1.json") + inst = self.instantiate_from("visionprescription-example.json") self.assertIsNotNone(inst, "Must have instantiated a VisionPrescription instance") self.implVisionPrescription1(inst) @@ -32,6 +32,46 @@ def testVisionPrescription1(self): self.implVisionPrescription1(inst2) def implVisionPrescription1(self, inst): + self.assertEqual(inst.created.date, FHIRDate("2014-06-15").date) + self.assertEqual(inst.created.as_json(), "2014-06-15") + self.assertEqual(inst.dateWritten.date, FHIRDate("2014-06-15").date) + self.assertEqual(inst.dateWritten.as_json(), "2014-06-15") + self.assertEqual(inst.id, "33123") + self.assertEqual(inst.identifier[0].system, "http://www.happysight.com/prescription") + self.assertEqual(inst.identifier[0].value, "15013") + self.assertEqual(inst.lensSpecification[0].add, 2.0) + self.assertEqual(inst.lensSpecification[0].eye, "right") + self.assertEqual(inst.lensSpecification[0].prism[0].amount, 0.5) + self.assertEqual(inst.lensSpecification[0].prism[0].base, "down") + self.assertEqual(inst.lensSpecification[0].product.coding[0].code, "lens") + self.assertEqual(inst.lensSpecification[0].product.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct") + self.assertEqual(inst.lensSpecification[0].sphere, -2.0) + self.assertEqual(inst.lensSpecification[1].add, 2.0) + self.assertEqual(inst.lensSpecification[1].axis, 180) + self.assertEqual(inst.lensSpecification[1].cylinder, -0.5) + self.assertEqual(inst.lensSpecification[1].eye, "left") + self.assertEqual(inst.lensSpecification[1].prism[0].amount, 0.5) + self.assertEqual(inst.lensSpecification[1].prism[0].base, "up") + self.assertEqual(inst.lensSpecification[1].product.coding[0].code, "lens") + self.assertEqual(inst.lensSpecification[1].product.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct") + self.assertEqual(inst.lensSpecification[1].sphere, -1.0) + self.assertEqual(inst.meta.tag[0].code, "HTEST") + self.assertEqual(inst.meta.tag[0].display, "test health data") + self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") + self.assertEqual(inst.status, "active") + self.assertEqual(inst.text.status, "generated") + + def testVisionPrescription2(self): + inst = self.instantiate_from("visionprescription-example-1.json") + self.assertIsNotNone(inst, "Must have instantiated a VisionPrescription instance") + self.implVisionPrescription2(inst) + + js = inst.as_json() + self.assertEqual("VisionPrescription", js["resourceType"]) + inst2 = visionprescription.VisionPrescription(js) + self.implVisionPrescription2(inst2) + + def implVisionPrescription2(self, inst): self.assertEqual(inst.created.date, FHIRDate("2014-06-15").date) self.assertEqual(inst.created.as_json(), "2014-06-15") self.assertEqual(inst.dateWritten.date, FHIRDate("2014-06-15").date) @@ -77,44 +117,4 @@ def implVisionPrescription1(self, inst): self.assertEqual(inst.status, "active") self.assertEqual(inst.text.div, "
Sample Contract Lens prescription
") self.assertEqual(inst.text.status, "generated") - - def testVisionPrescription2(self): - inst = self.instantiate_from("visionprescription-example.json") - self.assertIsNotNone(inst, "Must have instantiated a VisionPrescription instance") - self.implVisionPrescription2(inst) - - js = inst.as_json() - self.assertEqual("VisionPrescription", js["resourceType"]) - inst2 = visionprescription.VisionPrescription(js) - self.implVisionPrescription2(inst2) - - def implVisionPrescription2(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-06-15").date) - self.assertEqual(inst.created.as_json(), "2014-06-15") - self.assertEqual(inst.dateWritten.date, FHIRDate("2014-06-15").date) - self.assertEqual(inst.dateWritten.as_json(), "2014-06-15") - self.assertEqual(inst.id, "33123") - self.assertEqual(inst.identifier[0].system, "http://www.happysight.com/prescription") - self.assertEqual(inst.identifier[0].value, "15013") - self.assertEqual(inst.lensSpecification[0].add, 2.0) - self.assertEqual(inst.lensSpecification[0].eye, "right") - self.assertEqual(inst.lensSpecification[0].prism[0].amount, 0.5) - self.assertEqual(inst.lensSpecification[0].prism[0].base, "down") - self.assertEqual(inst.lensSpecification[0].product.coding[0].code, "lens") - self.assertEqual(inst.lensSpecification[0].product.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct") - self.assertEqual(inst.lensSpecification[0].sphere, -2.0) - self.assertEqual(inst.lensSpecification[1].add, 2.0) - self.assertEqual(inst.lensSpecification[1].axis, 180) - self.assertEqual(inst.lensSpecification[1].cylinder, -0.5) - self.assertEqual(inst.lensSpecification[1].eye, "left") - self.assertEqual(inst.lensSpecification[1].prism[0].amount, 0.5) - self.assertEqual(inst.lensSpecification[1].prism[0].base, "up") - self.assertEqual(inst.lensSpecification[1].product.coding[0].code, "lens") - self.assertEqual(inst.lensSpecification[1].product.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-visionprescriptionproduct") - self.assertEqual(inst.lensSpecification[1].sphere, -1.0) - self.assertEqual(inst.meta.tag[0].code, "HTEST") - self.assertEqual(inst.meta.tag[0].display, "test health data") - self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.status, "active") - self.assertEqual(inst.text.status, "generated") diff --git a/fhirclient/server_tests.py b/fhirclient/server_tests.py index 22ce2ebdf..0f7eb7f50 100755 --- a/fhirclient/server_tests.py +++ b/fhirclient/server_tests.py @@ -17,7 +17,7 @@ def tearDown(self): os.remove('metadata') def testValidCapabilityStatement(self): - shutil.copyfile('test_metadata_valid.json', 'metadata') + shutil.copyfile('fhirclient/test_metadata_valid.json', 'metadata') mock = MockServer() mock.get_capability() @@ -26,7 +26,7 @@ def testValidCapabilityStatement(self): self.assertIsNotNone(mock.auth._token_uri) def testStateConservation(self): - shutil.copyfile('test_metadata_valid.json', 'metadata') + shutil.copyfile('fhirclient/test_metadata_valid.json', 'metadata') mock = MockServer() self.assertIsNotNone(mock.capabilityStatement) @@ -36,7 +36,7 @@ def testStateConservation(self): self.assertIsNotNone(fhir.auth._token_uri) def testInvalidCapabilityStatement(self): - shutil.copyfile('test_metadata_invalid.json', 'metadata') + shutil.copyfile('fhirclient/test_metadata_invalid.json', 'metadata') mock = MockServer() try: mock.get_capability() diff --git a/setup.cfg b/setup.cfg index 0e320e820..ed4d135ce 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,6 @@ -[pytest] -addopts = --cov pem --cov-report term-missing +[tool:pytest] minversion = 2.5 -strict = true +python_files = *_tests.py [wheel] # Since we're a pure Python package, we can mark our wheels as universal. diff --git a/tox.ini b/tox.ini deleted file mode 100644 index b43ed2dab..000000000 --- a/tox.ini +++ /dev/null @@ -1,24 +0,0 @@ -[tox] -envlist = py27, py33, py34, py35, pypy -[testenv] -deps= - certifi - pytest - pytest-cov - pretend - pyopenssl -commands= - py.test test_fhirclient.py - -[testenv:py33] -deps= - certifi - pytest - pytest-cov - pretend - coverage - pyopenssl - -[testenv:py34] -deps= - {[testenv:py33]deps}