From c9ca8d67defe79f5ec29fc7dd3f33ede5f15f43b Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Wed, 17 Jul 2024 09:36:53 -0400 Subject: [PATCH] Overhaul how date & time parsing works. This commit breaks FHIRDate into four classes: - FHIRDate - FHIRDateTime - FHIRInstant - FHIRTime BREAKING CHANGES: - If consuming code were inspecting the elementProperties array and doing a check like `element_type is FHIRDate`, that will now fail for `datetime`, `instant`, and `time` elements. Backwards compatibility is however maintained for checks written like `issubclass(element_type, FHIRDate)`. Instances have a similar resolution: `isinstance(obj, FHIRDate)` will still work. - If consuming code were manually creating FHIRDate objects themselves with a time component, that will now fail with a ValueError. Since the first item is unavoidable if we want to fix the bugs listed below and has a workaround that works before and after this change, and the second item is not an expected workflow, I hope that such breaking changes do not cause too much harm for consumers. BUG FIXES: - FHIR `time` fields are now correctly parsed. Previously, a time of "10:12:14" would result in a **date** of "1001-01-01" - Passing too much detail to a `date` field or too little detail to an `instant` field will now correctly throw a validation error. For example, a Patient.birthDate field with a time. Or an Observation.issued field with just a year. - Sub-seconds would be incorrectly chopped off of a `datetime`'s `.isostring` (which the FHIR spec allows us to do) and an `instant`'s `.isostring` (which the FHIR spec **does not** allow us to do). The `.date` Python representation and the `.as_json()` call would both work correctly and keep the sub-seconds. Only `.isostring` was affected. IMPROVEMENTS: - Leap seconds are now half-supported. The FHIR spec says clients "SHOULD accept and handle leap seconds gracefully", which we do... By dropping the leap second on the floor and rolling back to :59. But this is an improvement on previous behavior of a validation error. The `.as_json()` value will still preserve the leap second. - The `.date` field is now always the appropriate type (datetime.date for FHIRDate, datetime.datetime for FHIRDateTime and FHIRInstant, and datetime.time for FHIRTime). Previously, a `datetime` field might result in a datetime.date if only given a date portion. (Which isn't entirely wrong, but consistently providing the same data type is useful.) - The new classes have appropriately named fields in addition to the backwards-compatible `.date` field -- FHIRDateTime.datetime, FHIRInstant.datetime, and FHIRTime.time. These will always be the same value as `.date` for now - but in a future major release, the `.date` alias may be dropped. - The dependency on isodate can now be dropped. It is lightly maintained and the stdlib can handle most of its job nowadays. - Much better class documentation for what sort of things are supported and which are not. --- MAINTAINERS.md | 4 + fhir-parser-resources/fhirabstractresource.py | 1 - fhir-parser-resources/fhirdate.py | 311 +++++++++++++++--- fhir-parser-resources/settings.py | 8 + fhir-parser-resources/template-resource.py | 4 +- fhir-parser-resources/template-unittest.py | 7 +- fhirclient/models/account.py | 4 +- fhirclient/models/activitydefinition.py | 13 +- fhirclient/models/address.py | 4 +- fhirclient/models/adverseevent.py | 16 +- fhirclient/models/age.py | 4 +- fhirclient/models/allergyintolerance.py | 20 +- fhirclient/models/annotation.py | 8 +- fhirclient/models/appointment.py | 17 +- fhirclient/models/appointmentresponse.py | 12 +- fhirclient/models/attachment.py | 8 +- fhirclient/models/auditevent.py | 8 +- fhirclient/models/backboneelement.py | 4 +- fhirclient/models/basic.py | 4 +- fhirclient/models/binary.py | 4 +- .../models/biologicallyderivedproduct.py | 16 +- fhirclient/models/bodystructure.py | 4 +- fhirclient/models/bundle.py | 16 +- fhirclient/models/capabilitystatement.py | 12 +- fhirclient/models/careplan.py | 8 +- fhirclient/models/careteam.py | 4 +- fhirclient/models/catalogentry.py | 12 +- fhirclient/models/chargeitem.py | 12 +- fhirclient/models/chargeitemdefinition.py | 9 +- fhirclient/models/claim.py | 13 +- fhirclient/models/claimresponse.py | 9 +- fhirclient/models/clinicalimpression.py | 12 +- fhirclient/models/codeableconcept.py | 4 +- fhirclient/models/codesystem.py | 12 +- fhirclient/models/coding.py | 4 +- fhirclient/models/communication.py | 12 +- fhirclient/models/communicationrequest.py | 12 +- fhirclient/models/compartmentdefinition.py | 8 +- fhirclient/models/composition.py | 12 +- fhirclient/models/conceptmap.py | 8 +- fhirclient/models/condition.py | 16 +- fhirclient/models/consent.py | 12 +- fhirclient/models/contactdetail.py | 4 +- fhirclient/models/contactpoint.py | 4 +- fhirclient/models/contract.py | 38 ++- fhirclient/models/contributor.py | 4 +- fhirclient/models/count.py | 4 +- fhirclient/models/coverage.py | 4 +- .../models/coverageeligibilityrequest.py | 9 +- .../models/coverageeligibilityresponse.py | 9 +- fhirclient/models/datarequirement.py | 8 +- fhirclient/models/detectedissue.py | 12 +- fhirclient/models/device.py | 12 +- fhirclient/models/devicedefinition.py | 4 +- fhirclient/models/devicemetric.py | 8 +- fhirclient/models/devicerequest.py | 12 +- fhirclient/models/deviceusestatement.py | 12 +- fhirclient/models/diagnosticreport.py | 13 +- fhirclient/models/distance.py | 4 +- fhirclient/models/documentmanifest.py | 8 +- fhirclient/models/documentreference.py | 8 +- fhirclient/models/domainresource.py | 4 +- fhirclient/models/dosage.py | 4 +- fhirclient/models/duration.py | 4 +- fhirclient/models/effectevidencesynthesis.py | 9 +- fhirclient/models/element.py | 4 +- fhirclient/models/elementdefinition.py | 79 ++--- fhirclient/models/encounter.py | 4 +- fhirclient/models/endpoint.py | 4 +- fhirclient/models/enrollmentrequest.py | 8 +- fhirclient/models/enrollmentresponse.py | 8 +- fhirclient/models/episodeofcare.py | 4 +- fhirclient/models/eventdefinition.py | 9 +- fhirclient/models/evidence.py | 9 +- fhirclient/models/evidencevariable.py | 13 +- fhirclient/models/examplescenario.py | 8 +- fhirclient/models/explanationofbenefit.py | 13 +- fhirclient/models/expression.py | 4 +- fhirclient/models/extension.py | 19 +- fhirclient/models/familymemberhistory.py | 9 +- fhirclient/models/fhirabstractresource.py | 1 - fhirclient/models/fhirdate.py | 311 +++++++++++++++--- fhirclient/models/fhirelementfactory.py | 2 +- fhirclient/models/flag.py | 4 +- fhirclient/models/goal.py | 4 +- fhirclient/models/graphdefinition.py | 8 +- fhirclient/models/group.py | 4 +- fhirclient/models/guidanceresponse.py | 8 +- fhirclient/models/healthcareservice.py | 12 +- fhirclient/models/humanname.py | 4 +- fhirclient/models/identifier.py | 4 +- fhirclient/models/imagingstudy.py | 12 +- fhirclient/models/immunization.py | 25 +- fhirclient/models/immunizationevaluation.py | 8 +- .../models/immunizationrecommendation.py | 12 +- fhirclient/models/implementationguide.py | 8 +- fhirclient/models/insuranceplan.py | 4 +- fhirclient/models/invoice.py | 8 +- fhirclient/models/library.py | 9 +- fhirclient/models/linkage.py | 4 +- fhirclient/models/list.py | 12 +- fhirclient/models/location.py | 12 +- fhirclient/models/marketingstatus.py | 8 +- fhirclient/models/measure.py | 9 +- fhirclient/models/measurereport.py | 8 +- fhirclient/models/media.py | 13 +- fhirclient/models/medication.py | 8 +- fhirclient/models/medicationadministration.py | 8 +- fhirclient/models/medicationdispense.py | 12 +- fhirclient/models/medicationknowledge.py | 4 +- fhirclient/models/medicationrequest.py | 8 +- fhirclient/models/medicationstatement.py | 12 +- fhirclient/models/medicinalproduct.py | 12 +- .../models/medicinalproductauthorization.py | 24 +- .../medicinalproductcontraindication.py | 4 +- .../models/medicinalproductindication.py | 4 +- .../models/medicinalproductingredient.py | 4 +- .../models/medicinalproductinteraction.py | 4 +- .../models/medicinalproductmanufactured.py | 4 +- fhirclient/models/medicinalproductpackaged.py | 4 +- .../models/medicinalproductpharmaceutical.py | 4 +- .../medicinalproductundesirableeffect.py | 4 +- fhirclient/models/messagedefinition.py | 8 +- fhirclient/models/messageheader.py | 4 +- fhirclient/models/meta.py | 8 +- fhirclient/models/metadataresource.py | 8 +- fhirclient/models/molecularsequence.py | 4 +- fhirclient/models/money.py | 4 +- fhirclient/models/namingsystem.py | 8 +- fhirclient/models/narrative.py | 4 +- fhirclient/models/nutritionorder.py | 8 +- fhirclient/models/observation.py | 34 +- fhirclient/models/observationdefinition.py | 4 +- fhirclient/models/operationdefinition.py | 8 +- fhirclient/models/operationoutcome.py | 4 +- fhirclient/models/organization.py | 4 +- fhirclient/models/organizationaffiliation.py | 4 +- fhirclient/models/parameterdefinition.py | 4 +- fhirclient/models/parameters.py | 19 +- fhirclient/models/patient.py | 9 +- fhirclient/models/paymentnotice.py | 9 +- fhirclient/models/paymentreconciliation.py | 9 +- fhirclient/models/period.py | 12 +- fhirclient/models/person.py | 4 +- fhirclient/models/plandefinition.py | 13 +- fhirclient/models/population.py | 4 +- fhirclient/models/practitioner.py | 4 +- fhirclient/models/practitionerrole.py | 12 +- fhirclient/models/procedure.py | 8 +- fhirclient/models/prodcharacteristic.py | 4 +- fhirclient/models/productshelflife.py | 4 +- fhirclient/models/provenance.py | 13 +- fhirclient/models/quantity.py | 4 +- fhirclient/models/questionnaire.py | 30 +- fhirclient/models/questionnaireresponse.py | 18 +- fhirclient/models/range.py | 4 +- fhirclient/models/ratio.py | 4 +- fhirclient/models/reference.py | 4 +- fhirclient/models/relatedartifact.py | 4 +- fhirclient/models/relatedperson.py | 4 +- fhirclient/models/requestgroup.py | 12 +- fhirclient/models/researchdefinition.py | 9 +- .../models/researchelementdefinition.py | 17 +- fhirclient/models/researchstudy.py | 4 +- fhirclient/models/researchsubject.py | 4 +- fhirclient/models/resource.py | 4 +- fhirclient/models/riskassessment.py | 8 +- fhirclient/models/riskevidencesynthesis.py | 9 +- fhirclient/models/sampleddata.py | 4 +- fhirclient/models/schedule.py | 4 +- fhirclient/models/searchparameter.py | 8 +- fhirclient/models/servicerequest.py | 12 +- fhirclient/models/signature.py | 8 +- fhirclient/models/slot.py | 12 +- fhirclient/models/specimen.py | 16 +- fhirclient/models/specimendefinition.py | 4 +- fhirclient/models/structuredefinition.py | 8 +- fhirclient/models/structuremap.py | 23 +- fhirclient/models/subscription.py | 8 +- fhirclient/models/substance.py | 8 +- fhirclient/models/substanceamount.py | 4 +- fhirclient/models/substancenucleicacid.py | 4 +- fhirclient/models/substancepolymer.py | 4 +- fhirclient/models/substanceprotein.py | 4 +- .../models/substancereferenceinformation.py | 4 +- fhirclient/models/substancesourcematerial.py | 4 +- fhirclient/models/substancespecification.py | 12 +- fhirclient/models/supplydelivery.py | 8 +- fhirclient/models/supplyrequest.py | 12 +- fhirclient/models/task.py | 39 ++- fhirclient/models/terminologycapabilities.py | 8 +- fhirclient/models/testreport.py | 8 +- fhirclient/models/testscript.py | 8 +- fhirclient/models/timing.py | 13 +- fhirclient/models/triggerdefinition.py | 9 +- fhirclient/models/usagecontext.py | 4 +- fhirclient/models/valueset.py | 17 +- fhirclient/models/verificationresult.py | 17 +- fhirclient/models/visionprescription.py | 12 +- pyproject.toml | 1 - tests/fhirdate_test.py | 231 +++++++++++++ tests/models/account_test.py | 13 +- tests/models/activitydefinition_test.py | 33 +- tests/models/adverseevent_test.py | 5 +- tests/models/allergyintolerance_test.py | 13 +- tests/models/appointment_test.py | 19 +- tests/models/appointmentresponse_test.py | 7 +- tests/models/auditevent_test.py | 21 +- tests/models/basic_test.py | 9 +- tests/models/binary_test.py | 3 +- .../models/biologicallyderivedproduct_test.py | 3 +- tests/models/bodystructure_test.py | 3 +- tests/models/bundle_test.py | 39 ++- tests/models/capabilitystatement_test.py | 9 +- tests/models/careplan_test.py | 113 ++++--- tests/models/careteam_test.py | 7 +- tests/models/catalogentry_test.py | 3 +- tests/models/chargeitem_test.py | 11 +- tests/models/chargeitemdefinition_test.py | 7 +- tests/models/claim_test.py | 49 ++- tests/models/claimresponse_test.py | 19 +- tests/models/clinicalimpression_test.py | 9 +- tests/models/codesystem_test.py | 13 +- tests/models/communication_test.py | 19 +- tests/models/communicationrequest_test.py | 7 +- tests/models/compartmentdefinition_test.py | 5 +- tests/models/composition_test.py | 15 +- tests/models/conceptmap_test.py | 9 +- tests/models/condition_test.py | 31 +- tests/models/consent_test.py | 39 ++- tests/models/contract_test.py | 41 ++- tests/models/coverage_test.py | 19 +- .../models/coverageeligibilityrequest_test.py | 9 +- .../coverageeligibilityresponse_test.py | 13 +- tests/models/detectedissue_test.py | 9 +- tests/models/device_test.py | 3 +- tests/models/devicedefinition_test.py | 3 +- tests/models/devicemetric_test.py | 5 +- tests/models/devicerequest_test.py | 7 +- tests/models/deviceusestatement_test.py | 3 +- tests/models/diagnosticreport_test.py | 29 +- tests/models/documentmanifest_test.py | 5 +- tests/models/documentreference_test.py | 11 +- tests/models/effectevidencesynthesis_test.py | 3 +- tests/models/encounter_test.py | 65 ++-- tests/models/endpoint_test.py | 5 +- tests/models/enrollmentrequest_test.py | 5 +- tests/models/enrollmentresponse_test.py | 5 +- tests/models/episodeofcare_test.py | 19 +- tests/models/eventdefinition_test.py | 3 +- tests/models/evidence_test.py | 3 +- tests/models/evidencevariable_test.py | 3 +- tests/models/examplescenario_test.py | 3 +- tests/models/explanationofbenefit_test.py | 27 +- tests/models/familymemberhistory_test.py | 5 +- tests/models/flag_test.py | 7 +- tests/models/goal_test.py | 11 +- tests/models/graphdefinition_test.py | 5 +- tests/models/group_test.py | 11 +- tests/models/guidanceresponse_test.py | 5 +- tests/models/healthcareservice_test.py | 19 +- tests/models/imagingstudy_test.py | 9 +- tests/models/immunization_test.py | 25 +- tests/models/immunizationevaluation_test.py | 7 +- .../models/immunizationrecommendation_test.py | 19 +- tests/models/implementationguide_test.py | 5 +- tests/models/insuranceplan_test.py | 3 +- tests/models/invoice_test.py | 5 +- tests/models/library_test.py | 11 +- tests/models/linkage_test.py | 3 +- tests/models/list_test.py | 15 +- tests/models/location_test.py | 3 +- tests/models/measure_test.py | 15 +- tests/models/measurereport_test.py | 21 +- tests/models/media_test.py | 13 +- tests/models/medicationknowledge_test.py | 3 +- tests/models/medicinalproduct_test.py | 5 +- .../medicinalproductauthorization_test.py | 23 +- .../medicinalproductcontraindication_test.py | 3 +- .../models/medicinalproductindication_test.py | 3 +- .../models/medicinalproductingredient_test.py | 3 +- .../medicinalproductinteraction_test.py | 3 +- .../medicinalproductmanufactured_test.py | 3 +- tests/models/medicinalproductpackaged_test.py | 5 +- .../medicinalproductpharmaceutical_test.py | 3 +- .../medicinalproductundesirableeffect_test.py | 3 +- tests/models/messagedefinition_test.py | 5 +- tests/models/messageheader_test.py | 3 +- tests/models/molecularsequence_test.py | 3 +- tests/models/namingsystem_test.py | 9 +- tests/models/nutritionorder_test.py | 45 ++- tests/models/observation_test.py | 27 +- tests/models/observationdefinition_test.py | 3 +- tests/models/operationdefinition_test.py | 5 +- tests/models/operationoutcome_test.py | 3 +- tests/models/organization_test.py | 3 +- tests/models/organizationaffiliation_test.py | 11 +- tests/models/parameters_test.py | 3 +- tests/models/patient_test.py | 35 +- tests/models/paymentnotice_test.py | 7 +- tests/models/paymentreconciliation_test.py | 17 +- tests/models/person_test.py | 9 +- tests/models/plandefinition_test.py | 21 +- tests/models/practitioner_test.py | 19 +- tests/models/practitionerrole_test.py | 19 +- tests/models/procedure_test.py | 23 +- tests/models/provenance_test.py | 21 +- tests/models/questionnaire_test.py | 11 +- tests/models/questionnaireresponse_test.py | 25 +- tests/models/relatedperson_test.py | 11 +- tests/models/requestgroup_test.py | 9 +- tests/models/researchdefinition_test.py | 3 +- .../models/researchelementdefinition_test.py | 3 +- tests/models/researchstudy_test.py | 3 +- tests/models/researchsubject_test.py | 3 +- tests/models/riskassessment_test.py | 9 +- tests/models/riskevidencesynthesis_test.py | 3 +- tests/models/schedule_test.py | 15 +- tests/models/searchparameter_test.py | 7 +- tests/models/servicerequest_test.py | 25 +- tests/models/slot_test.py | 19 +- tests/models/specimen_test.py | 21 +- tests/models/specimendefinition_test.py | 3 +- tests/models/structuredefinition_test.py | 7 +- tests/models/structuremap_test.py | 5 +- tests/models/subscription_test.py | 7 +- tests/models/substance_test.py | 5 +- tests/models/substancespecification_test.py | 3 +- tests/models/supplydelivery_test.py | 5 +- tests/models/supplyrequest_test.py | 7 +- tests/models/task_test.py | 67 ++-- tests/models/terminologycapabilities_test.py | 5 +- tests/models/testreport_test.py | 5 +- tests/models/testscript_test.py | 15 +- tests/models/valueset_test.py | 31 +- tests/models/verificationresult_test.py | 3 +- tests/models/visionprescription_test.py | 11 +- 337 files changed, 2473 insertions(+), 1903 deletions(-) create mode 100644 tests/fhirdate_test.py diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 5e04b77f8..d9cbf9050 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -40,3 +40,7 @@ Using flit (*Note*: Alternatively, you can use [twine](https://twine.readthedocs pip install -U flit flit publish + +### Announce the release + +Make a post in the [Zulip channel](https://chat.fhir.org/#narrow/stream/179218-python) for python. \ No newline at end of file diff --git a/fhir-parser-resources/fhirabstractresource.py b/fhir-parser-resources/fhirabstractresource.py index 31b00f871..343bdb655 100644 --- a/fhir-parser-resources/fhirabstractresource.py +++ b/fhir-parser-resources/fhirabstractresource.py @@ -211,6 +211,5 @@ def where(cls, struct): return fhirsearch.FHIRSearch(cls, struct) -from . import fhirdate from . import fhirsearch from . import fhirelementfactory diff --git a/fhir-parser-resources/fhirdate.py b/fhir-parser-resources/fhirdate.py index 1ac29e8b6..429bd39aa 100644 --- a/fhir-parser-resources/fhirdate.py +++ b/fhir-parser-resources/fhirdate.py @@ -1,81 +1,288 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# Facilitate working with dates. -# 2014, SMART Health IT. - -import sys -import logging -import isodate +"""Facilitate working with FHIR dates and times.""" +# 2014-2024, SMART Health IT. + import datetime +import re +from typing import Any, Union + + +class FHIRDate: + """ + A convenience class for working with FHIR dates in Python. + + http://hl7.org/fhir/R4/datatypes.html#date -logger = logging.getLogger(__name__) + Converting to a Python representation does require some compromises: + - This class will convert partial dates ("reduced precision dates") like "2024" into full + dates using the earliest possible time (in this example, "2024-01-01") because Python's + date class does not support partial dates. + If such compromise is not useful for you, avoid using the `date` or `isostring` + properties and just use the `as_json()` method in order to work with the original, + exact string. -class FHIRDate(object): - """ Facilitate working with dates. - - - `date`: datetime object representing the receiver's date-time + For backwards-compatibility reasons, this class is the parent class of FHIRDateTime, + FHIRInstant, and FHIRTime. But they are all separate concepts and in a future major release, + they should be split into entirely separate classes. + + Public properties: + - `date`: datetime.date representing the JSON value + - `isostring`: an ISO 8601 string version of the above Python object + + Public methods: + - `as_json`: returns the original JSON used to construct the instance """ - - def __init__(self, jsonval=None): - self.date = None + + def __init__(self, jsonval: Union[str, None] = None): + self.date: Union[datetime.date, datetime.datetime, datetime.time, None] = None + if jsonval is not None: - isstr = isinstance(jsonval, str) - if not isstr and sys.version_info[0] < 3: # Python 2.x has 'str' and 'unicode' - isstr = isinstance(jsonval, basestring) - if not isstr: + if not isinstance(jsonval, str): raise TypeError("Expecting string when initializing {}, but got {}" .format(type(self), type(jsonval))) - try: - if 'T' in jsonval: - self.date = isodate.parse_datetime(jsonval) - else: - self.date = isodate.parse_date(jsonval) - except Exception as e: - logger.warning("Failed to initialize FHIRDate from \"{}\": {}" - .format(jsonval, e)) - - self.origval = jsonval - + if not self._REGEX.fullmatch(jsonval): + raise ValueError("does not match expected format") + self.date = self._from_string(jsonval) + + self.origval: Union[str, None] = jsonval + def __setattr__(self, prop, value): - if 'date' == prop: + if prop in {'date', self._FIELD}: self.origval = None - object.__setattr__(self, prop, value) - + # Keep these two fields in sync + object.__setattr__(self, self._FIELD, value) + object.__setattr__(self, "date", value) + else: + object.__setattr__(self, prop, value) + @property - def isostring(self): + def isostring(self) -> Union[str, None]: + """ + Returns a standardized ISO 8601 version of the Python representation of the FHIR JSON. + + Note that this may not be a fully accurate version of the input JSON. + In particular, it will convert partial dates like "2024" to full dates like "2024-01-01". + It will also normalize the timezone, if present. + """ if self.date is None: return None - if isinstance(self.date, datetime.datetime): - return isodate.datetime_isoformat(self.date) - return isodate.date_isoformat(self.date) - + return self.date.isoformat() + @classmethod - def with_json(cls, jsonobj): + def with_json(cls, jsonobj: Union[str, list]): """ Initialize a date from an ISO date string. """ - isstr = isinstance(jsonobj, str) - if not isstr and sys.version_info[0] < 3: # Python 2.x has 'str' and 'unicode' - isstr = isinstance(jsonobj, basestring) - if isstr: + if isinstance(jsonobj, str): return cls(jsonobj) - + if isinstance(jsonobj, list): return [cls(jsonval) for jsonval in jsonobj] - + raise TypeError("`cls.with_json()` only takes string or list of strings, but you provided {}" .format(type(jsonobj))) - + @classmethod - def with_json_and_owner(cls, jsonobj, owner): + def with_json_and_owner(cls, jsonobj: Union[str, list], owner): """ Added for compatibility reasons to FHIRElement; "owner" is discarded. """ return cls.with_json(jsonobj) - - def as_json(self): + + def as_json(self) -> Union[str, None]: + """Returns the original JSON string used to create this instance.""" if self.origval is not None: return self.origval return self.isostring - + + ################################## + # Private properties and methods # + ################################## + + # Pulled from spec for date + _REGEX = re.compile(r"([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1]))?)?") + _FIELD = "date" + + @staticmethod + def _parse_partial(value: str, cls): + """ + Handle partial dates like 1970 or 1980-12. + + FHIR allows them, but Python's datetime classes do not natively parse them. + """ + # Note that `value` has already been regex-certified by this point, + # so we don't have to handle really wild strings. + if len(value) < 10: + pieces = value.split("-") + if len(pieces) == 1: + return cls(int(pieces[0]), 1, 1) + else: + return cls(int(pieces[0]), int(pieces[1]), 1) + return cls.fromisoformat(value) + + @staticmethod + def _parse_date(value: str) -> datetime.date: + return FHIRDate._parse_partial(value, datetime.date) + + @staticmethod + def _parse_datetime(value: str) -> datetime.datetime: + # Until we depend on Python 3.11+, manually handle Z + value = value.replace("Z", "+00:00") + value = FHIRDate._strip_leap_seconds(value) + return FHIRDate._parse_partial(value, datetime.datetime) + + @staticmethod + def _parse_time(value: str) -> datetime.time: + value = FHIRDate._strip_leap_seconds(value) + return datetime.time.fromisoformat(value) + + @staticmethod + def _strip_leap_seconds(value: str) -> str: + """ + Manually ignore leap seconds by clamping the seconds value to 59. + + Python native times don't support them (at the time of this writing, but also watch + https://bugs.python.org/issue23574). For example, the stdlib's datetime.fromtimestamp() + also clamps to 59 if the system gives it leap seconds. + + But FHIR allows leap seconds and says receiving code SHOULD accept them, + so we should be graceful enough to at least not throw a ValueError, + even though we can't natively represent the most-correct time. + """ + # We can get away with such relaxed replacement because we are already regex-certified + # and ":60" can't show up anywhere but seconds. + return value.replace(":60", ":59") + + @staticmethod + def _from_string(value: str) -> Any: + return FHIRDate._parse_date(value) + + +# The classes below inherit from FHIRDate as a matter of backwards compatibility. +# (in case anyone was doing isinstance(obj, FHIRDate)) +# Next time we bump the major version, maybe we can stop that and drop the backwards-compatible +# 'date' aliases (like FHIRTime.date). R4-QUIRK + +class FHIRDateTime(FHIRDate): + """ + A convenience class for working with FHIR datetimes in Python. + + http://hl7.org/fhir/R4/datatypes.html#datetime + + Converting to a Python representation does require some compromises: + - This class will convert partial dates ("reduced precision dates") like "2024" into full + naive datetimes using the earliest possible time (in this example, "2024-01-01T00:00:00") + because Python's datetime class does not support partial dates. + - FHIR allows arbitrary sub-second precision, but Python only holds microseconds. + - Leap seconds (:60) will be changed to the 59th second (:59) because Python's time classes + do not support leap seconds. + + If such compromise is not useful for you, avoid using the `date`, `datetime`, or `isostring` + properties and just use the `as_json()` method in order to work with the original, + exact string. + + Public properties: + - `datetime`: datetime.datetime representing the JSON value (naive or aware) + - `date`: backwards-compatibility alias for `datetime` + - `isostring`: an ISO 8601 string version of the above Python object + + Public methods: + - `as_json`: returns the original JSON used to construct the instance + """ + + def __init__(self, jsonval: Union[str, None] = None): + self.datetime: Union[datetime.datetime, None] = None + super().__init__(jsonval) + + ################################## + # Private properties and methods # + ################################## + + # Pulled from spec for datetime + _REGEX = re.compile(r"([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?") + _FIELD = "datetime" + + @staticmethod + def _from_string(value: str) -> Any: + return FHIRDate._parse_datetime(value) + + +class FHIRInstant(FHIRDate): + """ + A convenience class for working with FHIR instants in Python. + + http://hl7.org/fhir/R4/datatypes.html#instant + + Converting to a Python representation does require some compromises: + - FHIR allows arbitrary sub-second precision, but Python only holds microseconds. + - Leap seconds (:60) will be changed to the 59th second (:59) because Python's time classes + do not support leap seconds. + + If such compromise is not useful for you, avoid using the `date`, `datetime`, or `isostring` + properties and just use the `as_json()` method in order to work with the original, + exact string. + + Public properties: + - `datetime`: datetime.datetime representing the JSON value (aware only) + - `date`: backwards-compatibility alias for `datetime` + - `isostring`: an ISO 8601 string version of the above Python object + + Public methods: + - `as_json`: returns the original JSON used to construct the instance + """ + + def __init__(self, jsonval: Union[str, None] = None): + self.datetime: Union[datetime.datetime, None] = None + super().__init__(jsonval) + + ################################## + # Private properties and methods # + ################################## + + # Pulled from spec for instant + _REGEX = re.compile(r"([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))") + _FIELD = "datetime" + + @staticmethod + def _from_string(value: str) -> Any: + return FHIRDate._parse_datetime(value) + + +class FHIRTime(FHIRDate): + """ + A convenience class for working with FHIR times in Python. + + http://hl7.org/fhir/R4/datatypes.html#time + + Converting to a Python representation does require some compromises: + - FHIR allows arbitrary sub-second precision, but Python only holds microseconds. + - Leap seconds (:60) will be changed to the 59th second (:59) because Python's time classes + do not support leap seconds. + + If such compromise is not useful for you, avoid using the `date`, `time`, or `isostring` + properties and just use the `as_json()` method in order to work with the original, + exact string. + + Public properties: + - `time`: datetime.time representing the JSON value + - `date`: backwards-compatibility alias for `time` + - `isostring`: an ISO 8601 string version of the above Python object + + Public methods: + - `as_json`: returns the original JSON used to construct the instance + """ + + def __init__(self, jsonval: Union[str, None] = None): + self.time: Union[datetime.time, None] = None + super().__init__(jsonval) + + ################################## + # Private properties and methods # + ################################## + + # Pulled from spec for time + _REGEX = re.compile(r"([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?") + _FIELD = "time" + + @staticmethod + def _from_string(value: str) -> Any: + return FHIRDate._parse_time(value) diff --git a/fhir-parser-resources/settings.py b/fhir-parser-resources/settings.py index 8a42e62bd..574268c44 100644 --- a/fhir-parser-resources/settings.py +++ b/fhir-parser-resources/settings.py @@ -23,6 +23,14 @@ write_unittests = True tpl_unittest_target = '../tests/models' # target directory to write the generated unit test files to +# We expand the date & time options. +classmap["dateTime"] = "FHIRDateTime" +classmap["instant"] = "FHIRInstant" +classmap["time"] = "FHIRTime" +jsonmap["FHIRDateTime"] = "str" +jsonmap["FHIRInstant"] = "str" +jsonmap["FHIRTime"] = "str" + # all these files should be copied to dirname(`tpl_resource_target_ptrn`): tuples of (path/to/file, module, array-of-class-names) manual_profiles = [ diff --git a/fhir-parser-resources/template-resource.py b/fhir-parser-resources/template-resource.py index 9eb892116..9fd991eb5 100644 --- a/fhir-parser-resources/template-resource.py +++ b/fhir-parser-resources/template-resource.py @@ -1,5 +1,5 @@ -# Generated from FHIR {{ info.version }} ({{ profile.url }}) on {{ info.date }}. -# {{ info.year }}, SMART Health IT. +# Generated from FHIR {{ info.version }} ({{ profile.url }}). +# {{ info.year }}, SMART Health IT. {%- set imported = {} %} {%- for klass in classes %} diff --git a/fhir-parser-resources/template-unittest.py b/fhir-parser-resources/template-unittest.py index c96b50cda..5d33c89d5 100644 --- a/fhir-parser-resources/template-unittest.py +++ b/fhir-parser-resources/template-unittest.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import {{ class.module }} -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, {{ class.module }} class {{ class.name }}Tests(unittest.TestCase): @@ -40,8 +39,8 @@ def impl{{ class.name }}{{ loop.index }}(self, inst): {%- else %} self.assertFalse(inst.{{ onetest.path }}) {%- endif %} - {%- else %}{% if "FHIRDate" == onetest.klass.name %} - self.assertEqual(inst.{{ onetest.path }}.date, FHIRDate("{{ onetest.value }}").date) + {%- else %}{% if onetest.klass.name in ["FHIRDate", "FHIRDateTime", "FHIRInstant", "FHIRTime"] %} + self.assertEqual(inst.{{ onetest.path }}.date, fhirdate.{{ onetest.klass.name }}("{{ onetest.value }}").date) self.assertEqual(inst.{{ onetest.path }}.as_json(), "{{ onetest.value }}") {%- else %} # Don't know how to create unit test for "{{ onetest.path }}", which is a {{ onetest.klass.name }} diff --git a/fhirclient/models/account.py b/fhirclient/models/account.py index e42075db1..39c17a74e 100644 --- a/fhirclient/models/account.py +++ b/fhirclient/models/account.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Account) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Account). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/activitydefinition.py b/fhirclient/models/activitydefinition.py index e53c51528..1e311eae6 100644 --- a/fhirclient/models/activitydefinition.py +++ b/fhirclient/models/activitydefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ActivityDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ActivityDefinition). +# 2024, SMART Health IT. from . import domainresource @@ -49,7 +49,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the activity definition. @@ -190,7 +190,7 @@ def __init__(self, jsondict=None, strict=True): self.timingDateTime = None """ When activity is to occur. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.timingDuration = None """ When activity is to occur. @@ -248,7 +248,7 @@ def elementProperties(self): ("code", "code", codeableconcept.CodeableConcept, False, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("doNotPerform", "doNotPerform", bool, False, None, False), ("dosage", "dosage", dosage.Dosage, True, None, False), @@ -283,7 +283,7 @@ def elementProperties(self): ("subjectReference", "subjectReference", fhirreference.FHIRReference, False, "subject", False), ("subtitle", "subtitle", str, False, None, False), ("timingAge", "timingAge", age.Age, False, "timing", False), - ("timingDateTime", "timingDateTime", fhirdate.FHIRDate, False, "timing", False), + ("timingDateTime", "timingDateTime", fhirdate.FHIRDateTime, False, "timing", False), ("timingDuration", "timingDuration", duration.Duration, False, "timing", False), ("timingPeriod", "timingPeriod", period.Period, False, "timing", False), ("timingRange", "timingRange", range.Range, False, "timing", False), @@ -382,6 +382,7 @@ def elementProperties(self): from . import duration from . import expression from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/address.py b/fhirclient/models/address.py index 1c98e6258..9b7aff8b9 100644 --- a/fhirclient/models/address.py +++ b/fhirclient/models/address.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Address) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Address). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/adverseevent.py b/fhirclient/models/adverseevent.py index 6746462b6..ad57f195e 100644 --- a/fhirclient/models/adverseevent.py +++ b/fhirclient/models/adverseevent.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/AdverseEvent) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/AdverseEvent). +# 2024, SMART Health IT. from . import domainresource @@ -43,11 +43,11 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ When the event occurred. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.detected = None """ When the event was detected. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.encounter = None """ Encounter created as part of. @@ -72,7 +72,7 @@ def __init__(self, jsondict=None, strict=True): self.recordedDate = None """ When the event was recorded. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.recorder = None """ Who recorded the adverse event. @@ -118,14 +118,14 @@ def elementProperties(self): ("actuality", "actuality", str, False, None, True), ("category", "category", codeableconcept.CodeableConcept, True, None, False), ("contributor", "contributor", fhirreference.FHIRReference, True, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), - ("detected", "detected", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), + ("detected", "detected", fhirdate.FHIRDateTime, False, None, False), ("encounter", "encounter", fhirreference.FHIRReference, False, None, False), ("event", "event", codeableconcept.CodeableConcept, False, None, False), ("identifier", "identifier", identifier.Identifier, False, None, False), ("location", "location", fhirreference.FHIRReference, False, None, False), ("outcome", "outcome", codeableconcept.CodeableConcept, False, None, False), - ("recordedDate", "recordedDate", fhirdate.FHIRDate, False, None, False), + ("recordedDate", "recordedDate", fhirdate.FHIRDateTime, False, None, False), ("recorder", "recorder", fhirreference.FHIRReference, False, None, False), ("referenceDocument", "referenceDocument", fhirreference.FHIRReference, True, None, False), ("resultingCondition", "resultingCondition", fhirreference.FHIRReference, True, None, False), diff --git a/fhirclient/models/age.py b/fhirclient/models/age.py index 9bc07d4a4..43a2fd9f7 100644 --- a/fhirclient/models/age.py +++ b/fhirclient/models/age.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Age) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Age). +# 2024, SMART Health IT. from . import quantity diff --git a/fhirclient/models/allergyintolerance.py b/fhirclient/models/allergyintolerance.py index 1a494e138..22447987e 100644 --- a/fhirclient/models/allergyintolerance.py +++ b/fhirclient/models/allergyintolerance.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/AllergyIntolerance) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/AllergyIntolerance). +# 2024, SMART Health IT. from . import domainresource @@ -51,7 +51,7 @@ def __init__(self, jsondict=None, strict=True): self.lastOccurrence = None """ Date(/time) of last known occurrence of a reaction. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.note = None """ Additional text not captured in other fields. @@ -63,7 +63,7 @@ def __init__(self, jsondict=None, strict=True): self.onsetDateTime = None """ When allergy or intolerance was identified. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.onsetPeriod = None """ When allergy or intolerance was identified. @@ -87,7 +87,7 @@ def __init__(self, jsondict=None, strict=True): self.recordedDate = None """ Date first version of the resource instance was recorded. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.recorder = None """ Who recorded the sensitivity. @@ -113,16 +113,16 @@ def elementProperties(self): ("criticality", "criticality", str, False, None, False), ("encounter", "encounter", fhirreference.FHIRReference, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), - ("lastOccurrence", "lastOccurrence", fhirdate.FHIRDate, False, None, False), + ("lastOccurrence", "lastOccurrence", fhirdate.FHIRDateTime, False, None, False), ("note", "note", annotation.Annotation, True, None, False), ("onsetAge", "onsetAge", age.Age, False, "onset", False), - ("onsetDateTime", "onsetDateTime", fhirdate.FHIRDate, False, "onset", False), + ("onsetDateTime", "onsetDateTime", fhirdate.FHIRDateTime, False, "onset", False), ("onsetPeriod", "onsetPeriod", period.Period, False, "onset", False), ("onsetRange", "onsetRange", range.Range, False, "onset", False), ("onsetString", "onsetString", str, False, "onset", False), ("patient", "patient", fhirreference.FHIRReference, False, None, True), ("reaction", "reaction", AllergyIntoleranceReaction, True, None, False), - ("recordedDate", "recordedDate", fhirdate.FHIRDate, False, None, False), + ("recordedDate", "recordedDate", fhirdate.FHIRDateTime, False, None, False), ("recorder", "recorder", fhirreference.FHIRReference, False, None, False), ("type", "type", str, False, None, False), ("verificationStatus", "verificationStatus", codeableconcept.CodeableConcept, False, None, False), @@ -167,7 +167,7 @@ def __init__(self, jsondict=None, strict=True): self.onset = None """ Date(/time) when manifestations showed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.severity = None """ mild | moderate | severe (of event as a whole). @@ -187,7 +187,7 @@ def elementProperties(self): ("exposureRoute", "exposureRoute", codeableconcept.CodeableConcept, False, None, False), ("manifestation", "manifestation", codeableconcept.CodeableConcept, True, None, True), ("note", "note", annotation.Annotation, True, None, False), - ("onset", "onset", fhirdate.FHIRDate, False, None, False), + ("onset", "onset", fhirdate.FHIRDateTime, False, None, False), ("severity", "severity", str, False, None, False), ("substance", "substance", codeableconcept.CodeableConcept, False, None, False), ]) diff --git a/fhirclient/models/annotation.py b/fhirclient/models/annotation.py index ce2f0f827..c9157eaed 100644 --- a/fhirclient/models/annotation.py +++ b/fhirclient/models/annotation.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Annotation) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Annotation). +# 2024, SMART Health IT. from . import element @@ -35,7 +35,7 @@ def __init__(self, jsondict=None, strict=True): self.time = None """ When the annotation was made. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ super(Annotation, self).__init__(jsondict=jsondict, strict=strict) @@ -45,7 +45,7 @@ def elementProperties(self): ("authorReference", "authorReference", fhirreference.FHIRReference, False, "author", False), ("authorString", "authorString", str, False, "author", False), ("text", "text", str, False, None, True), - ("time", "time", fhirdate.FHIRDate, False, None, False), + ("time", "time", fhirdate.FHIRDateTime, False, None, False), ]) return js diff --git a/fhirclient/models/appointment.py b/fhirclient/models/appointment.py index 74d240a05..43885e71e 100644 --- a/fhirclient/models/appointment.py +++ b/fhirclient/models/appointment.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Appointment) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Appointment). +# 2024, SMART Health IT. from . import domainresource @@ -39,7 +39,7 @@ def __init__(self, jsondict=None, strict=True): self.created = None """ The date that this appointment was initially created. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Shown on a subject line in a meeting request, or appointment list. @@ -47,7 +47,7 @@ def __init__(self, jsondict=None, strict=True): self.end = None """ When appointment is to conclude. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.identifier = None """ External Ids for this item. @@ -103,7 +103,7 @@ def __init__(self, jsondict=None, strict=True): self.start = None """ When appointment is to take place. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.status = None """ proposed | pending | booked | arrived | fulfilled | cancelled | @@ -123,9 +123,9 @@ def elementProperties(self): ("basedOn", "basedOn", fhirreference.FHIRReference, True, None, False), ("cancelationReason", "cancelationReason", codeableconcept.CodeableConcept, False, None, False), ("comment", "comment", str, False, None, False), - ("created", "created", fhirdate.FHIRDate, False, None, False), + ("created", "created", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), - ("end", "end", fhirdate.FHIRDate, False, None, False), + ("end", "end", fhirdate.FHIRInstant, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("minutesDuration", "minutesDuration", int, False, None, False), ("participant", "participant", AppointmentParticipant, True, None, True), @@ -138,7 +138,7 @@ def elementProperties(self): ("serviceType", "serviceType", codeableconcept.CodeableConcept, True, None, False), ("slot", "slot", fhirreference.FHIRReference, True, None, False), ("specialty", "specialty", codeableconcept.CodeableConcept, True, None, False), - ("start", "start", fhirdate.FHIRDate, False, None, False), + ("start", "start", fhirdate.FHIRInstant, False, None, False), ("status", "status", str, False, None, True), ("supportingInformation", "supportingInformation", fhirreference.FHIRReference, True, None, False), ]) @@ -199,6 +199,7 @@ def elementProperties(self): from . import codeableconcept from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/appointmentresponse.py b/fhirclient/models/appointmentresponse.py index e012c5ca1..e584dcd31 100644 --- a/fhirclient/models/appointmentresponse.py +++ b/fhirclient/models/appointmentresponse.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/AppointmentResponse) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/AppointmentResponse). +# 2024, SMART Health IT. from . import domainresource @@ -33,7 +33,7 @@ def __init__(self, jsondict=None, strict=True): self.end = None """ Time from appointment, or requested new end time. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.identifier = None """ External Ids for this item. @@ -49,7 +49,7 @@ def __init__(self, jsondict=None, strict=True): self.start = None """ Time from appointment, or requested new start time. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ super(AppointmentResponse, self).__init__(jsondict=jsondict, strict=strict) @@ -59,11 +59,11 @@ def elementProperties(self): ("actor", "actor", fhirreference.FHIRReference, False, None, False), ("appointment", "appointment", fhirreference.FHIRReference, False, None, True), ("comment", "comment", str, False, None, False), - ("end", "end", fhirdate.FHIRDate, False, None, False), + ("end", "end", fhirdate.FHIRInstant, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("participantStatus", "participantStatus", str, False, None, True), ("participantType", "participantType", codeableconcept.CodeableConcept, True, None, False), - ("start", "start", fhirdate.FHIRDate, False, None, False), + ("start", "start", fhirdate.FHIRInstant, False, None, False), ]) return js diff --git a/fhirclient/models/attachment.py b/fhirclient/models/attachment.py index 802f5764f..1a12dfdab 100644 --- a/fhirclient/models/attachment.py +++ b/fhirclient/models/attachment.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Attachment) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Attachment). +# 2024, SMART Health IT. from . import element @@ -26,7 +26,7 @@ def __init__(self, jsondict=None, strict=True): self.creation = None """ Date attachment was first created. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.data = None """ Data inline, base64ed. @@ -58,7 +58,7 @@ def elementProperties(self): js = super(Attachment, self).elementProperties() js.extend([ ("contentType", "contentType", str, False, None, False), - ("creation", "creation", fhirdate.FHIRDate, False, None, False), + ("creation", "creation", fhirdate.FHIRDateTime, False, None, False), ("data", "data", str, False, None, False), ("hash", "hash", str, False, None, False), ("language", "language", str, False, None, False), diff --git a/fhirclient/models/auditevent.py b/fhirclient/models/auditevent.py index f37bea60f..494fa9d82 100644 --- a/fhirclient/models/auditevent.py +++ b/fhirclient/models/auditevent.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/AuditEvent) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/AuditEvent). +# 2024, SMART Health IT. from . import domainresource @@ -52,7 +52,7 @@ def __init__(self, jsondict=None, strict=True): self.recorded = None """ Time when the event was recorded. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.source = None """ Audit Event Reporter. @@ -78,7 +78,7 @@ def elementProperties(self): ("outcomeDesc", "outcomeDesc", str, False, None, False), ("period", "period", period.Period, False, None, False), ("purposeOfEvent", "purposeOfEvent", codeableconcept.CodeableConcept, True, None, False), - ("recorded", "recorded", fhirdate.FHIRDate, False, None, True), + ("recorded", "recorded", fhirdate.FHIRInstant, False, None, True), ("source", "source", AuditEventSource, False, None, True), ("subtype", "subtype", coding.Coding, True, None, False), ("type", "type", coding.Coding, False, None, True), diff --git a/fhirclient/models/backboneelement.py b/fhirclient/models/backboneelement.py index 9ce13a20e..6fb3a7c95 100644 --- a/fhirclient/models/backboneelement.py +++ b/fhirclient/models/backboneelement.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/BackboneElement) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/BackboneElement). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/basic.py b/fhirclient/models/basic.py index 6f7d4d106..049b1173b 100644 --- a/fhirclient/models/basic.py +++ b/fhirclient/models/basic.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Basic) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Basic). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/binary.py b/fhirclient/models/binary.py index 2f841ab12..23a4523eb 100644 --- a/fhirclient/models/binary.py +++ b/fhirclient/models/binary.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Binary) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Binary). +# 2024, SMART Health IT. from . import resource diff --git a/fhirclient/models/biologicallyderivedproduct.py b/fhirclient/models/biologicallyderivedproduct.py index 3dd056346..b84fe601f 100644 --- a/fhirclient/models/biologicallyderivedproduct.py +++ b/fhirclient/models/biologicallyderivedproduct.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProduct) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/BiologicallyDerivedProduct). +# 2024, SMART Health IT. from . import domainresource @@ -104,7 +104,7 @@ def __init__(self, jsondict=None, strict=True): self.collectedDateTime = None """ Time of product collection. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.collectedPeriod = None """ Time of product collection. @@ -123,7 +123,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(BiologicallyDerivedProductCollection, self).elementProperties() js.extend([ - ("collectedDateTime", "collectedDateTime", fhirdate.FHIRDate, False, "collected", False), + ("collectedDateTime", "collectedDateTime", fhirdate.FHIRDateTime, False, "collected", False), ("collectedPeriod", "collectedPeriod", period.Period, False, "collected", False), ("collector", "collector", fhirreference.FHIRReference, False, None, False), ("source", "source", fhirreference.FHIRReference, False, None, False), @@ -155,7 +155,7 @@ def __init__(self, jsondict=None, strict=True): self.timeDateTime = None """ Time of manipulation. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.timePeriod = None """ Time of manipulation. @@ -167,7 +167,7 @@ def elementProperties(self): js = super(BiologicallyDerivedProductManipulation, self).elementProperties() js.extend([ ("description", "description", str, False, None, False), - ("timeDateTime", "timeDateTime", fhirdate.FHIRDate, False, "time", False), + ("timeDateTime", "timeDateTime", fhirdate.FHIRDateTime, False, "time", False), ("timePeriod", "timePeriod", period.Period, False, "time", False), ]) return js @@ -205,7 +205,7 @@ def __init__(self, jsondict=None, strict=True): self.timeDateTime = None """ Time of processing. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.timePeriod = None """ Time of processing. @@ -219,7 +219,7 @@ def elementProperties(self): ("additive", "additive", fhirreference.FHIRReference, False, None, False), ("description", "description", str, False, None, False), ("procedure", "procedure", codeableconcept.CodeableConcept, False, None, False), - ("timeDateTime", "timeDateTime", fhirdate.FHIRDate, False, "time", False), + ("timeDateTime", "timeDateTime", fhirdate.FHIRDateTime, False, "time", False), ("timePeriod", "timePeriod", period.Period, False, "time", False), ]) return js diff --git a/fhirclient/models/bodystructure.py b/fhirclient/models/bodystructure.py index 21de3c16e..d5206083e 100644 --- a/fhirclient/models/bodystructure.py +++ b/fhirclient/models/bodystructure.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/BodyStructure) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/BodyStructure). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/bundle.py b/fhirclient/models/bundle.py index 7a8821727..5b9fcd691 100644 --- a/fhirclient/models/bundle.py +++ b/fhirclient/models/bundle.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Bundle) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Bundle). +# 2024, SMART Health IT. from . import resource @@ -38,7 +38,7 @@ def __init__(self, jsondict=None, strict=True): self.timestamp = None """ When the bundle was assembled. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.total = None """ If search, the total number of matches. @@ -58,7 +58,7 @@ def elementProperties(self): ("identifier", "identifier", identifier.Identifier, False, None, False), ("link", "link", BundleLink, True, None, False), ("signature", "signature", signature.Signature, False, None, False), - ("timestamp", "timestamp", fhirdate.FHIRDate, False, None, False), + ("timestamp", "timestamp", fhirdate.FHIRInstant, False, None, False), ("total", "total", int, False, None, False), ("type", "type", str, False, None, True), ]) @@ -147,7 +147,7 @@ def __init__(self, jsondict=None, strict=True): self.ifModifiedSince = None """ For managing cache currency. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.ifNoneExist = None """ For conditional creates. @@ -171,7 +171,7 @@ def elementProperties(self): js = super(BundleEntryRequest, self).elementProperties() js.extend([ ("ifMatch", "ifMatch", str, False, None, False), - ("ifModifiedSince", "ifModifiedSince", fhirdate.FHIRDate, False, None, False), + ("ifModifiedSince", "ifModifiedSince", fhirdate.FHIRInstant, False, None, False), ("ifNoneExist", "ifNoneExist", str, False, None, False), ("ifNoneMatch", "ifNoneMatch", str, False, None, False), ("method", "method", str, False, None, True), @@ -204,7 +204,7 @@ def __init__(self, jsondict=None, strict=True): self.lastModified = None """ Server's date time modified. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.location = None """ The location (if the operation returns a location). @@ -224,7 +224,7 @@ def elementProperties(self): js = super(BundleEntryResponse, self).elementProperties() js.extend([ ("etag", "etag", str, False, None, False), - ("lastModified", "lastModified", fhirdate.FHIRDate, False, None, False), + ("lastModified", "lastModified", fhirdate.FHIRInstant, False, None, False), ("location", "location", str, False, None, False), ("outcome", "outcome", resource.Resource, False, None, False), ("status", "status", str, False, None, True), diff --git a/fhirclient/models/capabilitystatement.py b/fhirclient/models/capabilitystatement.py index b04b207b9..01ea0a322 100644 --- a/fhirclient/models/capabilitystatement.py +++ b/fhirclient/models/capabilitystatement.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CapabilityStatement) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CapabilityStatement). +# 2024, SMART Health IT. from . import domainresource @@ -33,7 +33,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the capability statement. @@ -135,7 +135,7 @@ def elementProperties(self): js.extend([ ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, True), + ("date", "date", fhirdate.FHIRDateTime, False, None, True), ("description", "description", str, False, None, False), ("document", "document", CapabilityStatementDocument, True, None, False), ("experimental", "experimental", bool, False, None, False), @@ -767,7 +767,7 @@ def __init__(self, jsondict=None, strict=True): self.releaseDate = None """ Date this version was released. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.version = None """ Version covered by this statement. @@ -779,7 +779,7 @@ def elementProperties(self): js = super(CapabilityStatementSoftware, self).elementProperties() js.extend([ ("name", "name", str, False, None, True), - ("releaseDate", "releaseDate", fhirdate.FHIRDate, False, None, False), + ("releaseDate", "releaseDate", fhirdate.FHIRDateTime, False, None, False), ("version", "version", str, False, None, False), ]) return js diff --git a/fhirclient/models/careplan.py b/fhirclient/models/careplan.py index 3443c29e9..9a1648d2e 100644 --- a/fhirclient/models/careplan.py +++ b/fhirclient/models/careplan.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CarePlan) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CarePlan). +# 2024, SMART Health IT. from . import domainresource @@ -52,7 +52,7 @@ def __init__(self, jsondict=None, strict=True): self.created = None """ Date record was first recorded. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Summary of nature of plan. @@ -127,7 +127,7 @@ def elementProperties(self): ("careTeam", "careTeam", fhirreference.FHIRReference, True, None, False), ("category", "category", codeableconcept.CodeableConcept, True, None, False), ("contributor", "contributor", fhirreference.FHIRReference, True, None, False), - ("created", "created", fhirdate.FHIRDate, False, None, False), + ("created", "created", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("encounter", "encounter", fhirreference.FHIRReference, False, None, False), ("goal", "goal", fhirreference.FHIRReference, True, None, False), diff --git a/fhirclient/models/careteam.py b/fhirclient/models/careteam.py index 52e09ebba..6371304a5 100644 --- a/fhirclient/models/careteam.py +++ b/fhirclient/models/careteam.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CareTeam) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CareTeam). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/catalogentry.py b/fhirclient/models/catalogentry.py index 933bc168b..5e5756039 100644 --- a/fhirclient/models/catalogentry.py +++ b/fhirclient/models/catalogentry.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CatalogEntry) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CatalogEntry). +# 2024, SMART Health IT. from . import domainresource @@ -44,7 +44,7 @@ def __init__(self, jsondict=None, strict=True): self.lastUpdated = None """ When was this catalog last updated. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.orderable = None """ Whether the entry represents an orderable item. @@ -68,7 +68,7 @@ def __init__(self, jsondict=None, strict=True): self.validTo = None """ The date until which this catalog entry is expected to be active. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.validityPeriod = None """ The time period in which this catalog entry is expected to be @@ -85,13 +85,13 @@ def elementProperties(self): ("additionalIdentifier", "additionalIdentifier", identifier.Identifier, True, None, False), ("classification", "classification", codeableconcept.CodeableConcept, True, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), - ("lastUpdated", "lastUpdated", fhirdate.FHIRDate, False, None, False), + ("lastUpdated", "lastUpdated", fhirdate.FHIRDateTime, False, None, False), ("orderable", "orderable", bool, False, None, True), ("referencedItem", "referencedItem", fhirreference.FHIRReference, False, None, True), ("relatedEntry", "relatedEntry", CatalogEntryRelatedEntry, True, None, False), ("status", "status", str, False, None, False), ("type", "type", codeableconcept.CodeableConcept, False, None, False), - ("validTo", "validTo", fhirdate.FHIRDate, False, None, False), + ("validTo", "validTo", fhirdate.FHIRDateTime, False, None, False), ("validityPeriod", "validityPeriod", period.Period, False, None, False), ]) return js diff --git a/fhirclient/models/chargeitem.py b/fhirclient/models/chargeitem.py index fce87006c..4676f60b3 100644 --- a/fhirclient/models/chargeitem.py +++ b/fhirclient/models/chargeitem.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ChargeItem) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ChargeItem). +# 2024, SMART Health IT. from . import domainresource @@ -56,7 +56,7 @@ def __init__(self, jsondict=None, strict=True): self.enteredDate = None """ Date the charge item was entered. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.enterer = None """ Individual who was entering. @@ -76,7 +76,7 @@ def __init__(self, jsondict=None, strict=True): self.occurrenceDateTime = None """ When the charged service was applied. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.occurrencePeriod = None """ When the charged service was applied. @@ -155,12 +155,12 @@ def elementProperties(self): ("costCenter", "costCenter", fhirreference.FHIRReference, False, None, False), ("definitionCanonical", "definitionCanonical", str, True, None, False), ("definitionUri", "definitionUri", str, True, None, False), - ("enteredDate", "enteredDate", fhirdate.FHIRDate, False, None, False), + ("enteredDate", "enteredDate", fhirdate.FHIRDateTime, False, None, False), ("enterer", "enterer", fhirreference.FHIRReference, False, None, False), ("factorOverride", "factorOverride", float, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("note", "note", annotation.Annotation, True, None, False), - ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDate, False, "occurrence", False), + ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDateTime, False, "occurrence", False), ("occurrencePeriod", "occurrencePeriod", period.Period, False, "occurrence", False), ("occurrenceTiming", "occurrenceTiming", timing.Timing, False, "occurrence", False), ("overrideReason", "overrideReason", str, False, None, False), diff --git a/fhirclient/models/chargeitemdefinition.py b/fhirclient/models/chargeitemdefinition.py index 623492253..2a1ba9568 100644 --- a/fhirclient/models/chargeitemdefinition.py +++ b/fhirclient/models/chargeitemdefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ChargeItemDefinition). +# 2024, SMART Health IT. from . import domainresource @@ -47,7 +47,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.derivedFromUri = None """ Underlying externally-defined charge item definition. @@ -130,7 +130,7 @@ def elementProperties(self): ("code", "code", codeableconcept.CodeableConcept, False, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("derivedFromUri", "derivedFromUri", str, True, None, False), ("description", "description", str, False, None, False), ("effectivePeriod", "effectivePeriod", period.Period, False, None, False), @@ -284,6 +284,7 @@ def elementProperties(self): from . import codeableconcept from . import contactdetail from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import money diff --git a/fhirclient/models/claim.py b/fhirclient/models/claim.py index eec719780..827609b24 100644 --- a/fhirclient/models/claim.py +++ b/fhirclient/models/claim.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Claim) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Claim). +# 2024, SMART Health IT. from . import domainresource @@ -36,7 +36,7 @@ def __init__(self, jsondict=None, strict=True): self.created = None """ Resource creation date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.diagnosis = None """ Pertinent diagnosis information. @@ -138,7 +138,7 @@ def elementProperties(self): ("accident", "accident", ClaimAccident, False, None, False), ("billablePeriod", "billablePeriod", period.Period, False, None, False), ("careTeam", "careTeam", ClaimCareTeam, True, None, False), - ("created", "created", fhirdate.FHIRDate, False, None, True), + ("created", "created", fhirdate.FHIRDateTime, False, None, True), ("diagnosis", "diagnosis", ClaimDiagnosis, True, None, False), ("enterer", "enterer", fhirreference.FHIRReference, False, None, False), ("facility", "facility", fhirreference.FHIRReference, False, None, False), @@ -748,7 +748,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ When the procedure was performed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.procedureCodeableConcept = None """ Specific clinical procedure. @@ -775,7 +775,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(ClaimProcedure, self).elementProperties() js.extend([ - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("procedureCodeableConcept", "procedureCodeableConcept", codeableconcept.CodeableConcept, False, "procedure", True), ("procedureReference", "procedureReference", fhirreference.FHIRReference, False, "procedure", True), ("sequence", "sequence", int, False, None, True), @@ -911,6 +911,7 @@ def elementProperties(self): from . import attachment from . import codeableconcept from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import money diff --git a/fhirclient/models/claimresponse.py b/fhirclient/models/claimresponse.py index 4a9b21a7a..7d5afede2 100644 --- a/fhirclient/models/claimresponse.py +++ b/fhirclient/models/claimresponse.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ClaimResponse) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ClaimResponse). +# 2024, SMART Health IT. from . import domainresource @@ -35,7 +35,7 @@ def __init__(self, jsondict=None, strict=True): self.created = None """ Response creation date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.disposition = None """ Disposition Message. @@ -137,7 +137,7 @@ def elementProperties(self): ("addItem", "addItem", ClaimResponseAddItem, True, None, False), ("adjudication", "adjudication", ClaimResponseItemAdjudication, True, None, False), ("communicationRequest", "communicationRequest", fhirreference.FHIRReference, True, None, False), - ("created", "created", fhirdate.FHIRDate, False, None, True), + ("created", "created", fhirdate.FHIRDateTime, False, None, True), ("disposition", "disposition", str, False, None, False), ("error", "error", ClaimResponseError, True, None, False), ("form", "form", attachment.Attachment, False, None, False), @@ -848,6 +848,7 @@ def elementProperties(self): from . import attachment from . import codeableconcept from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import money diff --git a/fhirclient/models/clinicalimpression.py b/fhirclient/models/clinicalimpression.py index 1f377c654..d0f2ccd48 100644 --- a/fhirclient/models/clinicalimpression.py +++ b/fhirclient/models/clinicalimpression.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ClinicalImpression) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ClinicalImpression). +# 2024, SMART Health IT. from . import domainresource @@ -37,7 +37,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ When the assessment was documented. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Why/how the assessment was performed. @@ -45,7 +45,7 @@ def __init__(self, jsondict=None, strict=True): self.effectiveDateTime = None """ Time of assessment. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.effectivePeriod = None """ Time of assessment. @@ -118,9 +118,9 @@ def elementProperties(self): js.extend([ ("assessor", "assessor", fhirreference.FHIRReference, False, None, False), ("code", "code", codeableconcept.CodeableConcept, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), - ("effectiveDateTime", "effectiveDateTime", fhirdate.FHIRDate, False, "effective", False), + ("effectiveDateTime", "effectiveDateTime", fhirdate.FHIRDateTime, False, "effective", False), ("effectivePeriod", "effectivePeriod", period.Period, False, "effective", False), ("encounter", "encounter", fhirreference.FHIRReference, False, None, False), ("finding", "finding", ClinicalImpressionFinding, True, None, False), diff --git a/fhirclient/models/codeableconcept.py b/fhirclient/models/codeableconcept.py index be871f8c2..f13da9961 100644 --- a/fhirclient/models/codeableconcept.py +++ b/fhirclient/models/codeableconcept.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CodeableConcept) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CodeableConcept). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/codesystem.py b/fhirclient/models/codesystem.py index d03bf07ef..d8995db44 100644 --- a/fhirclient/models/codesystem.py +++ b/fhirclient/models/codesystem.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CodeSystem) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CodeSystem). +# 2024, SMART Health IT. from . import domainresource @@ -53,7 +53,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the code system. @@ -141,7 +141,7 @@ def elementProperties(self): ("content", "content", str, False, None, True), ("copyright", "copyright", str, False, None, False), ("count", "count", int, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("experimental", "experimental", bool, False, None, False), ("filter", "filter", CodeSystemFilter, True, None, False), @@ -298,7 +298,7 @@ def __init__(self, jsondict=None, strict=True): self.valueDateTime = None """ Value of the property for this concept. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.valueDecimal = None """ Value of the property for this concept. @@ -321,7 +321,7 @@ def elementProperties(self): ("valueBoolean", "valueBoolean", bool, False, "value", True), ("valueCode", "valueCode", str, False, "value", True), ("valueCoding", "valueCoding", coding.Coding, False, "value", True), - ("valueDateTime", "valueDateTime", fhirdate.FHIRDate, False, "value", True), + ("valueDateTime", "valueDateTime", fhirdate.FHIRDateTime, False, "value", True), ("valueDecimal", "valueDecimal", float, False, "value", True), ("valueInteger", "valueInteger", int, False, "value", True), ("valueString", "valueString", str, False, "value", True), diff --git a/fhirclient/models/coding.py b/fhirclient/models/coding.py index cdf89e560..b3216e71f 100644 --- a/fhirclient/models/coding.py +++ b/fhirclient/models/coding.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Coding) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Coding). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/communication.py b/fhirclient/models/communication.py index 98c6727ab..12d029701 100644 --- a/fhirclient/models/communication.py +++ b/fhirclient/models/communication.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Communication) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Communication). +# 2024, SMART Health IT. from . import domainresource @@ -84,7 +84,7 @@ def __init__(self, jsondict=None, strict=True): self.received = None """ When received. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.recipient = None """ Message recipient. @@ -96,7 +96,7 @@ def __init__(self, jsondict=None, strict=True): self.sent = None """ When sent. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.status = None """ preparation | in-progress | not-done | on-hold | stopped | @@ -135,10 +135,10 @@ def elementProperties(self): ("priority", "priority", str, False, None, False), ("reasonCode", "reasonCode", codeableconcept.CodeableConcept, True, None, False), ("reasonReference", "reasonReference", fhirreference.FHIRReference, True, None, False), - ("received", "received", fhirdate.FHIRDate, False, None, False), + ("received", "received", fhirdate.FHIRDateTime, False, None, False), ("recipient", "recipient", fhirreference.FHIRReference, True, None, False), ("sender", "sender", fhirreference.FHIRReference, False, None, False), - ("sent", "sent", fhirdate.FHIRDate, False, None, False), + ("sent", "sent", fhirdate.FHIRDateTime, False, None, False), ("status", "status", str, False, None, True), ("statusReason", "statusReason", codeableconcept.CodeableConcept, False, None, False), ("subject", "subject", fhirreference.FHIRReference, False, None, False), diff --git a/fhirclient/models/communicationrequest.py b/fhirclient/models/communicationrequest.py index 05437192b..eed18c4e6 100644 --- a/fhirclient/models/communicationrequest.py +++ b/fhirclient/models/communicationrequest.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CommunicationRequest) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CommunicationRequest). +# 2024, SMART Health IT. from . import domainresource @@ -28,7 +28,7 @@ def __init__(self, jsondict=None, strict=True): self.authoredOn = None """ When request transitioned to being actionable. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.basedOn = None """ Fulfills plan or proposal. @@ -64,7 +64,7 @@ def __init__(self, jsondict=None, strict=True): self.occurrenceDateTime = None """ When scheduled. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.occurrencePeriod = None """ When scheduled. @@ -121,7 +121,7 @@ def elementProperties(self): js = super(CommunicationRequest, self).elementProperties() js.extend([ ("about", "about", fhirreference.FHIRReference, True, None, False), - ("authoredOn", "authoredOn", fhirdate.FHIRDate, False, None, False), + ("authoredOn", "authoredOn", fhirdate.FHIRDateTime, False, None, False), ("basedOn", "basedOn", fhirreference.FHIRReference, True, None, False), ("category", "category", codeableconcept.CodeableConcept, True, None, False), ("doNotPerform", "doNotPerform", bool, False, None, False), @@ -130,7 +130,7 @@ def elementProperties(self): ("identifier", "identifier", identifier.Identifier, True, None, False), ("medium", "medium", codeableconcept.CodeableConcept, True, None, False), ("note", "note", annotation.Annotation, True, None, False), - ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDate, False, "occurrence", False), + ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDateTime, False, "occurrence", False), ("occurrencePeriod", "occurrencePeriod", period.Period, False, "occurrence", False), ("payload", "payload", CommunicationRequestPayload, True, None, False), ("priority", "priority", str, False, None, False), diff --git a/fhirclient/models/compartmentdefinition.py b/fhirclient/models/compartmentdefinition.py index a22cb0c68..bf39f1a87 100644 --- a/fhirclient/models/compartmentdefinition.py +++ b/fhirclient/models/compartmentdefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CompartmentDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CompartmentDefinition). +# 2024, SMART Health IT. from . import domainresource @@ -31,7 +31,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the compartment definition. @@ -85,7 +85,7 @@ def elementProperties(self): js.extend([ ("code", "code", str, False, None, True), ("contact", "contact", contactdetail.ContactDetail, True, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("experimental", "experimental", bool, False, None, False), ("name", "name", str, False, None, True), diff --git a/fhirclient/models/composition.py b/fhirclient/models/composition.py index 018689549..4fe3b45f4 100644 --- a/fhirclient/models/composition.py +++ b/fhirclient/models/composition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Composition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Composition). +# 2024, SMART Health IT. from . import domainresource @@ -51,7 +51,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Composition editing time. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.encounter = None """ Context of the Composition. @@ -99,7 +99,7 @@ def elementProperties(self): ("category", "category", codeableconcept.CodeableConcept, True, None, False), ("confidentiality", "confidentiality", str, False, None, False), ("custodian", "custodian", fhirreference.FHIRReference, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, True), + ("date", "date", fhirdate.FHIRDateTime, False, None, True), ("encounter", "encounter", fhirreference.FHIRReference, False, None, False), ("event", "event", CompositionEvent, True, None, False), ("identifier", "identifier", identifier.Identifier, False, None, False), @@ -141,7 +141,7 @@ def __init__(self, jsondict=None, strict=True): self.time = None """ When the composition was attested. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ super(CompositionAttester, self).__init__(jsondict=jsondict, strict=strict) @@ -150,7 +150,7 @@ def elementProperties(self): js.extend([ ("mode", "mode", str, False, None, True), ("party", "party", fhirreference.FHIRReference, False, None, False), - ("time", "time", fhirdate.FHIRDate, False, None, False), + ("time", "time", fhirdate.FHIRDateTime, False, None, False), ]) return js diff --git a/fhirclient/models/conceptmap.py b/fhirclient/models/conceptmap.py index 64ce2e38f..349341134 100644 --- a/fhirclient/models/conceptmap.py +++ b/fhirclient/models/conceptmap.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ConceptMap) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ConceptMap). +# 2024, SMART Health IT. from . import domainresource @@ -32,7 +32,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the concept map. @@ -112,7 +112,7 @@ def elementProperties(self): js.extend([ ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("experimental", "experimental", bool, False, None, False), ("group", "group", ConceptMapGroup, True, None, False), diff --git a/fhirclient/models/condition.py b/fhirclient/models/condition.py index d4114071e..21b8ace35 100644 --- a/fhirclient/models/condition.py +++ b/fhirclient/models/condition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Condition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Condition). +# 2024, SMART Health IT. from . import domainresource @@ -27,7 +27,7 @@ def __init__(self, jsondict=None, strict=True): self.abatementDateTime = None """ When in resolution/remission. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.abatementPeriod = None """ When in resolution/remission. @@ -83,7 +83,7 @@ def __init__(self, jsondict=None, strict=True): self.onsetDateTime = None """ Estimated or actual date, date-time, or age. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.onsetPeriod = None """ Estimated or actual date, date-time, or age. @@ -99,7 +99,7 @@ def __init__(self, jsondict=None, strict=True): self.recordedDate = None """ Date record was first recorded. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.recorder = None """ Who recorded the condition. @@ -128,7 +128,7 @@ def elementProperties(self): js = super(Condition, self).elementProperties() js.extend([ ("abatementAge", "abatementAge", age.Age, False, "abatement", False), - ("abatementDateTime", "abatementDateTime", fhirdate.FHIRDate, False, "abatement", False), + ("abatementDateTime", "abatementDateTime", fhirdate.FHIRDateTime, False, "abatement", False), ("abatementPeriod", "abatementPeriod", period.Period, False, "abatement", False), ("abatementRange", "abatementRange", range.Range, False, "abatement", False), ("abatementString", "abatementString", str, False, "abatement", False), @@ -142,11 +142,11 @@ def elementProperties(self): ("identifier", "identifier", identifier.Identifier, True, None, False), ("note", "note", annotation.Annotation, True, None, False), ("onsetAge", "onsetAge", age.Age, False, "onset", False), - ("onsetDateTime", "onsetDateTime", fhirdate.FHIRDate, False, "onset", False), + ("onsetDateTime", "onsetDateTime", fhirdate.FHIRDateTime, False, "onset", False), ("onsetPeriod", "onsetPeriod", period.Period, False, "onset", False), ("onsetRange", "onsetRange", range.Range, False, "onset", False), ("onsetString", "onsetString", str, False, "onset", False), - ("recordedDate", "recordedDate", fhirdate.FHIRDate, False, None, False), + ("recordedDate", "recordedDate", fhirdate.FHIRDateTime, False, None, False), ("recorder", "recorder", fhirreference.FHIRReference, False, None, False), ("severity", "severity", codeableconcept.CodeableConcept, False, None, False), ("stage", "stage", ConditionStage, True, None, False), diff --git a/fhirclient/models/consent.py b/fhirclient/models/consent.py index e0f9bb9bc..21ee4dbf4 100644 --- a/fhirclient/models/consent.py +++ b/fhirclient/models/consent.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Consent) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Consent). +# 2024, SMART Health IT. from . import domainresource @@ -29,7 +29,7 @@ def __init__(self, jsondict=None, strict=True): self.dateTime = None """ When this Consent was created or indexed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.identifier = None """ Identifier for this record (external references). @@ -85,7 +85,7 @@ def elementProperties(self): js = super(Consent, self).elementProperties() js.extend([ ("category", "category", codeableconcept.CodeableConcept, True, None, True), - ("dateTime", "dateTime", fhirdate.FHIRDate, False, None, False), + ("dateTime", "dateTime", fhirdate.FHIRDateTime, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("organization", "organization", fhirreference.FHIRReference, True, None, False), ("patient", "patient", fhirreference.FHIRReference, False, None, False), @@ -312,7 +312,7 @@ def __init__(self, jsondict=None, strict=True): self.verificationDate = None """ When consent verified. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.verified = None """ Has been verified. @@ -327,7 +327,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(ConsentVerification, self).elementProperties() js.extend([ - ("verificationDate", "verificationDate", fhirdate.FHIRDate, False, None, False), + ("verificationDate", "verificationDate", fhirdate.FHIRDateTime, False, None, False), ("verified", "verified", bool, False, None, True), ("verifiedWith", "verifiedWith", fhirreference.FHIRReference, False, None, False), ]) diff --git a/fhirclient/models/contactdetail.py b/fhirclient/models/contactdetail.py index 9e4ce7f55..a36789959 100644 --- a/fhirclient/models/contactdetail.py +++ b/fhirclient/models/contactdetail.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ContactDetail) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ContactDetail). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/contactpoint.py b/fhirclient/models/contactpoint.py index 1049f6213..2475c4bad 100644 --- a/fhirclient/models/contactpoint.py +++ b/fhirclient/models/contactpoint.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ContactPoint) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ContactPoint). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/contract.py b/fhirclient/models/contract.py index 79676ce1f..62ed7d3a7 100644 --- a/fhirclient/models/contract.py +++ b/fhirclient/models/contract.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Contract) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Contract). +# 2024, SMART Health IT. from . import domainresource @@ -72,7 +72,7 @@ def __init__(self, jsondict=None, strict=True): self.issued = None """ When this Contract was issued. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.legal = None """ Contract Legal Language. @@ -181,7 +181,7 @@ def elementProperties(self): ("identifier", "identifier", identifier.Identifier, True, None, False), ("instantiatesCanonical", "instantiatesCanonical", fhirreference.FHIRReference, False, None, False), ("instantiatesUri", "instantiatesUri", str, False, None, False), - ("issued", "issued", fhirdate.FHIRDate, False, None, False), + ("issued", "issued", fhirdate.FHIRDateTime, False, None, False), ("legal", "legal", ContractLegal, True, None, False), ("legalState", "legalState", codeableconcept.CodeableConcept, False, None, False), ("legallyBindingAttachment", "legallyBindingAttachment", attachment.Attachment, False, "legallyBinding", False), @@ -234,7 +234,7 @@ def __init__(self, jsondict=None, strict=True): self.publicationDate = None """ When published. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.publicationStatus = None """ amended | appended | cancelled | disputed | entered-in-error | @@ -260,7 +260,7 @@ def elementProperties(self): js = super(ContractContentDefinition, self).elementProperties() js.extend([ ("copyright", "copyright", str, False, None, False), - ("publicationDate", "publicationDate", fhirdate.FHIRDate, False, None, False), + ("publicationDate", "publicationDate", fhirdate.FHIRDateTime, False, None, False), ("publicationStatus", "publicationStatus", str, False, None, True), ("publisher", "publisher", fhirreference.FHIRReference, False, None, False), ("subType", "subType", codeableconcept.CodeableConcept, False, None, False), @@ -462,7 +462,7 @@ def __init__(self, jsondict=None, strict=True): self.issued = None """ Contract Term Issue Date Time. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.offer = None """ Context of the Contract term. @@ -502,7 +502,7 @@ def elementProperties(self): ("asset", "asset", ContractTermAsset, True, None, False), ("group", "group", ContractTerm, True, None, False), ("identifier", "identifier", identifier.Identifier, False, None, False), - ("issued", "issued", fhirdate.FHIRDate, False, None, False), + ("issued", "issued", fhirdate.FHIRDateTime, False, None, False), ("offer", "offer", ContractTermOffer, False, None, True), ("securityLabel", "securityLabel", ContractTermSecurityLabel, True, None, False), ("subType", "subType", codeableconcept.CodeableConcept, False, None, False), @@ -557,7 +557,7 @@ def __init__(self, jsondict=None, strict=True): self.occurrenceDateTime = None """ When action happens. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.occurrencePeriod = None """ When action happens. @@ -634,7 +634,7 @@ def elementProperties(self): ("intent", "intent", codeableconcept.CodeableConcept, False, None, True), ("linkId", "linkId", str, True, None, False), ("note", "note", annotation.Annotation, True, None, False), - ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDate, False, "occurrence", False), + ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDateTime, False, "occurrence", False), ("occurrencePeriod", "occurrencePeriod", period.Period, False, "occurrence", False), ("occurrenceTiming", "occurrenceTiming", timing.Timing, False, "occurrence", False), ("performer", "performer", fhirreference.FHIRReference, False, None, False), @@ -840,7 +840,7 @@ def __init__(self, jsondict=None, strict=True): self.effectiveTime = None """ Contract Valued Item Effective Tiem. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.entityCodeableConcept = None """ Contract Valued Item Type. @@ -872,7 +872,7 @@ def __init__(self, jsondict=None, strict=True): self.paymentDate = None """ When payment is due. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.points = None """ Contract Valued Item Difficulty Scaling Factor. @@ -903,7 +903,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(ContractTermAssetValuedItem, self).elementProperties() js.extend([ - ("effectiveTime", "effectiveTime", fhirdate.FHIRDate, False, None, False), + ("effectiveTime", "effectiveTime", fhirdate.FHIRDateTime, False, None, False), ("entityCodeableConcept", "entityCodeableConcept", codeableconcept.CodeableConcept, False, "entity", False), ("entityReference", "entityReference", fhirreference.FHIRReference, False, "entity", False), ("factor", "factor", float, False, None, False), @@ -911,7 +911,7 @@ def elementProperties(self): ("linkId", "linkId", str, True, None, False), ("net", "net", money.Money, False, None, False), ("payment", "payment", str, False, None, False), - ("paymentDate", "paymentDate", fhirdate.FHIRDate, False, None, False), + ("paymentDate", "paymentDate", fhirdate.FHIRDateTime, False, None, False), ("points", "points", float, False, None, False), ("quantity", "quantity", quantity.Quantity, False, None, False), ("recipient", "recipient", fhirreference.FHIRReference, False, None, False), @@ -1029,7 +1029,7 @@ def __init__(self, jsondict=None, strict=True): self.valueDateTime = None """ The actual answer response. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.valueDecimal = None """ The actual answer response. @@ -1053,7 +1053,7 @@ def __init__(self, jsondict=None, strict=True): self.valueTime = None """ The actual answer response. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.valueUri = None """ The actual answer response. @@ -1068,13 +1068,13 @@ def elementProperties(self): ("valueBoolean", "valueBoolean", bool, False, "value", True), ("valueCoding", "valueCoding", coding.Coding, False, "value", True), ("valueDate", "valueDate", fhirdate.FHIRDate, False, "value", True), - ("valueDateTime", "valueDateTime", fhirdate.FHIRDate, False, "value", True), + ("valueDateTime", "valueDateTime", fhirdate.FHIRDateTime, False, "value", True), ("valueDecimal", "valueDecimal", float, False, "value", True), ("valueInteger", "valueInteger", int, False, "value", True), ("valueQuantity", "valueQuantity", quantity.Quantity, False, "value", True), ("valueReference", "valueReference", fhirreference.FHIRReference, False, "value", True), ("valueString", "valueString", str, False, "value", True), - ("valueTime", "valueTime", fhirdate.FHIRDate, False, "value", True), + ("valueTime", "valueTime", fhirdate.FHIRTime, False, "value", True), ("valueUri", "valueUri", str, False, "value", True), ]) return js @@ -1164,6 +1164,8 @@ def elementProperties(self): from . import codeableconcept from . import coding from . import fhirdate +from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import money diff --git a/fhirclient/models/contributor.py b/fhirclient/models/contributor.py index 522d00bfd..651079b12 100644 --- a/fhirclient/models/contributor.py +++ b/fhirclient/models/contributor.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Contributor) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Contributor). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/count.py b/fhirclient/models/count.py index 9b7fdf9ab..bccc80bf4 100644 --- a/fhirclient/models/count.py +++ b/fhirclient/models/count.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Count) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Count). +# 2024, SMART Health IT. from . import quantity diff --git a/fhirclient/models/coverage.py b/fhirclient/models/coverage.py index 5c4576239..e4d5d75e6 100644 --- a/fhirclient/models/coverage.py +++ b/fhirclient/models/coverage.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Coverage) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Coverage). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/coverageeligibilityrequest.py b/fhirclient/models/coverageeligibilityrequest.py index 6b64876fd..0421e024f 100644 --- a/fhirclient/models/coverageeligibilityrequest.py +++ b/fhirclient/models/coverageeligibilityrequest.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CoverageEligibilityRequest) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CoverageEligibilityRequest). +# 2024, SMART Health IT. from . import domainresource @@ -26,7 +26,7 @@ def __init__(self, jsondict=None, strict=True): self.created = None """ Creation date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.enterer = None """ Author. @@ -89,7 +89,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(CoverageEligibilityRequest, self).elementProperties() js.extend([ - ("created", "created", fhirdate.FHIRDate, False, None, True), + ("created", "created", fhirdate.FHIRDateTime, False, None, True), ("enterer", "enterer", fhirreference.FHIRReference, False, None, False), ("facility", "facility", fhirreference.FHIRReference, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), @@ -305,6 +305,7 @@ def elementProperties(self): from . import codeableconcept from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import money diff --git a/fhirclient/models/coverageeligibilityresponse.py b/fhirclient/models/coverageeligibilityresponse.py index 2e18b0a6e..6f11cb4a7 100644 --- a/fhirclient/models/coverageeligibilityresponse.py +++ b/fhirclient/models/coverageeligibilityresponse.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CoverageEligibilityResponse) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/CoverageEligibilityResponse). +# 2024, SMART Health IT. from . import domainresource @@ -23,7 +23,7 @@ def __init__(self, jsondict=None, strict=True): self.created = None """ Response creation date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.disposition = None """ Disposition Message. @@ -90,7 +90,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(CoverageEligibilityResponse, self).elementProperties() js.extend([ - ("created", "created", fhirdate.FHIRDate, False, None, True), + ("created", "created", fhirdate.FHIRDateTime, False, None, True), ("disposition", "disposition", str, False, None, False), ("error", "error", CoverageEligibilityResponseError, True, None, False), ("form", "form", codeableconcept.CodeableConcept, False, None, False), @@ -346,6 +346,7 @@ def elementProperties(self): from . import codeableconcept from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import money diff --git a/fhirclient/models/datarequirement.py b/fhirclient/models/datarequirement.py index abf4984f1..db11fd65a 100644 --- a/fhirclient/models/datarequirement.py +++ b/fhirclient/models/datarequirement.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DataRequirement) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DataRequirement). +# 2024, SMART Health IT. from . import element @@ -154,7 +154,7 @@ def __init__(self, jsondict=None, strict=True): self.valueDateTime = None """ The value of the filter, as a Period, DateTime, or Duration value. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.valueDuration = None """ The value of the filter, as a Period, DateTime, or Duration value. @@ -171,7 +171,7 @@ def elementProperties(self): js.extend([ ("path", "path", str, False, None, False), ("searchParam", "searchParam", str, False, None, False), - ("valueDateTime", "valueDateTime", fhirdate.FHIRDate, False, "value", False), + ("valueDateTime", "valueDateTime", fhirdate.FHIRDateTime, False, "value", False), ("valueDuration", "valueDuration", duration.Duration, False, "value", False), ("valuePeriod", "valuePeriod", period.Period, False, "value", False), ]) diff --git a/fhirclient/models/detectedissue.py b/fhirclient/models/detectedissue.py index 2b9c6088d..9e99782e4 100644 --- a/fhirclient/models/detectedissue.py +++ b/fhirclient/models/detectedissue.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DetectedIssue) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DetectedIssue). +# 2024, SMART Health IT. from . import domainresource @@ -41,7 +41,7 @@ def __init__(self, jsondict=None, strict=True): self.identifiedDateTime = None """ When identified. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.identifiedPeriod = None """ When identified. @@ -84,7 +84,7 @@ def elementProperties(self): ("code", "code", codeableconcept.CodeableConcept, False, None, False), ("detail", "detail", str, False, None, False), ("evidence", "evidence", DetectedIssueEvidence, True, None, False), - ("identifiedDateTime", "identifiedDateTime", fhirdate.FHIRDate, False, "identified", False), + ("identifiedDateTime", "identifiedDateTime", fhirdate.FHIRDateTime, False, "identified", False), ("identifiedPeriod", "identifiedPeriod", period.Period, False, "identified", False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("implicated", "implicated", fhirreference.FHIRReference, True, None, False), @@ -164,7 +164,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date committed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ super(DetectedIssueMitigation, self).__init__(jsondict=jsondict, strict=strict) @@ -173,7 +173,7 @@ def elementProperties(self): js.extend([ ("action", "action", codeableconcept.CodeableConcept, False, None, True), ("author", "author", fhirreference.FHIRReference, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ]) return js diff --git a/fhirclient/models/device.py b/fhirclient/models/device.py index bf34891e9..b3304fc22 100644 --- a/fhirclient/models/device.py +++ b/fhirclient/models/device.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Device) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Device). +# 2024, SMART Health IT. from . import domainresource @@ -40,7 +40,7 @@ def __init__(self, jsondict=None, strict=True): self.expirationDate = None """ Date and time of expiry of this device (if applicable). - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.identifier = None """ Instance identifier. @@ -56,7 +56,7 @@ def __init__(self, jsondict=None, strict=True): self.manufactureDate = None """ Date when the device was made. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.manufacturer = None """ Name of device manufacturer. @@ -140,11 +140,11 @@ def elementProperties(self): ("definition", "definition", fhirreference.FHIRReference, False, None, False), ("deviceName", "deviceName", DeviceDeviceName, True, None, False), ("distinctIdentifier", "distinctIdentifier", str, False, None, False), - ("expirationDate", "expirationDate", fhirdate.FHIRDate, False, None, False), + ("expirationDate", "expirationDate", fhirdate.FHIRDateTime, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("location", "location", fhirreference.FHIRReference, False, None, False), ("lotNumber", "lotNumber", str, False, None, False), - ("manufactureDate", "manufactureDate", fhirdate.FHIRDate, False, None, False), + ("manufactureDate", "manufactureDate", fhirdate.FHIRDateTime, False, None, False), ("manufacturer", "manufacturer", str, False, None, False), ("modelNumber", "modelNumber", str, False, None, False), ("note", "note", annotation.Annotation, True, None, False), diff --git a/fhirclient/models/devicedefinition.py b/fhirclient/models/devicedefinition.py index e21167467..e3b88463c 100644 --- a/fhirclient/models/devicedefinition.py +++ b/fhirclient/models/devicedefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DeviceDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DeviceDefinition). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/devicemetric.py b/fhirclient/models/devicemetric.py index 44068dbbc..84bb29991 100644 --- a/fhirclient/models/devicemetric.py +++ b/fhirclient/models/devicemetric.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DeviceMetric) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DeviceMetric). +# 2024, SMART Health IT. from . import domainresource @@ -104,7 +104,7 @@ def __init__(self, jsondict=None, strict=True): self.time = None """ Describes the time last calibration has been performed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.type = None """ unspecified | offset | gain | two-point. @@ -116,7 +116,7 @@ def elementProperties(self): js = super(DeviceMetricCalibration, self).elementProperties() js.extend([ ("state", "state", str, False, None, False), - ("time", "time", fhirdate.FHIRDate, False, None, False), + ("time", "time", fhirdate.FHIRInstant, False, None, False), ("type", "type", str, False, None, False), ]) return js diff --git a/fhirclient/models/devicerequest.py b/fhirclient/models/devicerequest.py index 5b13d6fdc..ea30bd1b3 100644 --- a/fhirclient/models/devicerequest.py +++ b/fhirclient/models/devicerequest.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DeviceRequest) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DeviceRequest). +# 2024, SMART Health IT. from . import domainresource @@ -24,7 +24,7 @@ def __init__(self, jsondict=None, strict=True): self.authoredOn = None """ When recorded. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.basedOn = None """ What request fulfills. @@ -73,7 +73,7 @@ def __init__(self, jsondict=None, strict=True): self.occurrenceDateTime = None """ Desired time or schedule for use. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.occurrencePeriod = None """ Desired time or schedule for use. @@ -137,7 +137,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(DeviceRequest, self).elementProperties() js.extend([ - ("authoredOn", "authoredOn", fhirdate.FHIRDate, False, None, False), + ("authoredOn", "authoredOn", fhirdate.FHIRDateTime, False, None, False), ("basedOn", "basedOn", fhirreference.FHIRReference, True, None, False), ("codeCodeableConcept", "codeCodeableConcept", codeableconcept.CodeableConcept, False, "code", True), ("codeReference", "codeReference", fhirreference.FHIRReference, False, "code", True), @@ -149,7 +149,7 @@ def elementProperties(self): ("insurance", "insurance", fhirreference.FHIRReference, True, None, False), ("intent", "intent", str, False, None, True), ("note", "note", annotation.Annotation, True, None, False), - ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDate, False, "occurrence", False), + ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDateTime, False, "occurrence", False), ("occurrencePeriod", "occurrencePeriod", period.Period, False, "occurrence", False), ("occurrenceTiming", "occurrenceTiming", timing.Timing, False, "occurrence", False), ("parameter", "parameter", DeviceRequestParameter, True, None, False), diff --git a/fhirclient/models/deviceusestatement.py b/fhirclient/models/deviceusestatement.py index 7da88ce9b..091e9a3a9 100644 --- a/fhirclient/models/deviceusestatement.py +++ b/fhirclient/models/deviceusestatement.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DeviceUseStatement) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DeviceUseStatement). +# 2024, SMART Health IT. from . import domainresource @@ -55,7 +55,7 @@ def __init__(self, jsondict=None, strict=True): self.recordedOn = None """ When statement was recorded. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.source = None """ Who made the statement. @@ -71,7 +71,7 @@ def __init__(self, jsondict=None, strict=True): self.timingDateTime = None """ How often the device was used. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.timingPeriod = None """ How often the device was used. @@ -94,11 +94,11 @@ def elementProperties(self): ("note", "note", annotation.Annotation, True, None, False), ("reasonCode", "reasonCode", codeableconcept.CodeableConcept, True, None, False), ("reasonReference", "reasonReference", fhirreference.FHIRReference, True, None, False), - ("recordedOn", "recordedOn", fhirdate.FHIRDate, False, None, False), + ("recordedOn", "recordedOn", fhirdate.FHIRDateTime, False, None, False), ("source", "source", fhirreference.FHIRReference, False, None, False), ("status", "status", str, False, None, True), ("subject", "subject", fhirreference.FHIRReference, False, None, True), - ("timingDateTime", "timingDateTime", fhirdate.FHIRDate, False, "timing", False), + ("timingDateTime", "timingDateTime", fhirdate.FHIRDateTime, False, "timing", False), ("timingPeriod", "timingPeriod", period.Period, False, "timing", False), ("timingTiming", "timingTiming", timing.Timing, False, "timing", False), ]) diff --git a/fhirclient/models/diagnosticreport.py b/fhirclient/models/diagnosticreport.py index e50837756..14a5867af 100644 --- a/fhirclient/models/diagnosticreport.py +++ b/fhirclient/models/diagnosticreport.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DiagnosticReport) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DiagnosticReport). +# 2024, SMART Health IT. from . import domainresource @@ -47,7 +47,7 @@ def __init__(self, jsondict=None, strict=True): self.effectiveDateTime = None """ Clinically relevant time/time-period for report. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.effectivePeriod = None """ Clinically relevant time/time-period for report. @@ -68,7 +68,7 @@ def __init__(self, jsondict=None, strict=True): self.issued = None """ DateTime this version was made. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.media = None """ Key images associated with this report. @@ -112,12 +112,12 @@ def elementProperties(self): ("code", "code", codeableconcept.CodeableConcept, False, None, True), ("conclusion", "conclusion", str, False, None, False), ("conclusionCode", "conclusionCode", codeableconcept.CodeableConcept, True, None, False), - ("effectiveDateTime", "effectiveDateTime", fhirdate.FHIRDate, False, "effective", False), + ("effectiveDateTime", "effectiveDateTime", fhirdate.FHIRDateTime, False, "effective", False), ("effectivePeriod", "effectivePeriod", period.Period, False, "effective", False), ("encounter", "encounter", fhirreference.FHIRReference, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("imagingStudy", "imagingStudy", fhirreference.FHIRReference, True, None, False), - ("issued", "issued", fhirdate.FHIRDate, False, None, False), + ("issued", "issued", fhirdate.FHIRInstant, False, None, False), ("media", "media", DiagnosticReportMedia, True, None, False), ("performer", "performer", fhirreference.FHIRReference, True, None, False), ("presentedForm", "presentedForm", attachment.Attachment, True, None, False), @@ -172,6 +172,7 @@ def elementProperties(self): from . import attachment from . import codeableconcept from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/distance.py b/fhirclient/models/distance.py index 5af7ddd25..b27172171 100644 --- a/fhirclient/models/distance.py +++ b/fhirclient/models/distance.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Distance) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Distance). +# 2024, SMART Health IT. from . import quantity diff --git a/fhirclient/models/documentmanifest.py b/fhirclient/models/documentmanifest.py index f670fe2a7..301b366da 100644 --- a/fhirclient/models/documentmanifest.py +++ b/fhirclient/models/documentmanifest.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DocumentManifest) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DocumentManifest). +# 2024, SMART Health IT. from . import domainresource @@ -31,7 +31,7 @@ def __init__(self, jsondict=None, strict=True): self.created = None """ When this document manifest created. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Human-readable description (title). @@ -76,7 +76,7 @@ def elementProperties(self): js.extend([ ("author", "author", fhirreference.FHIRReference, True, None, False), ("content", "content", fhirreference.FHIRReference, True, None, True), - ("created", "created", fhirdate.FHIRDate, False, None, False), + ("created", "created", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("masterIdentifier", "masterIdentifier", identifier.Identifier, False, None, False), diff --git a/fhirclient/models/documentreference.py b/fhirclient/models/documentreference.py index e5b4d6be1..809293754 100644 --- a/fhirclient/models/documentreference.py +++ b/fhirclient/models/documentreference.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DocumentReference) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DocumentReference). +# 2024, SMART Health IT. from . import domainresource @@ -50,7 +50,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ When this document reference was created. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.description = None """ Human-readable description. @@ -99,7 +99,7 @@ def elementProperties(self): ("content", "content", DocumentReferenceContent, True, None, True), ("context", "context", DocumentReferenceContext, False, None, False), ("custodian", "custodian", fhirreference.FHIRReference, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRInstant, False, None, False), ("description", "description", str, False, None, False), ("docStatus", "docStatus", str, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), diff --git a/fhirclient/models/domainresource.py b/fhirclient/models/domainresource.py index 523dda180..dff256d83 100644 --- a/fhirclient/models/domainresource.py +++ b/fhirclient/models/domainresource.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DomainResource) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/DomainResource). +# 2024, SMART Health IT. from . import resource diff --git a/fhirclient/models/dosage.py b/fhirclient/models/dosage.py index bc53817db..c7b3381c0 100644 --- a/fhirclient/models/dosage.py +++ b/fhirclient/models/dosage.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Dosage) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Dosage). +# 2024, SMART Health IT. from . import backboneelement diff --git a/fhirclient/models/duration.py b/fhirclient/models/duration.py index 20d76100f..7b06de191 100644 --- a/fhirclient/models/duration.py +++ b/fhirclient/models/duration.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Duration) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Duration). +# 2024, SMART Health IT. from . import quantity diff --git a/fhirclient/models/effectevidencesynthesis.py b/fhirclient/models/effectevidencesynthesis.py index 252972117..e206fbfe4 100644 --- a/fhirclient/models/effectevidencesynthesis.py +++ b/fhirclient/models/effectevidencesynthesis.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EffectEvidenceSynthesis) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EffectEvidenceSynthesis). +# 2024, SMART Health IT. from . import domainresource @@ -44,7 +44,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the effect evidence synthesis. @@ -166,7 +166,7 @@ def elementProperties(self): ("certainty", "certainty", EffectEvidenceSynthesisCertainty, True, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("editor", "editor", contactdetail.ContactDetail, True, None, False), ("effectEstimate", "effectEstimate", EffectEvidenceSynthesisEffectEstimate, True, None, False), @@ -470,6 +470,7 @@ def elementProperties(self): from . import codeableconcept from . import contactdetail from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/element.py b/fhirclient/models/element.py index c555758e4..aa081da8a 100644 --- a/fhirclient/models/element.py +++ b/fhirclient/models/element.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Element) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Element). +# 2024, SMART Health IT. from . import fhirabstractbase diff --git a/fhirclient/models/elementdefinition.py b/fhirclient/models/elementdefinition.py index 9e70282ea..e1f2e2de8 100644 --- a/fhirclient/models/elementdefinition.py +++ b/fhirclient/models/elementdefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ElementDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ElementDefinition). +# 2024, SMART Health IT. from . import backboneelement @@ -119,7 +119,7 @@ def __init__(self, jsondict=None, strict=True): self.defaultValueDateTime = None """ Specified value if missing from instance. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.defaultValueDecimal = None """ Specified value if missing from instance. @@ -155,7 +155,7 @@ def __init__(self, jsondict=None, strict=True): self.defaultValueInstant = None """ Specified value if missing from instance. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.defaultValueInteger = None """ Specified value if missing from instance. @@ -223,7 +223,7 @@ def __init__(self, jsondict=None, strict=True): self.defaultValueTime = None """ Specified value if missing from instance. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.defaultValueTiming = None """ Specified value if missing from instance. @@ -327,7 +327,7 @@ def __init__(self, jsondict=None, strict=True): self.fixedDateTime = None """ Value must be exactly this. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.fixedDecimal = None """ Value must be exactly this. @@ -363,7 +363,7 @@ def __init__(self, jsondict=None, strict=True): self.fixedInstant = None """ Value must be exactly this. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.fixedInteger = None """ Value must be exactly this. @@ -431,7 +431,7 @@ def __init__(self, jsondict=None, strict=True): self.fixedTime = None """ Value must be exactly this. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.fixedTiming = None """ Value must be exactly this. @@ -495,7 +495,7 @@ def __init__(self, jsondict=None, strict=True): self.maxValueDateTime = None """ Maximum Allowed Value (for some types). - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.maxValueDecimal = None """ Maximum Allowed Value (for some types). @@ -503,7 +503,7 @@ def __init__(self, jsondict=None, strict=True): self.maxValueInstant = None """ Maximum Allowed Value (for some types). - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.maxValueInteger = None """ Maximum Allowed Value (for some types). @@ -519,7 +519,7 @@ def __init__(self, jsondict=None, strict=True): self.maxValueTime = None """ Maximum Allowed Value (for some types). - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.maxValueUnsignedInt = None """ Maximum Allowed Value (for some types). @@ -539,7 +539,7 @@ def __init__(self, jsondict=None, strict=True): self.minValueDateTime = None """ Minimum Allowed Value (for some types). - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.minValueDecimal = None """ Minimum Allowed Value (for some types). @@ -547,7 +547,7 @@ def __init__(self, jsondict=None, strict=True): self.minValueInstant = None """ Minimum Allowed Value (for some types). - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.minValueInteger = None """ Minimum Allowed Value (for some types). @@ -563,7 +563,7 @@ def __init__(self, jsondict=None, strict=True): self.minValueTime = None """ Minimum Allowed Value (for some types). - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.minValueUnsignedInt = None """ Minimum Allowed Value (for some types). @@ -647,7 +647,7 @@ def __init__(self, jsondict=None, strict=True): self.patternDateTime = None """ Value must have at least these property values. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.patternDecimal = None """ Value must have at least these property values. @@ -683,7 +683,7 @@ def __init__(self, jsondict=None, strict=True): self.patternInstant = None """ Value must have at least these property values. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.patternInteger = None """ Value must have at least these property values. @@ -751,7 +751,7 @@ def __init__(self, jsondict=None, strict=True): self.patternTime = None """ Value must have at least these property values. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.patternTiming = None """ Value must have at least these property values. @@ -839,7 +839,7 @@ def elementProperties(self): ("defaultValueCount", "defaultValueCount", count.Count, False, "defaultValue", False), ("defaultValueDataRequirement", "defaultValueDataRequirement", datarequirement.DataRequirement, False, "defaultValue", False), ("defaultValueDate", "defaultValueDate", fhirdate.FHIRDate, False, "defaultValue", False), - ("defaultValueDateTime", "defaultValueDateTime", fhirdate.FHIRDate, False, "defaultValue", False), + ("defaultValueDateTime", "defaultValueDateTime", fhirdate.FHIRDateTime, False, "defaultValue", False), ("defaultValueDecimal", "defaultValueDecimal", float, False, "defaultValue", False), ("defaultValueDistance", "defaultValueDistance", distance.Distance, False, "defaultValue", False), ("defaultValueDosage", "defaultValueDosage", dosage.Dosage, False, "defaultValue", False), @@ -848,7 +848,7 @@ def elementProperties(self): ("defaultValueHumanName", "defaultValueHumanName", humanname.HumanName, False, "defaultValue", False), ("defaultValueId", "defaultValueId", str, False, "defaultValue", False), ("defaultValueIdentifier", "defaultValueIdentifier", identifier.Identifier, False, "defaultValue", False), - ("defaultValueInstant", "defaultValueInstant", fhirdate.FHIRDate, False, "defaultValue", False), + ("defaultValueInstant", "defaultValueInstant", fhirdate.FHIRInstant, False, "defaultValue", False), ("defaultValueInteger", "defaultValueInteger", int, False, "defaultValue", False), ("defaultValueMarkdown", "defaultValueMarkdown", str, False, "defaultValue", False), ("defaultValueMeta", "defaultValueMeta", meta.Meta, False, "defaultValue", False), @@ -865,7 +865,7 @@ def elementProperties(self): ("defaultValueSampledData", "defaultValueSampledData", sampleddata.SampledData, False, "defaultValue", False), ("defaultValueSignature", "defaultValueSignature", signature.Signature, False, "defaultValue", False), ("defaultValueString", "defaultValueString", str, False, "defaultValue", False), - ("defaultValueTime", "defaultValueTime", fhirdate.FHIRDate, False, "defaultValue", False), + ("defaultValueTime", "defaultValueTime", fhirdate.FHIRTime, False, "defaultValue", False), ("defaultValueTiming", "defaultValueTiming", timing.Timing, False, "defaultValue", False), ("defaultValueTriggerDefinition", "defaultValueTriggerDefinition", triggerdefinition.TriggerDefinition, False, "defaultValue", False), ("defaultValueUnsignedInt", "defaultValueUnsignedInt", int, False, "defaultValue", False), @@ -891,7 +891,7 @@ def elementProperties(self): ("fixedCount", "fixedCount", count.Count, False, "fixed", False), ("fixedDataRequirement", "fixedDataRequirement", datarequirement.DataRequirement, False, "fixed", False), ("fixedDate", "fixedDate", fhirdate.FHIRDate, False, "fixed", False), - ("fixedDateTime", "fixedDateTime", fhirdate.FHIRDate, False, "fixed", False), + ("fixedDateTime", "fixedDateTime", fhirdate.FHIRDateTime, False, "fixed", False), ("fixedDecimal", "fixedDecimal", float, False, "fixed", False), ("fixedDistance", "fixedDistance", distance.Distance, False, "fixed", False), ("fixedDosage", "fixedDosage", dosage.Dosage, False, "fixed", False), @@ -900,7 +900,7 @@ def elementProperties(self): ("fixedHumanName", "fixedHumanName", humanname.HumanName, False, "fixed", False), ("fixedId", "fixedId", str, False, "fixed", False), ("fixedIdentifier", "fixedIdentifier", identifier.Identifier, False, "fixed", False), - ("fixedInstant", "fixedInstant", fhirdate.FHIRDate, False, "fixed", False), + ("fixedInstant", "fixedInstant", fhirdate.FHIRInstant, False, "fixed", False), ("fixedInteger", "fixedInteger", int, False, "fixed", False), ("fixedMarkdown", "fixedMarkdown", str, False, "fixed", False), ("fixedMeta", "fixedMeta", meta.Meta, False, "fixed", False), @@ -917,7 +917,7 @@ def elementProperties(self): ("fixedSampledData", "fixedSampledData", sampleddata.SampledData, False, "fixed", False), ("fixedSignature", "fixedSignature", signature.Signature, False, "fixed", False), ("fixedString", "fixedString", str, False, "fixed", False), - ("fixedTime", "fixedTime", fhirdate.FHIRDate, False, "fixed", False), + ("fixedTime", "fixedTime", fhirdate.FHIRTime, False, "fixed", False), ("fixedTiming", "fixedTiming", timing.Timing, False, "fixed", False), ("fixedTriggerDefinition", "fixedTriggerDefinition", triggerdefinition.TriggerDefinition, False, "fixed", False), ("fixedUnsignedInt", "fixedUnsignedInt", int, False, "fixed", False), @@ -933,24 +933,24 @@ def elementProperties(self): ("max", "max", str, False, None, False), ("maxLength", "maxLength", int, False, None, False), ("maxValueDate", "maxValueDate", fhirdate.FHIRDate, False, "maxValue", False), - ("maxValueDateTime", "maxValueDateTime", fhirdate.FHIRDate, False, "maxValue", False), + ("maxValueDateTime", "maxValueDateTime", fhirdate.FHIRDateTime, False, "maxValue", False), ("maxValueDecimal", "maxValueDecimal", float, False, "maxValue", False), - ("maxValueInstant", "maxValueInstant", fhirdate.FHIRDate, False, "maxValue", False), + ("maxValueInstant", "maxValueInstant", fhirdate.FHIRInstant, False, "maxValue", False), ("maxValueInteger", "maxValueInteger", int, False, "maxValue", False), ("maxValuePositiveInt", "maxValuePositiveInt", int, False, "maxValue", False), ("maxValueQuantity", "maxValueQuantity", quantity.Quantity, False, "maxValue", False), - ("maxValueTime", "maxValueTime", fhirdate.FHIRDate, False, "maxValue", False), + ("maxValueTime", "maxValueTime", fhirdate.FHIRTime, False, "maxValue", False), ("maxValueUnsignedInt", "maxValueUnsignedInt", int, False, "maxValue", False), ("meaningWhenMissing", "meaningWhenMissing", str, False, None, False), ("min", "min", int, False, None, False), ("minValueDate", "minValueDate", fhirdate.FHIRDate, False, "minValue", False), - ("minValueDateTime", "minValueDateTime", fhirdate.FHIRDate, False, "minValue", False), + ("minValueDateTime", "minValueDateTime", fhirdate.FHIRDateTime, False, "minValue", False), ("minValueDecimal", "minValueDecimal", float, False, "minValue", False), - ("minValueInstant", "minValueInstant", fhirdate.FHIRDate, False, "minValue", False), + ("minValueInstant", "minValueInstant", fhirdate.FHIRInstant, False, "minValue", False), ("minValueInteger", "minValueInteger", int, False, "minValue", False), ("minValuePositiveInt", "minValuePositiveInt", int, False, "minValue", False), ("minValueQuantity", "minValueQuantity", quantity.Quantity, False, "minValue", False), - ("minValueTime", "minValueTime", fhirdate.FHIRDate, False, "minValue", False), + ("minValueTime", "minValueTime", fhirdate.FHIRTime, False, "minValue", False), ("minValueUnsignedInt", "minValueUnsignedInt", int, False, "minValue", False), ("mustSupport", "mustSupport", bool, False, None, False), ("orderMeaning", "orderMeaning", str, False, None, False), @@ -971,7 +971,7 @@ def elementProperties(self): ("patternCount", "patternCount", count.Count, False, "pattern", False), ("patternDataRequirement", "patternDataRequirement", datarequirement.DataRequirement, False, "pattern", False), ("patternDate", "patternDate", fhirdate.FHIRDate, False, "pattern", False), - ("patternDateTime", "patternDateTime", fhirdate.FHIRDate, False, "pattern", False), + ("patternDateTime", "patternDateTime", fhirdate.FHIRDateTime, False, "pattern", False), ("patternDecimal", "patternDecimal", float, False, "pattern", False), ("patternDistance", "patternDistance", distance.Distance, False, "pattern", False), ("patternDosage", "patternDosage", dosage.Dosage, False, "pattern", False), @@ -980,7 +980,7 @@ def elementProperties(self): ("patternHumanName", "patternHumanName", humanname.HumanName, False, "pattern", False), ("patternId", "patternId", str, False, "pattern", False), ("patternIdentifier", "patternIdentifier", identifier.Identifier, False, "pattern", False), - ("patternInstant", "patternInstant", fhirdate.FHIRDate, False, "pattern", False), + ("patternInstant", "patternInstant", fhirdate.FHIRInstant, False, "pattern", False), ("patternInteger", "patternInteger", int, False, "pattern", False), ("patternMarkdown", "patternMarkdown", str, False, "pattern", False), ("patternMeta", "patternMeta", meta.Meta, False, "pattern", False), @@ -997,7 +997,7 @@ def elementProperties(self): ("patternSampledData", "patternSampledData", sampleddata.SampledData, False, "pattern", False), ("patternSignature", "patternSignature", signature.Signature, False, "pattern", False), ("patternString", "patternString", str, False, "pattern", False), - ("patternTime", "patternTime", fhirdate.FHIRDate, False, "pattern", False), + ("patternTime", "patternTime", fhirdate.FHIRTime, False, "pattern", False), ("patternTiming", "patternTiming", timing.Timing, False, "pattern", False), ("patternTriggerDefinition", "patternTriggerDefinition", triggerdefinition.TriggerDefinition, False, "pattern", False), ("patternUnsignedInt", "patternUnsignedInt", int, False, "pattern", False), @@ -1254,7 +1254,7 @@ def __init__(self, jsondict=None, strict=True): self.valueDateTime = None """ Value of Example (one of allowed types). - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.valueDecimal = None """ Value of Example (one of allowed types). @@ -1290,7 +1290,7 @@ def __init__(self, jsondict=None, strict=True): self.valueInstant = None """ Value of Example (one of allowed types). - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.valueInteger = None """ Value of Example (one of allowed types). @@ -1358,7 +1358,7 @@ def __init__(self, jsondict=None, strict=True): self.valueTime = None """ Value of Example (one of allowed types). - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.valueTiming = None """ Value of Example (one of allowed types). @@ -1410,7 +1410,7 @@ def elementProperties(self): ("valueCount", "valueCount", count.Count, False, "value", True), ("valueDataRequirement", "valueDataRequirement", datarequirement.DataRequirement, False, "value", True), ("valueDate", "valueDate", fhirdate.FHIRDate, False, "value", True), - ("valueDateTime", "valueDateTime", fhirdate.FHIRDate, False, "value", True), + ("valueDateTime", "valueDateTime", fhirdate.FHIRDateTime, False, "value", True), ("valueDecimal", "valueDecimal", float, False, "value", True), ("valueDistance", "valueDistance", distance.Distance, False, "value", True), ("valueDosage", "valueDosage", dosage.Dosage, False, "value", True), @@ -1419,7 +1419,7 @@ def elementProperties(self): ("valueHumanName", "valueHumanName", humanname.HumanName, False, "value", True), ("valueId", "valueId", str, False, "value", True), ("valueIdentifier", "valueIdentifier", identifier.Identifier, False, "value", True), - ("valueInstant", "valueInstant", fhirdate.FHIRDate, False, "value", True), + ("valueInstant", "valueInstant", fhirdate.FHIRInstant, False, "value", True), ("valueInteger", "valueInteger", int, False, "value", True), ("valueMarkdown", "valueMarkdown", str, False, "value", True), ("valueMeta", "valueMeta", meta.Meta, False, "value", True), @@ -1436,7 +1436,7 @@ def elementProperties(self): ("valueSampledData", "valueSampledData", sampleddata.SampledData, False, "value", True), ("valueSignature", "valueSignature", signature.Signature, False, "value", True), ("valueString", "valueString", str, False, "value", True), - ("valueTime", "valueTime", fhirdate.FHIRDate, False, "value", True), + ("valueTime", "valueTime", fhirdate.FHIRTime, False, "value", True), ("valueTiming", "valueTiming", timing.Timing, False, "value", True), ("valueTriggerDefinition", "valueTriggerDefinition", triggerdefinition.TriggerDefinition, False, "value", True), ("valueUnsignedInt", "valueUnsignedInt", int, False, "value", True), @@ -1652,6 +1652,9 @@ def elementProperties(self): from . import duration from . import expression from . import fhirdate +from . import fhirdate +from . import fhirdate +from . import fhirdate from . import fhirreference from . import humanname from . import identifier diff --git a/fhirclient/models/encounter.py b/fhirclient/models/encounter.py index 62a3eb68f..9cedeea14 100644 --- a/fhirclient/models/encounter.py +++ b/fhirclient/models/encounter.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Encounter) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Encounter). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/endpoint.py b/fhirclient/models/endpoint.py index 9dc1eac60..707a02d31 100644 --- a/fhirclient/models/endpoint.py +++ b/fhirclient/models/endpoint.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Endpoint) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Endpoint). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/enrollmentrequest.py b/fhirclient/models/enrollmentrequest.py index 02bdc8c46..7dc36d0dc 100644 --- a/fhirclient/models/enrollmentrequest.py +++ b/fhirclient/models/enrollmentrequest.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EnrollmentRequest) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EnrollmentRequest). +# 2024, SMART Health IT. from . import domainresource @@ -31,7 +31,7 @@ def __init__(self, jsondict=None, strict=True): self.created = None """ Creation date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.identifier = None """ Business Identifier. @@ -56,7 +56,7 @@ def elementProperties(self): js.extend([ ("candidate", "candidate", fhirreference.FHIRReference, False, None, False), ("coverage", "coverage", fhirreference.FHIRReference, False, None, False), - ("created", "created", fhirdate.FHIRDate, False, None, False), + ("created", "created", fhirdate.FHIRDateTime, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("insurer", "insurer", fhirreference.FHIRReference, False, None, False), ("provider", "provider", fhirreference.FHIRReference, False, None, False), diff --git a/fhirclient/models/enrollmentresponse.py b/fhirclient/models/enrollmentresponse.py index fb1e37c6d..e4c07036e 100644 --- a/fhirclient/models/enrollmentresponse.py +++ b/fhirclient/models/enrollmentresponse.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EnrollmentResponse) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EnrollmentResponse). +# 2024, SMART Health IT. from . import domainresource @@ -23,7 +23,7 @@ def __init__(self, jsondict=None, strict=True): self.created = None """ Creation date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.disposition = None """ Disposition Message. @@ -58,7 +58,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(EnrollmentResponse, self).elementProperties() js.extend([ - ("created", "created", fhirdate.FHIRDate, False, None, False), + ("created", "created", fhirdate.FHIRDateTime, False, None, False), ("disposition", "disposition", str, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("organization", "organization", fhirreference.FHIRReference, False, None, False), diff --git a/fhirclient/models/episodeofcare.py b/fhirclient/models/episodeofcare.py index 96d7311b9..9ad50df42 100644 --- a/fhirclient/models/episodeofcare.py +++ b/fhirclient/models/episodeofcare.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EpisodeOfCare) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EpisodeOfCare). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/eventdefinition.py b/fhirclient/models/eventdefinition.py index ac857551a..c19d0d684 100644 --- a/fhirclient/models/eventdefinition.py +++ b/fhirclient/models/eventdefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EventDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EventDefinition). +# 2024, SMART Health IT. from . import domainresource @@ -39,7 +39,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the event definition. @@ -147,7 +147,7 @@ def elementProperties(self): ("author", "author", contactdetail.ContactDetail, True, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("editor", "editor", contactdetail.ContactDetail, True, None, False), ("effectivePeriod", "effectivePeriod", period.Period, False, None, False), @@ -179,6 +179,7 @@ def elementProperties(self): from . import codeableconcept from . import contactdetail from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/evidence.py b/fhirclient/models/evidence.py index 21ff41e7d..3516a6023 100644 --- a/fhirclient/models/evidence.py +++ b/fhirclient/models/evidence.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Evidence) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Evidence). +# 2024, SMART Health IT. from . import domainresource @@ -40,7 +40,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the evidence. @@ -145,7 +145,7 @@ def elementProperties(self): ("author", "author", contactdetail.ContactDetail, True, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("editor", "editor", contactdetail.ContactDetail, True, None, False), ("effectivePeriod", "effectivePeriod", period.Period, False, None, False), @@ -177,6 +177,7 @@ def elementProperties(self): from . import codeableconcept from . import contactdetail from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/evidencevariable.py b/fhirclient/models/evidencevariable.py index dbdf8aba5..95e3fc3c3 100644 --- a/fhirclient/models/evidencevariable.py +++ b/fhirclient/models/evidencevariable.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EvidenceVariable) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/EvidenceVariable). +# 2024, SMART Health IT. from . import domainresource @@ -43,7 +43,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the evidence variable. @@ -141,7 +141,7 @@ def elementProperties(self): ("characteristic", "characteristic", EvidenceVariableCharacteristic, True, None, True), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("editor", "editor", contactdetail.ContactDetail, True, None, False), ("effectivePeriod", "effectivePeriod", period.Period, False, None, False), @@ -225,7 +225,7 @@ def __init__(self, jsondict=None, strict=True): self.participantEffectiveDateTime = None """ What time period do participants cover. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.participantEffectiveDuration = None """ What time period do participants cover. @@ -261,7 +261,7 @@ def elementProperties(self): ("description", "description", str, False, None, False), ("exclude", "exclude", bool, False, None, False), ("groupMeasure", "groupMeasure", str, False, None, False), - ("participantEffectiveDateTime", "participantEffectiveDateTime", fhirdate.FHIRDate, False, "participantEffective", False), + ("participantEffectiveDateTime", "participantEffectiveDateTime", fhirdate.FHIRDateTime, False, "participantEffective", False), ("participantEffectiveDuration", "participantEffectiveDuration", duration.Duration, False, "participantEffective", False), ("participantEffectivePeriod", "participantEffectivePeriod", period.Period, False, "participantEffective", False), ("participantEffectiveTiming", "participantEffectiveTiming", timing.Timing, False, "participantEffective", False), @@ -278,6 +278,7 @@ def elementProperties(self): from . import duration from . import expression from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/examplescenario.py b/fhirclient/models/examplescenario.py index ad36d37ad..17bd37a5d 100644 --- a/fhirclient/models/examplescenario.py +++ b/fhirclient/models/examplescenario.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ExampleScenario) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ExampleScenario). +# 2024, SMART Health IT. from . import domainresource @@ -32,7 +32,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.experimental = None """ For testing purposes, not real usage. @@ -95,7 +95,7 @@ def elementProperties(self): ("actor", "actor", ExampleScenarioActor, True, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("experimental", "experimental", bool, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("instance", "instance", ExampleScenarioInstance, True, None, False), diff --git a/fhirclient/models/explanationofbenefit.py b/fhirclient/models/explanationofbenefit.py index aa9721465..7a3891657 100644 --- a/fhirclient/models/explanationofbenefit.py +++ b/fhirclient/models/explanationofbenefit.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit). +# 2024, SMART Health IT. from . import domainresource @@ -60,7 +60,7 @@ def __init__(self, jsondict=None, strict=True): self.created = None """ Response creation date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.diagnosis = None """ Pertinent diagnosis information. @@ -208,7 +208,7 @@ def elementProperties(self): ("careTeam", "careTeam", ExplanationOfBenefitCareTeam, True, None, False), ("claim", "claim", fhirreference.FHIRReference, False, None, False), ("claimResponse", "claimResponse", fhirreference.FHIRReference, False, None, False), - ("created", "created", fhirdate.FHIRDate, False, None, True), + ("created", "created", fhirdate.FHIRDateTime, False, None, True), ("diagnosis", "diagnosis", ExplanationOfBenefitDiagnosis, True, None, False), ("disposition", "disposition", str, False, None, False), ("enterer", "enterer", fhirreference.FHIRReference, False, None, False), @@ -1322,7 +1322,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ When the procedure was performed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.procedureCodeableConcept = None """ Specific clinical procedure. @@ -1349,7 +1349,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(ExplanationOfBenefitProcedure, self).elementProperties() js.extend([ - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("procedureCodeableConcept", "procedureCodeableConcept", codeableconcept.CodeableConcept, False, "procedure", True), ("procedureReference", "procedureReference", fhirreference.FHIRReference, False, "procedure", True), ("sequence", "sequence", int, False, None, True), @@ -1567,6 +1567,7 @@ def elementProperties(self): from . import codeableconcept from . import coding from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import money diff --git a/fhirclient/models/expression.py b/fhirclient/models/expression.py index b3ff3e2a4..6b672956a 100644 --- a/fhirclient/models/expression.py +++ b/fhirclient/models/expression.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Expression) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Expression). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/extension.py b/fhirclient/models/extension.py index e50cc0504..6a67e1466 100644 --- a/fhirclient/models/extension.py +++ b/fhirclient/models/extension.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Extension) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Extension). +# 2024, SMART Health IT. from . import element @@ -90,7 +90,7 @@ def __init__(self, jsondict=None, strict=True): self.valueDateTime = None """ Value of extension. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.valueDecimal = None """ Value of extension. @@ -126,7 +126,7 @@ def __init__(self, jsondict=None, strict=True): self.valueInstant = None """ Value of extension. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.valueInteger = None """ Value of extension. @@ -194,7 +194,7 @@ def __init__(self, jsondict=None, strict=True): self.valueTime = None """ Value of extension. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.valueTiming = None """ Value of extension. @@ -246,7 +246,7 @@ def elementProperties(self): ("valueCount", "valueCount", count.Count, False, "value", False), ("valueDataRequirement", "valueDataRequirement", datarequirement.DataRequirement, False, "value", False), ("valueDate", "valueDate", fhirdate.FHIRDate, False, "value", False), - ("valueDateTime", "valueDateTime", fhirdate.FHIRDate, False, "value", False), + ("valueDateTime", "valueDateTime", fhirdate.FHIRDateTime, False, "value", False), ("valueDecimal", "valueDecimal", float, False, "value", False), ("valueDistance", "valueDistance", distance.Distance, False, "value", False), ("valueDosage", "valueDosage", dosage.Dosage, False, "value", False), @@ -255,7 +255,7 @@ def elementProperties(self): ("valueHumanName", "valueHumanName", humanname.HumanName, False, "value", False), ("valueId", "valueId", str, False, "value", False), ("valueIdentifier", "valueIdentifier", identifier.Identifier, False, "value", False), - ("valueInstant", "valueInstant", fhirdate.FHIRDate, False, "value", False), + ("valueInstant", "valueInstant", fhirdate.FHIRInstant, False, "value", False), ("valueInteger", "valueInteger", int, False, "value", False), ("valueMarkdown", "valueMarkdown", str, False, "value", False), ("valueMeta", "valueMeta", meta.Meta, False, "value", False), @@ -272,7 +272,7 @@ def elementProperties(self): ("valueSampledData", "valueSampledData", sampleddata.SampledData, False, "value", False), ("valueSignature", "valueSignature", signature.Signature, False, "value", False), ("valueString", "valueString", str, False, "value", False), - ("valueTime", "valueTime", fhirdate.FHIRDate, False, "value", False), + ("valueTime", "valueTime", fhirdate.FHIRTime, False, "value", False), ("valueTiming", "valueTiming", timing.Timing, False, "value", False), ("valueTriggerDefinition", "valueTriggerDefinition", triggerdefinition.TriggerDefinition, False, "value", False), ("valueUnsignedInt", "valueUnsignedInt", int, False, "value", False), @@ -300,6 +300,9 @@ def elementProperties(self): from . import duration from . import expression from . import fhirdate +from . import fhirdate +from . import fhirdate +from . import fhirdate from . import fhirreference from . import humanname from . import identifier diff --git a/fhirclient/models/familymemberhistory.py b/fhirclient/models/familymemberhistory.py index 2784160e8..f33066442 100644 --- a/fhirclient/models/familymemberhistory.py +++ b/fhirclient/models/familymemberhistory.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory). +# 2024, SMART Health IT. from . import domainresource @@ -55,7 +55,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ When history was recorded or last updated. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.deceasedAge = None """ Dead? How old/when?. @@ -138,7 +138,7 @@ def elementProperties(self): ("bornString", "bornString", str, False, "born", False), ("condition", "condition", FamilyMemberHistoryCondition, True, None, False), ("dataAbsentReason", "dataAbsentReason", codeableconcept.CodeableConcept, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("deceasedAge", "deceasedAge", age.Age, False, "deceased", False), ("deceasedBoolean", "deceasedBoolean", bool, False, "deceased", False), ("deceasedDate", "deceasedDate", fhirdate.FHIRDate, False, "deceased", False), @@ -234,6 +234,7 @@ def elementProperties(self): from . import annotation from . import codeableconcept from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/fhirabstractresource.py b/fhirclient/models/fhirabstractresource.py index 31b00f871..343bdb655 100644 --- a/fhirclient/models/fhirabstractresource.py +++ b/fhirclient/models/fhirabstractresource.py @@ -211,6 +211,5 @@ def where(cls, struct): return fhirsearch.FHIRSearch(cls, struct) -from . import fhirdate from . import fhirsearch from . import fhirelementfactory diff --git a/fhirclient/models/fhirdate.py b/fhirclient/models/fhirdate.py index 1ac29e8b6..429bd39aa 100644 --- a/fhirclient/models/fhirdate.py +++ b/fhirclient/models/fhirdate.py @@ -1,81 +1,288 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# Facilitate working with dates. -# 2014, SMART Health IT. - -import sys -import logging -import isodate +"""Facilitate working with FHIR dates and times.""" +# 2014-2024, SMART Health IT. + import datetime +import re +from typing import Any, Union + + +class FHIRDate: + """ + A convenience class for working with FHIR dates in Python. + + http://hl7.org/fhir/R4/datatypes.html#date -logger = logging.getLogger(__name__) + Converting to a Python representation does require some compromises: + - This class will convert partial dates ("reduced precision dates") like "2024" into full + dates using the earliest possible time (in this example, "2024-01-01") because Python's + date class does not support partial dates. + If such compromise is not useful for you, avoid using the `date` or `isostring` + properties and just use the `as_json()` method in order to work with the original, + exact string. -class FHIRDate(object): - """ Facilitate working with dates. - - - `date`: datetime object representing the receiver's date-time + For backwards-compatibility reasons, this class is the parent class of FHIRDateTime, + FHIRInstant, and FHIRTime. But they are all separate concepts and in a future major release, + they should be split into entirely separate classes. + + Public properties: + - `date`: datetime.date representing the JSON value + - `isostring`: an ISO 8601 string version of the above Python object + + Public methods: + - `as_json`: returns the original JSON used to construct the instance """ - - def __init__(self, jsonval=None): - self.date = None + + def __init__(self, jsonval: Union[str, None] = None): + self.date: Union[datetime.date, datetime.datetime, datetime.time, None] = None + if jsonval is not None: - isstr = isinstance(jsonval, str) - if not isstr and sys.version_info[0] < 3: # Python 2.x has 'str' and 'unicode' - isstr = isinstance(jsonval, basestring) - if not isstr: + if not isinstance(jsonval, str): raise TypeError("Expecting string when initializing {}, but got {}" .format(type(self), type(jsonval))) - try: - if 'T' in jsonval: - self.date = isodate.parse_datetime(jsonval) - else: - self.date = isodate.parse_date(jsonval) - except Exception as e: - logger.warning("Failed to initialize FHIRDate from \"{}\": {}" - .format(jsonval, e)) - - self.origval = jsonval - + if not self._REGEX.fullmatch(jsonval): + raise ValueError("does not match expected format") + self.date = self._from_string(jsonval) + + self.origval: Union[str, None] = jsonval + def __setattr__(self, prop, value): - if 'date' == prop: + if prop in {'date', self._FIELD}: self.origval = None - object.__setattr__(self, prop, value) - + # Keep these two fields in sync + object.__setattr__(self, self._FIELD, value) + object.__setattr__(self, "date", value) + else: + object.__setattr__(self, prop, value) + @property - def isostring(self): + def isostring(self) -> Union[str, None]: + """ + Returns a standardized ISO 8601 version of the Python representation of the FHIR JSON. + + Note that this may not be a fully accurate version of the input JSON. + In particular, it will convert partial dates like "2024" to full dates like "2024-01-01". + It will also normalize the timezone, if present. + """ if self.date is None: return None - if isinstance(self.date, datetime.datetime): - return isodate.datetime_isoformat(self.date) - return isodate.date_isoformat(self.date) - + return self.date.isoformat() + @classmethod - def with_json(cls, jsonobj): + def with_json(cls, jsonobj: Union[str, list]): """ Initialize a date from an ISO date string. """ - isstr = isinstance(jsonobj, str) - if not isstr and sys.version_info[0] < 3: # Python 2.x has 'str' and 'unicode' - isstr = isinstance(jsonobj, basestring) - if isstr: + if isinstance(jsonobj, str): return cls(jsonobj) - + if isinstance(jsonobj, list): return [cls(jsonval) for jsonval in jsonobj] - + raise TypeError("`cls.with_json()` only takes string or list of strings, but you provided {}" .format(type(jsonobj))) - + @classmethod - def with_json_and_owner(cls, jsonobj, owner): + def with_json_and_owner(cls, jsonobj: Union[str, list], owner): """ Added for compatibility reasons to FHIRElement; "owner" is discarded. """ return cls.with_json(jsonobj) - - def as_json(self): + + def as_json(self) -> Union[str, None]: + """Returns the original JSON string used to create this instance.""" if self.origval is not None: return self.origval return self.isostring - + + ################################## + # Private properties and methods # + ################################## + + # Pulled from spec for date + _REGEX = re.compile(r"([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1]))?)?") + _FIELD = "date" + + @staticmethod + def _parse_partial(value: str, cls): + """ + Handle partial dates like 1970 or 1980-12. + + FHIR allows them, but Python's datetime classes do not natively parse them. + """ + # Note that `value` has already been regex-certified by this point, + # so we don't have to handle really wild strings. + if len(value) < 10: + pieces = value.split("-") + if len(pieces) == 1: + return cls(int(pieces[0]), 1, 1) + else: + return cls(int(pieces[0]), int(pieces[1]), 1) + return cls.fromisoformat(value) + + @staticmethod + def _parse_date(value: str) -> datetime.date: + return FHIRDate._parse_partial(value, datetime.date) + + @staticmethod + def _parse_datetime(value: str) -> datetime.datetime: + # Until we depend on Python 3.11+, manually handle Z + value = value.replace("Z", "+00:00") + value = FHIRDate._strip_leap_seconds(value) + return FHIRDate._parse_partial(value, datetime.datetime) + + @staticmethod + def _parse_time(value: str) -> datetime.time: + value = FHIRDate._strip_leap_seconds(value) + return datetime.time.fromisoformat(value) + + @staticmethod + def _strip_leap_seconds(value: str) -> str: + """ + Manually ignore leap seconds by clamping the seconds value to 59. + + Python native times don't support them (at the time of this writing, but also watch + https://bugs.python.org/issue23574). For example, the stdlib's datetime.fromtimestamp() + also clamps to 59 if the system gives it leap seconds. + + But FHIR allows leap seconds and says receiving code SHOULD accept them, + so we should be graceful enough to at least not throw a ValueError, + even though we can't natively represent the most-correct time. + """ + # We can get away with such relaxed replacement because we are already regex-certified + # and ":60" can't show up anywhere but seconds. + return value.replace(":60", ":59") + + @staticmethod + def _from_string(value: str) -> Any: + return FHIRDate._parse_date(value) + + +# The classes below inherit from FHIRDate as a matter of backwards compatibility. +# (in case anyone was doing isinstance(obj, FHIRDate)) +# Next time we bump the major version, maybe we can stop that and drop the backwards-compatible +# 'date' aliases (like FHIRTime.date). R4-QUIRK + +class FHIRDateTime(FHIRDate): + """ + A convenience class for working with FHIR datetimes in Python. + + http://hl7.org/fhir/R4/datatypes.html#datetime + + Converting to a Python representation does require some compromises: + - This class will convert partial dates ("reduced precision dates") like "2024" into full + naive datetimes using the earliest possible time (in this example, "2024-01-01T00:00:00") + because Python's datetime class does not support partial dates. + - FHIR allows arbitrary sub-second precision, but Python only holds microseconds. + - Leap seconds (:60) will be changed to the 59th second (:59) because Python's time classes + do not support leap seconds. + + If such compromise is not useful for you, avoid using the `date`, `datetime`, or `isostring` + properties and just use the `as_json()` method in order to work with the original, + exact string. + + Public properties: + - `datetime`: datetime.datetime representing the JSON value (naive or aware) + - `date`: backwards-compatibility alias for `datetime` + - `isostring`: an ISO 8601 string version of the above Python object + + Public methods: + - `as_json`: returns the original JSON used to construct the instance + """ + + def __init__(self, jsonval: Union[str, None] = None): + self.datetime: Union[datetime.datetime, None] = None + super().__init__(jsonval) + + ################################## + # Private properties and methods # + ################################## + + # Pulled from spec for datetime + _REGEX = re.compile(r"([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?") + _FIELD = "datetime" + + @staticmethod + def _from_string(value: str) -> Any: + return FHIRDate._parse_datetime(value) + + +class FHIRInstant(FHIRDate): + """ + A convenience class for working with FHIR instants in Python. + + http://hl7.org/fhir/R4/datatypes.html#instant + + Converting to a Python representation does require some compromises: + - FHIR allows arbitrary sub-second precision, but Python only holds microseconds. + - Leap seconds (:60) will be changed to the 59th second (:59) because Python's time classes + do not support leap seconds. + + If such compromise is not useful for you, avoid using the `date`, `datetime`, or `isostring` + properties and just use the `as_json()` method in order to work with the original, + exact string. + + Public properties: + - `datetime`: datetime.datetime representing the JSON value (aware only) + - `date`: backwards-compatibility alias for `datetime` + - `isostring`: an ISO 8601 string version of the above Python object + + Public methods: + - `as_json`: returns the original JSON used to construct the instance + """ + + def __init__(self, jsonval: Union[str, None] = None): + self.datetime: Union[datetime.datetime, None] = None + super().__init__(jsonval) + + ################################## + # Private properties and methods # + ################################## + + # Pulled from spec for instant + _REGEX = re.compile(r"([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))") + _FIELD = "datetime" + + @staticmethod + def _from_string(value: str) -> Any: + return FHIRDate._parse_datetime(value) + + +class FHIRTime(FHIRDate): + """ + A convenience class for working with FHIR times in Python. + + http://hl7.org/fhir/R4/datatypes.html#time + + Converting to a Python representation does require some compromises: + - FHIR allows arbitrary sub-second precision, but Python only holds microseconds. + - Leap seconds (:60) will be changed to the 59th second (:59) because Python's time classes + do not support leap seconds. + + If such compromise is not useful for you, avoid using the `date`, `time`, or `isostring` + properties and just use the `as_json()` method in order to work with the original, + exact string. + + Public properties: + - `time`: datetime.time representing the JSON value + - `date`: backwards-compatibility alias for `time` + - `isostring`: an ISO 8601 string version of the above Python object + + Public methods: + - `as_json`: returns the original JSON used to construct the instance + """ + + def __init__(self, jsonval: Union[str, None] = None): + self.time: Union[datetime.time, None] = None + super().__init__(jsonval) + + ################################## + # Private properties and methods # + ################################## + + # Pulled from spec for time + _REGEX = re.compile(r"([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?") + _FIELD = "time" + + @staticmethod + def _from_string(value: str) -> Any: + return FHIRDate._parse_time(value) diff --git a/fhirclient/models/fhirelementfactory.py b/fhirclient/models/fhirelementfactory.py index 30b1a1571..63919fc74 100644 --- a/fhirclient/models/fhirelementfactory.py +++ b/fhirclient/models/fhirelementfactory.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-15. +# Generated from FHIR 4.0.1-9346c8cc45 on 2024-07-22. # 2024, SMART Health IT. diff --git a/fhirclient/models/flag.py b/fhirclient/models/flag.py index f871e3fbd..29a3c56e4 100644 --- a/fhirclient/models/flag.py +++ b/fhirclient/models/flag.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Flag) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Flag). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/goal.py b/fhirclient/models/goal.py index c6ffc3cba..5a85ecc8c 100644 --- a/fhirclient/models/goal.py +++ b/fhirclient/models/goal.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Goal) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Goal). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/graphdefinition.py b/fhirclient/models/graphdefinition.py index 7a4f68486..cc6503b5d 100644 --- a/fhirclient/models/graphdefinition.py +++ b/fhirclient/models/graphdefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/GraphDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/GraphDefinition). +# 2024, SMART Health IT. from . import domainresource @@ -28,7 +28,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the graph definition. @@ -89,7 +89,7 @@ def elementProperties(self): js = super(GraphDefinition, self).elementProperties() js.extend([ ("contact", "contact", contactdetail.ContactDetail, True, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("experimental", "experimental", bool, False, None, False), ("jurisdiction", "jurisdiction", codeableconcept.CodeableConcept, True, None, False), diff --git a/fhirclient/models/group.py b/fhirclient/models/group.py index 86bf115a6..ab2754bef 100644 --- a/fhirclient/models/group.py +++ b/fhirclient/models/group.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Group) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Group). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/guidanceresponse.py b/fhirclient/models/guidanceresponse.py index d2a528271..1512f6789 100644 --- a/fhirclient/models/guidanceresponse.py +++ b/fhirclient/models/guidanceresponse.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/GuidanceResponse) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/GuidanceResponse). +# 2024, SMART Health IT. from . import domainresource @@ -56,7 +56,7 @@ def __init__(self, jsondict=None, strict=True): self.occurrenceDateTime = None """ When the guidance response was processed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.outputParameters = None """ The output parameters of the evaluation, if any. @@ -104,7 +104,7 @@ def elementProperties(self): ("moduleCodeableConcept", "moduleCodeableConcept", codeableconcept.CodeableConcept, False, "module", True), ("moduleUri", "moduleUri", str, False, "module", True), ("note", "note", annotation.Annotation, True, None, False), - ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDate, False, None, False), + ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDateTime, False, None, False), ("outputParameters", "outputParameters", fhirreference.FHIRReference, False, None, False), ("performer", "performer", fhirreference.FHIRReference, False, None, False), ("reasonCode", "reasonCode", codeableconcept.CodeableConcept, True, None, False), diff --git a/fhirclient/models/healthcareservice.py b/fhirclient/models/healthcareservice.py index 1c892086d..9cffdb9c2 100644 --- a/fhirclient/models/healthcareservice.py +++ b/fhirclient/models/healthcareservice.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/HealthcareService) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/HealthcareService). +# 2024, SMART Health IT. from . import domainresource @@ -174,11 +174,11 @@ def __init__(self, jsondict=None, strict=True): self.availableEndTime = None """ Closing time of day (ignored if allDay = true). - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.availableStartTime = None """ Opening time of day (ignored if allDay = true). - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.daysOfWeek = None """ mon | tue | wed | thu | fri | sat | sun. @@ -190,8 +190,8 @@ def elementProperties(self): js = super(HealthcareServiceAvailableTime, self).elementProperties() js.extend([ ("allDay", "allDay", bool, False, None, False), - ("availableEndTime", "availableEndTime", fhirdate.FHIRDate, False, None, False), - ("availableStartTime", "availableStartTime", fhirdate.FHIRDate, False, None, False), + ("availableEndTime", "availableEndTime", fhirdate.FHIRTime, False, None, False), + ("availableStartTime", "availableStartTime", fhirdate.FHIRTime, False, None, False), ("daysOfWeek", "daysOfWeek", str, True, None, False), ]) return js diff --git a/fhirclient/models/humanname.py b/fhirclient/models/humanname.py index cd30864c7..c01dc3b92 100644 --- a/fhirclient/models/humanname.py +++ b/fhirclient/models/humanname.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/HumanName) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/HumanName). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/identifier.py b/fhirclient/models/identifier.py index eba4b048c..3da644a2c 100644 --- a/fhirclient/models/identifier.py +++ b/fhirclient/models/identifier.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Identifier) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Identifier). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/imagingstudy.py b/fhirclient/models/imagingstudy.py index 648f8d314..86a7c4419 100644 --- a/fhirclient/models/imagingstudy.py +++ b/fhirclient/models/imagingstudy.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ImagingStudy) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ImagingStudy). +# 2024, SMART Health IT. from . import domainresource @@ -95,7 +95,7 @@ def __init__(self, jsondict=None, strict=True): self.started = None """ When the study was started. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.status = None """ registered | available | cancelled | entered-in-error | unknown. @@ -127,7 +127,7 @@ def elementProperties(self): ("reasonReference", "reasonReference", fhirreference.FHIRReference, True, None, False), ("referrer", "referrer", fhirreference.FHIRReference, False, None, False), ("series", "series", ImagingStudySeries, True, None, False), - ("started", "started", fhirdate.FHIRDate, False, None, False), + ("started", "started", fhirdate.FHIRDateTime, False, None, False), ("status", "status", str, False, None, True), ("subject", "subject", fhirreference.FHIRReference, False, None, True), ]) @@ -194,7 +194,7 @@ def __init__(self, jsondict=None, strict=True): self.started = None """ When the series started. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.uid = None """ DICOM Series Instance UID for the series. @@ -215,7 +215,7 @@ def elementProperties(self): ("numberOfInstances", "numberOfInstances", int, False, None, False), ("performer", "performer", ImagingStudySeriesPerformer, True, None, False), ("specimen", "specimen", fhirreference.FHIRReference, True, None, False), - ("started", "started", fhirdate.FHIRDate, False, None, False), + ("started", "started", fhirdate.FHIRDateTime, False, None, False), ("uid", "uid", str, False, None, True), ]) return js diff --git a/fhirclient/models/immunization.py b/fhirclient/models/immunization.py index 55d6090bf..37ea8b5c4 100644 --- a/fhirclient/models/immunization.py +++ b/fhirclient/models/immunization.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Immunization) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Immunization). +# 2024, SMART Health IT. from . import domainresource @@ -67,7 +67,7 @@ def __init__(self, jsondict=None, strict=True): self.occurrenceDateTime = None """ Vaccine administration date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.occurrenceString = None """ Vaccine administration date. @@ -107,7 +107,7 @@ def __init__(self, jsondict=None, strict=True): self.recorded = None """ When the immunization was first captured in the subject's record. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.reportOrigin = None """ Indicates the source of a secondarily reported record. @@ -153,7 +153,7 @@ def elementProperties(self): ("lotNumber", "lotNumber", str, False, None, False), ("manufacturer", "manufacturer", fhirreference.FHIRReference, False, None, False), ("note", "note", annotation.Annotation, True, None, False), - ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDate, False, "occurrence", True), + ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDateTime, False, "occurrence", True), ("occurrenceString", "occurrenceString", str, False, "occurrence", True), ("patient", "patient", fhirreference.FHIRReference, False, None, True), ("performer", "performer", ImmunizationPerformer, True, None, False), @@ -163,7 +163,7 @@ def elementProperties(self): ("reaction", "reaction", ImmunizationReaction, True, None, False), ("reasonCode", "reasonCode", codeableconcept.CodeableConcept, True, None, False), ("reasonReference", "reasonReference", fhirreference.FHIRReference, True, None, False), - ("recorded", "recorded", fhirdate.FHIRDate, False, None, False), + ("recorded", "recorded", fhirdate.FHIRDateTime, False, None, False), ("reportOrigin", "reportOrigin", codeableconcept.CodeableConcept, False, None, False), ("route", "route", codeableconcept.CodeableConcept, False, None, False), ("site", "site", codeableconcept.CodeableConcept, False, None, False), @@ -200,11 +200,11 @@ def __init__(self, jsondict=None, strict=True): self.presentationDate = None """ Educational material presentation date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.publicationDate = None """ Educational material publication date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.reference = None """ Educational material reference pointer. @@ -216,8 +216,8 @@ def elementProperties(self): js = super(ImmunizationEducation, self).elementProperties() js.extend([ ("documentType", "documentType", str, False, None, False), - ("presentationDate", "presentationDate", fhirdate.FHIRDate, False, None, False), - ("publicationDate", "publicationDate", fhirdate.FHIRDate, False, None, False), + ("presentationDate", "presentationDate", fhirdate.FHIRDateTime, False, None, False), + ("publicationDate", "publicationDate", fhirdate.FHIRDateTime, False, None, False), ("reference", "reference", str, False, None, False), ]) return js @@ -338,7 +338,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ When reaction started. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.detail = None """ Additional information on reaction. @@ -353,7 +353,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(ImmunizationReaction, self).elementProperties() js.extend([ - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("detail", "detail", fhirreference.FHIRReference, False, None, False), ("reported", "reported", bool, False, None, False), ]) @@ -363,6 +363,7 @@ def elementProperties(self): from . import annotation from . import codeableconcept from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import quantity diff --git a/fhirclient/models/immunizationevaluation.py b/fhirclient/models/immunizationevaluation.py index 9969a51f1..fc32005ba 100644 --- a/fhirclient/models/immunizationevaluation.py +++ b/fhirclient/models/immunizationevaluation.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ImmunizationEvaluation). +# 2024, SMART Health IT. from . import domainresource @@ -28,7 +28,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date evaluation was performed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Evaluation notes. @@ -88,7 +88,7 @@ def elementProperties(self): js = super(ImmunizationEvaluation, self).elementProperties() js.extend([ ("authority", "authority", fhirreference.FHIRReference, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("doseNumberPositiveInt", "doseNumberPositiveInt", int, False, "doseNumber", False), ("doseNumberString", "doseNumberString", str, False, "doseNumber", False), diff --git a/fhirclient/models/immunizationrecommendation.py b/fhirclient/models/immunizationrecommendation.py index f2f1fceca..3284a6d57 100644 --- a/fhirclient/models/immunizationrecommendation.py +++ b/fhirclient/models/immunizationrecommendation.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation). +# 2024, SMART Health IT. from . import domainresource @@ -27,7 +27,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date recommendation(s) created. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.identifier = None """ Business identifier. @@ -47,7 +47,7 @@ def elementProperties(self): js = super(ImmunizationRecommendation, self).elementProperties() js.extend([ ("authority", "authority", fhirreference.FHIRReference, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, True), + ("date", "date", fhirdate.FHIRDateTime, False, None, True), ("identifier", "identifier", identifier.Identifier, True, None, False), ("patient", "patient", fhirreference.FHIRReference, False, None, True), ("recommendation", "recommendation", ImmunizationRecommendationRecommendation, True, None, True), @@ -173,7 +173,7 @@ def __init__(self, jsondict=None, strict=True): self.value = None """ Recommended date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ super(ImmunizationRecommendationRecommendationDateCriterion, self).__init__(jsondict=jsondict, strict=strict) @@ -181,7 +181,7 @@ def elementProperties(self): js = super(ImmunizationRecommendationRecommendationDateCriterion, self).elementProperties() js.extend([ ("code", "code", codeableconcept.CodeableConcept, False, None, True), - ("value", "value", fhirdate.FHIRDate, False, None, True), + ("value", "value", fhirdate.FHIRDateTime, False, None, True), ]) return js diff --git a/fhirclient/models/implementationguide.py b/fhirclient/models/implementationguide.py index aaf752284..e1004a86e 100644 --- a/fhirclient/models/implementationguide.py +++ b/fhirclient/models/implementationguide.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ImplementationGuide) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ImplementationGuide). +# 2024, SMART Health IT. from . import domainresource @@ -33,7 +33,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.definition = None """ Information needed to build the IG. @@ -111,7 +111,7 @@ def elementProperties(self): js.extend([ ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("definition", "definition", ImplementationGuideDefinition, False, None, False), ("dependsOn", "dependsOn", ImplementationGuideDependsOn, True, None, False), ("description", "description", str, False, None, False), diff --git a/fhirclient/models/insuranceplan.py b/fhirclient/models/insuranceplan.py index d700a22e6..d812ab7b8 100644 --- a/fhirclient/models/insuranceplan.py +++ b/fhirclient/models/insuranceplan.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/InsurancePlan) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/InsurancePlan). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/invoice.py b/fhirclient/models/invoice.py index fc5c81c02..52a45342a 100644 --- a/fhirclient/models/invoice.py +++ b/fhirclient/models/invoice.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Invoice) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Invoice). +# 2024, SMART Health IT. from . import domainresource @@ -31,7 +31,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Invoice date / posting date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.identifier = None """ Business Identifier for item. @@ -92,7 +92,7 @@ def elementProperties(self): js.extend([ ("account", "account", fhirreference.FHIRReference, False, None, False), ("cancelledReason", "cancelledReason", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("issuer", "issuer", fhirreference.FHIRReference, False, None, False), ("lineItem", "lineItem", InvoiceLineItem, True, None, False), diff --git a/fhirclient/models/library.py b/fhirclient/models/library.py index cb1ceda1e..c1e49c977 100644 --- a/fhirclient/models/library.py +++ b/fhirclient/models/library.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Library) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Library). +# 2024, SMART Health IT. from . import domainresource @@ -49,7 +49,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the library. @@ -164,7 +164,7 @@ def elementProperties(self): ("content", "content", attachment.Attachment, True, None, False), ("copyright", "copyright", str, False, None, False), ("dataRequirement", "dataRequirement", datarequirement.DataRequirement, True, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("editor", "editor", contactdetail.ContactDetail, True, None, False), ("effectivePeriod", "effectivePeriod", period.Period, False, None, False), @@ -199,6 +199,7 @@ def elementProperties(self): from . import contactdetail from . import datarequirement from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import parameterdefinition diff --git a/fhirclient/models/linkage.py b/fhirclient/models/linkage.py index 07e5794b1..6145f4bd7 100644 --- a/fhirclient/models/linkage.py +++ b/fhirclient/models/linkage.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Linkage) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Linkage). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/list.py b/fhirclient/models/list.py index 14387ea88..c37a5ad98 100644 --- a/fhirclient/models/list.py +++ b/fhirclient/models/list.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/List) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/List). +# 2024, SMART Health IT. from . import domainresource @@ -24,7 +24,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ When the list was prepared. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.emptyReason = None """ Why list is empty. @@ -76,7 +76,7 @@ def elementProperties(self): js = super(List, self).elementProperties() js.extend([ ("code", "code", codeableconcept.CodeableConcept, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("emptyReason", "emptyReason", codeableconcept.CodeableConcept, False, None, False), ("encounter", "encounter", fhirreference.FHIRReference, False, None, False), ("entry", "entry", ListEntry, True, None, False), @@ -112,7 +112,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ When item added to list. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.deleted = None """ If this item is actually marked as deleted. @@ -131,7 +131,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(ListEntry, self).elementProperties() js.extend([ - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("deleted", "deleted", bool, False, None, False), ("flag", "flag", codeableconcept.CodeableConcept, False, None, False), ("item", "item", fhirreference.FHIRReference, False, None, True), diff --git a/fhirclient/models/location.py b/fhirclient/models/location.py index 4655ca86d..46a0d1b42 100644 --- a/fhirclient/models/location.py +++ b/fhirclient/models/location.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Location) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Location). +# 2024, SMART Health IT. from . import domainresource @@ -142,7 +142,7 @@ def __init__(self, jsondict=None, strict=True): self.closingTime = None """ Time that the Location closes. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.daysOfWeek = None """ mon | tue | wed | thu | fri | sat | sun. @@ -150,7 +150,7 @@ def __init__(self, jsondict=None, strict=True): self.openingTime = None """ Time that the Location opens. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ super(LocationHoursOfOperation, self).__init__(jsondict=jsondict, strict=strict) @@ -158,9 +158,9 @@ def elementProperties(self): js = super(LocationHoursOfOperation, self).elementProperties() js.extend([ ("allDay", "allDay", bool, False, None, False), - ("closingTime", "closingTime", fhirdate.FHIRDate, False, None, False), + ("closingTime", "closingTime", fhirdate.FHIRTime, False, None, False), ("daysOfWeek", "daysOfWeek", str, True, None, False), - ("openingTime", "openingTime", fhirdate.FHIRDate, False, None, False), + ("openingTime", "openingTime", fhirdate.FHIRTime, False, None, False), ]) return js diff --git a/fhirclient/models/marketingstatus.py b/fhirclient/models/marketingstatus.py index 12790151b..d207b18bf 100644 --- a/fhirclient/models/marketingstatus.py +++ b/fhirclient/models/marketingstatus.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MarketingStatus) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MarketingStatus). +# 2024, SMART Health IT. from . import backboneelement @@ -52,7 +52,7 @@ def __init__(self, jsondict=None, strict=True): specified using the ISO 8601 date format NOTE “Placed on the market” refers to the release of the Medicinal Product into the distribution chain. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.status = None """ This attribute provides information on the status of the marketing @@ -68,7 +68,7 @@ def elementProperties(self): ("country", "country", codeableconcept.CodeableConcept, False, None, True), ("dateRange", "dateRange", period.Period, False, None, True), ("jurisdiction", "jurisdiction", codeableconcept.CodeableConcept, False, None, False), - ("restoreDate", "restoreDate", fhirdate.FHIRDate, False, None, False), + ("restoreDate", "restoreDate", fhirdate.FHIRDateTime, False, None, False), ("status", "status", codeableconcept.CodeableConcept, False, None, True), ]) return js diff --git a/fhirclient/models/measure.py b/fhirclient/models/measure.py index b713318ad..53b30814c 100644 --- a/fhirclient/models/measure.py +++ b/fhirclient/models/measure.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Measure) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Measure). +# 2024, SMART Health IT. from . import domainresource @@ -46,7 +46,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.definition = None """ Defined terms used in the measure documentation. @@ -204,7 +204,7 @@ def elementProperties(self): ("compositeScoring", "compositeScoring", codeableconcept.CodeableConcept, False, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("definition", "definition", str, True, None, False), ("description", "description", str, False, None, False), ("disclaimer", "disclaimer", str, False, None, False), @@ -473,6 +473,7 @@ def elementProperties(self): from . import contactdetail from . import expression from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/measurereport.py b/fhirclient/models/measurereport.py index b4db126dd..5de8f3260 100644 --- a/fhirclient/models/measurereport.py +++ b/fhirclient/models/measurereport.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MeasureReport) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MeasureReport). +# 2024, SMART Health IT. from . import domainresource @@ -24,7 +24,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ When the report was generated. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.evaluatedResource = None """ What data was used to calculate the measure score. @@ -71,7 +71,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(MeasureReport, self).elementProperties() js.extend([ - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("evaluatedResource", "evaluatedResource", fhirreference.FHIRReference, True, None, False), ("group", "group", MeasureReportGroup, True, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), diff --git a/fhirclient/models/media.py b/fhirclient/models/media.py index eecca7565..52967956e 100644 --- a/fhirclient/models/media.py +++ b/fhirclient/models/media.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Media) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Media). +# 2024, SMART Health IT. from . import domainresource @@ -33,7 +33,7 @@ def __init__(self, jsondict=None, strict=True): self.createdDateTime = None """ When Media was collected. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.createdPeriod = None """ When Media was collected. @@ -69,7 +69,7 @@ def __init__(self, jsondict=None, strict=True): self.issued = None """ Date/Time this version was made available. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.modality = None """ The type of acquisition equipment/process. @@ -120,7 +120,7 @@ def elementProperties(self): ("basedOn", "basedOn", fhirreference.FHIRReference, True, None, False), ("bodySite", "bodySite", codeableconcept.CodeableConcept, False, None, False), ("content", "content", attachment.Attachment, False, None, True), - ("createdDateTime", "createdDateTime", fhirdate.FHIRDate, False, "created", False), + ("createdDateTime", "createdDateTime", fhirdate.FHIRDateTime, False, "created", False), ("createdPeriod", "createdPeriod", period.Period, False, "created", False), ("device", "device", fhirreference.FHIRReference, False, None, False), ("deviceName", "deviceName", str, False, None, False), @@ -129,7 +129,7 @@ def elementProperties(self): ("frames", "frames", int, False, None, False), ("height", "height", int, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), - ("issued", "issued", fhirdate.FHIRDate, False, None, False), + ("issued", "issued", fhirdate.FHIRInstant, False, None, False), ("modality", "modality", codeableconcept.CodeableConcept, False, None, False), ("note", "note", annotation.Annotation, True, None, False), ("operator", "operator", fhirreference.FHIRReference, False, None, False), @@ -148,6 +148,7 @@ def elementProperties(self): from . import attachment from . import codeableconcept from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/medication.py b/fhirclient/models/medication.py index 0c6bf2a4a..0493453d2 100644 --- a/fhirclient/models/medication.py +++ b/fhirclient/models/medication.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Medication) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Medication). +# 2024, SMART Health IT. from . import domainresource @@ -91,7 +91,7 @@ def __init__(self, jsondict=None, strict=True): self.expirationDate = None """ When batch will expire. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.lotNumber = None """ Identifier assigned to batch. @@ -102,7 +102,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(MedicationBatch, self).elementProperties() js.extend([ - ("expirationDate", "expirationDate", fhirdate.FHIRDate, False, None, False), + ("expirationDate", "expirationDate", fhirdate.FHIRDateTime, False, None, False), ("lotNumber", "lotNumber", str, False, None, False), ]) return js diff --git a/fhirclient/models/medicationadministration.py b/fhirclient/models/medicationadministration.py index f37c7d915..b3ae991de 100644 --- a/fhirclient/models/medicationadministration.py +++ b/fhirclient/models/medicationadministration.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicationAdministration) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicationAdministration). +# 2024, SMART Health IT. from . import domainresource @@ -42,7 +42,7 @@ def __init__(self, jsondict=None, strict=True): self.effectiveDateTime = None """ Start and end time of administration. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.effectivePeriod = None """ Start and end time of administration. @@ -119,7 +119,7 @@ def elementProperties(self): ("context", "context", fhirreference.FHIRReference, False, None, False), ("device", "device", fhirreference.FHIRReference, True, None, False), ("dosage", "dosage", MedicationAdministrationDosage, False, None, False), - ("effectiveDateTime", "effectiveDateTime", fhirdate.FHIRDate, False, "effective", True), + ("effectiveDateTime", "effectiveDateTime", fhirdate.FHIRDateTime, False, "effective", True), ("effectivePeriod", "effectivePeriod", period.Period, False, "effective", True), ("eventHistory", "eventHistory", fhirreference.FHIRReference, True, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), diff --git a/fhirclient/models/medicationdispense.py b/fhirclient/models/medicationdispense.py index 6a54a745e..aecdc7a9c 100644 --- a/fhirclient/models/medicationdispense.py +++ b/fhirclient/models/medicationdispense.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicationDispense) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicationDispense). +# 2024, SMART Health IT. from . import domainresource @@ -124,11 +124,11 @@ def __init__(self, jsondict=None, strict=True): self.whenHandedOver = None """ When product was given out. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.whenPrepared = None """ When product was packaged and reviewed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ super(MedicationDispense, self).__init__(jsondict=jsondict, strict=strict) @@ -159,8 +159,8 @@ def elementProperties(self): ("substitution", "substitution", MedicationDispenseSubstitution, False, None, False), ("supportingInformation", "supportingInformation", fhirreference.FHIRReference, True, None, False), ("type", "type", codeableconcept.CodeableConcept, False, None, False), - ("whenHandedOver", "whenHandedOver", fhirdate.FHIRDate, False, None, False), - ("whenPrepared", "whenPrepared", fhirdate.FHIRDate, False, None, False), + ("whenHandedOver", "whenHandedOver", fhirdate.FHIRDateTime, False, None, False), + ("whenPrepared", "whenPrepared", fhirdate.FHIRDateTime, False, None, False), ]) return js diff --git a/fhirclient/models/medicationknowledge.py b/fhirclient/models/medicationknowledge.py index 6ee424c14..001ff8079 100644 --- a/fhirclient/models/medicationknowledge.py +++ b/fhirclient/models/medicationknowledge.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicationKnowledge) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicationKnowledge). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicationrequest.py b/fhirclient/models/medicationrequest.py index ae50bca50..20d123cb2 100644 --- a/fhirclient/models/medicationrequest.py +++ b/fhirclient/models/medicationrequest.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicationRequest) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicationRequest). +# 2024, SMART Health IT. from . import domainresource @@ -27,7 +27,7 @@ def __init__(self, jsondict=None, strict=True): self.authoredOn = None """ When request was initially authored. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.basedOn = None """ What request fulfills. @@ -169,7 +169,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(MedicationRequest, self).elementProperties() js.extend([ - ("authoredOn", "authoredOn", fhirdate.FHIRDate, False, None, False), + ("authoredOn", "authoredOn", fhirdate.FHIRDateTime, False, None, False), ("basedOn", "basedOn", fhirreference.FHIRReference, True, None, False), ("category", "category", codeableconcept.CodeableConcept, True, None, False), ("courseOfTherapyType", "courseOfTherapyType", codeableconcept.CodeableConcept, False, None, False), diff --git a/fhirclient/models/medicationstatement.py b/fhirclient/models/medicationstatement.py index ece0d0d3b..8cf99bce5 100644 --- a/fhirclient/models/medicationstatement.py +++ b/fhirclient/models/medicationstatement.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicationStatement) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicationStatement). +# 2024, SMART Health IT. from . import domainresource @@ -57,7 +57,7 @@ def __init__(self, jsondict=None, strict=True): self.dateAsserted = None """ When the statement was asserted?. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.derivedFrom = None """ Additional supporting information. @@ -69,7 +69,7 @@ def __init__(self, jsondict=None, strict=True): self.effectiveDateTime = None """ The date/time or interval when the medication is/was/will be taken. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.effectivePeriod = None """ The date/time or interval when the medication is/was/will be taken. @@ -130,10 +130,10 @@ def elementProperties(self): ("basedOn", "basedOn", fhirreference.FHIRReference, True, None, False), ("category", "category", codeableconcept.CodeableConcept, False, None, False), ("context", "context", fhirreference.FHIRReference, False, None, False), - ("dateAsserted", "dateAsserted", fhirdate.FHIRDate, False, None, False), + ("dateAsserted", "dateAsserted", fhirdate.FHIRDateTime, False, None, False), ("derivedFrom", "derivedFrom", fhirreference.FHIRReference, True, None, False), ("dosage", "dosage", dosage.Dosage, True, None, False), - ("effectiveDateTime", "effectiveDateTime", fhirdate.FHIRDate, False, "effective", False), + ("effectiveDateTime", "effectiveDateTime", fhirdate.FHIRDateTime, False, "effective", False), ("effectivePeriod", "effectivePeriod", period.Period, False, "effective", False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("informationSource", "informationSource", fhirreference.FHIRReference, False, None, False), diff --git a/fhirclient/models/medicinalproduct.py b/fhirclient/models/medicinalproduct.py index 9ad223dc3..919d1aeef 100644 --- a/fhirclient/models/medicinalproduct.py +++ b/fhirclient/models/medicinalproduct.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProduct) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProduct). +# 2024, SMART Health IT. from . import domainresource @@ -164,7 +164,7 @@ def __init__(self, jsondict=None, strict=True): self.effectiveDate = None """ Regulatory authorization date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.manufacturer = None """ The manufacturer or establishment associated with the process. @@ -185,7 +185,7 @@ def elementProperties(self): js.extend([ ("authorisationReferenceNumber", "authorisationReferenceNumber", identifier.Identifier, False, None, False), ("confidentialityIndicator", "confidentialityIndicator", codeableconcept.CodeableConcept, False, None, False), - ("effectiveDate", "effectiveDate", fhirdate.FHIRDate, False, None, False), + ("effectiveDate", "effectiveDate", fhirdate.FHIRDateTime, False, None, False), ("manufacturer", "manufacturer", fhirreference.FHIRReference, True, None, False), ("operationType", "operationType", codeableconcept.CodeableConcept, False, None, False), ("regulator", "regulator", fhirreference.FHIRReference, False, None, False), @@ -319,7 +319,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date when the designation was granted. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.identifier = None """ Identifier for the designation, or procedure number. @@ -354,7 +354,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(MedicinalProductSpecialDesignation, self).elementProperties() js.extend([ - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("indicationCodeableConcept", "indicationCodeableConcept", codeableconcept.CodeableConcept, False, "indication", False), ("indicationReference", "indicationReference", fhirreference.FHIRReference, False, "indication", False), diff --git a/fhirclient/models/medicinalproductauthorization.py b/fhirclient/models/medicinalproductauthorization.py index 47b3f1cbb..6254d06bd 100644 --- a/fhirclient/models/medicinalproductauthorization.py +++ b/fhirclient/models/medicinalproductauthorization.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductAuthorization) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductAuthorization). +# 2024, SMART Health IT. from . import domainresource @@ -30,7 +30,7 @@ def __init__(self, jsondict=None, strict=True): self.dateOfFirstAuthorization = None """ The date when the first authorization was granted by a Medicines Regulatory Agency. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.holder = None """ Marketing Authorization Holder. @@ -44,7 +44,7 @@ def __init__(self, jsondict=None, strict=True): self.internationalBirthDate = None """ Date of first marketing authorization for a company's new medicinal product in any country in the World. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.jurisdiction = None """ Jurisdiction within a country. @@ -70,7 +70,7 @@ def __init__(self, jsondict=None, strict=True): self.restoreDate = None """ The date when a suspended the marketing or the marketing authorization of the product is anticipated to be restored. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.status = None """ The status of the marketing authorization. @@ -78,7 +78,7 @@ def __init__(self, jsondict=None, strict=True): self.statusDate = None """ The date at which the given status has become applicable. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.subject = None """ The medicinal product that is being authorized. @@ -98,18 +98,18 @@ def elementProperties(self): js.extend([ ("country", "country", codeableconcept.CodeableConcept, True, None, False), ("dataExclusivityPeriod", "dataExclusivityPeriod", period.Period, False, None, False), - ("dateOfFirstAuthorization", "dateOfFirstAuthorization", fhirdate.FHIRDate, False, None, False), + ("dateOfFirstAuthorization", "dateOfFirstAuthorization", fhirdate.FHIRDateTime, False, None, False), ("holder", "holder", fhirreference.FHIRReference, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), - ("internationalBirthDate", "internationalBirthDate", fhirdate.FHIRDate, False, None, False), + ("internationalBirthDate", "internationalBirthDate", fhirdate.FHIRDateTime, False, None, False), ("jurisdiction", "jurisdiction", codeableconcept.CodeableConcept, True, None, False), ("jurisdictionalAuthorization", "jurisdictionalAuthorization", MedicinalProductAuthorizationJurisdictionalAuthorization, True, None, False), ("legalBasis", "legalBasis", codeableconcept.CodeableConcept, False, None, False), ("procedure", "procedure", MedicinalProductAuthorizationProcedure, False, None, False), ("regulator", "regulator", fhirreference.FHIRReference, False, None, False), - ("restoreDate", "restoreDate", fhirdate.FHIRDate, False, None, False), + ("restoreDate", "restoreDate", fhirdate.FHIRDateTime, False, None, False), ("status", "status", codeableconcept.CodeableConcept, False, None, False), - ("statusDate", "statusDate", fhirdate.FHIRDate, False, None, False), + ("statusDate", "statusDate", fhirdate.FHIRDateTime, False, None, False), ("subject", "subject", fhirreference.FHIRReference, False, None, False), ("validityPeriod", "validityPeriod", period.Period, False, None, False), ]) @@ -186,7 +186,7 @@ def __init__(self, jsondict=None, strict=True): self.dateDateTime = None """ Date of procedure. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.datePeriod = None """ Date of procedure. @@ -206,7 +206,7 @@ def elementProperties(self): js = super(MedicinalProductAuthorizationProcedure, self).elementProperties() js.extend([ ("application", "application", MedicinalProductAuthorizationProcedure, True, None, False), - ("dateDateTime", "dateDateTime", fhirdate.FHIRDate, False, "date", False), + ("dateDateTime", "dateDateTime", fhirdate.FHIRDateTime, False, "date", False), ("datePeriod", "datePeriod", period.Period, False, "date", False), ("identifier", "identifier", identifier.Identifier, False, None, False), ("type", "type", codeableconcept.CodeableConcept, False, None, True), diff --git a/fhirclient/models/medicinalproductcontraindication.py b/fhirclient/models/medicinalproductcontraindication.py index db3146dbc..50ac4db50 100644 --- a/fhirclient/models/medicinalproductcontraindication.py +++ b/fhirclient/models/medicinalproductcontraindication.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductContraindication) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductContraindication). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductindication.py b/fhirclient/models/medicinalproductindication.py index e6dba811f..a2a55f4b4 100644 --- a/fhirclient/models/medicinalproductindication.py +++ b/fhirclient/models/medicinalproductindication.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductIndication) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductIndication). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductingredient.py b/fhirclient/models/medicinalproductingredient.py index 62c529c6a..7924d5f0b 100644 --- a/fhirclient/models/medicinalproductingredient.py +++ b/fhirclient/models/medicinalproductingredient.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductIngredient) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductIngredient). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductinteraction.py b/fhirclient/models/medicinalproductinteraction.py index cc59b9823..2f0f9d64b 100644 --- a/fhirclient/models/medicinalproductinteraction.py +++ b/fhirclient/models/medicinalproductinteraction.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductInteraction) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductInteraction). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductmanufactured.py b/fhirclient/models/medicinalproductmanufactured.py index 46cb66d32..fefba4d6d 100644 --- a/fhirclient/models/medicinalproductmanufactured.py +++ b/fhirclient/models/medicinalproductmanufactured.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductManufactured) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductManufactured). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductpackaged.py b/fhirclient/models/medicinalproductpackaged.py index 4dfa2080f..d13fe135b 100644 --- a/fhirclient/models/medicinalproductpackaged.py +++ b/fhirclient/models/medicinalproductpackaged.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductPackaged) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductPackaged). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductpharmaceutical.py b/fhirclient/models/medicinalproductpharmaceutical.py index eceafae78..8b14452bb 100644 --- a/fhirclient/models/medicinalproductpharmaceutical.py +++ b/fhirclient/models/medicinalproductpharmaceutical.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductPharmaceutical) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductPharmaceutical). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/medicinalproductundesirableeffect.py b/fhirclient/models/medicinalproductundesirableeffect.py index de99bb4cd..d442febbe 100644 --- a/fhirclient/models/medicinalproductundesirableeffect.py +++ b/fhirclient/models/medicinalproductundesirableeffect.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductUndesirableEffect) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MedicinalProductUndesirableEffect). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/messagedefinition.py b/fhirclient/models/messagedefinition.py index a50d2a224..dd0242d8e 100644 --- a/fhirclient/models/messagedefinition.py +++ b/fhirclient/models/messagedefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MessageDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MessageDefinition). +# 2024, SMART Health IT. from . import domainresource @@ -45,7 +45,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the message definition. @@ -133,7 +133,7 @@ def elementProperties(self): ("category", "category", str, False, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, True), + ("date", "date", fhirdate.FHIRDateTime, False, None, True), ("description", "description", str, False, None, False), ("eventCoding", "eventCoding", coding.Coding, False, "event", True), ("eventUri", "eventUri", str, False, "event", True), diff --git a/fhirclient/models/messageheader.py b/fhirclient/models/messageheader.py index f01e09341..e01bb96f6 100644 --- a/fhirclient/models/messageheader.py +++ b/fhirclient/models/messageheader.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MessageHeader) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MessageHeader). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/meta.py b/fhirclient/models/meta.py index 4147e445d..e3b8cd4ef 100644 --- a/fhirclient/models/meta.py +++ b/fhirclient/models/meta.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Meta) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Meta). +# 2024, SMART Health IT. from . import element @@ -24,7 +24,7 @@ def __init__(self, jsondict=None, strict=True): self.lastUpdated = None """ When the resource version last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.profile = None """ Profiles this resource claims to conform to. @@ -51,7 +51,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(Meta, self).elementProperties() js.extend([ - ("lastUpdated", "lastUpdated", fhirdate.FHIRDate, False, None, False), + ("lastUpdated", "lastUpdated", fhirdate.FHIRInstant, False, None, False), ("profile", "profile", str, True, None, False), ("security", "security", coding.Coding, True, None, False), ("source", "source", str, False, None, False), diff --git a/fhirclient/models/metadataresource.py b/fhirclient/models/metadataresource.py index 40bf46acb..782171610 100644 --- a/fhirclient/models/metadataresource.py +++ b/fhirclient/models/metadataresource.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MetadataResource) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MetadataResource). +# 2024, SMART Health IT. class MetadataResource(object): @@ -25,7 +25,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the metadata resource. @@ -74,7 +74,7 @@ def elementProperties(self): js = super(MetadataResource, self).elementProperties() js.extend([ ("contact", "contact", contactdetail.ContactDetail, True, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("experimental", "experimental", bool, False, None, False), ("jurisdiction", "jurisdiction", codeableconcept.CodeableConcept, True, None, False), diff --git a/fhirclient/models/molecularsequence.py b/fhirclient/models/molecularsequence.py index dd945385e..94abfc6d8 100644 --- a/fhirclient/models/molecularsequence.py +++ b/fhirclient/models/molecularsequence.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MolecularSequence) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MolecularSequence). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/money.py b/fhirclient/models/money.py index bd7c09eb1..0aa0d7fa1 100644 --- a/fhirclient/models/money.py +++ b/fhirclient/models/money.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Money) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Money). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/namingsystem.py b/fhirclient/models/namingsystem.py index d99b6553f..957151717 100644 --- a/fhirclient/models/namingsystem.py +++ b/fhirclient/models/namingsystem.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/NamingSystem) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/NamingSystem). +# 2024, SMART Health IT. from . import domainresource @@ -28,7 +28,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the naming system. @@ -80,7 +80,7 @@ def elementProperties(self): js = super(NamingSystem, self).elementProperties() js.extend([ ("contact", "contact", contactdetail.ContactDetail, True, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, True), + ("date", "date", fhirdate.FHIRDateTime, False, None, True), ("description", "description", str, False, None, False), ("jurisdiction", "jurisdiction", codeableconcept.CodeableConcept, True, None, False), ("kind", "kind", str, False, None, True), diff --git a/fhirclient/models/narrative.py b/fhirclient/models/narrative.py index 282793796..ddca693cd 100644 --- a/fhirclient/models/narrative.py +++ b/fhirclient/models/narrative.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Narrative) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Narrative). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/nutritionorder.py b/fhirclient/models/nutritionorder.py index 01525d1fc..0396484c9 100644 --- a/fhirclient/models/nutritionorder.py +++ b/fhirclient/models/nutritionorder.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/NutritionOrder) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/NutritionOrder). +# 2024, SMART Health IT. from . import domainresource @@ -28,7 +28,7 @@ def __init__(self, jsondict=None, strict=True): self.dateTime = None """ Date and time the nutrition order was requested. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.encounter = None """ The encounter associated with this nutrition order. @@ -99,7 +99,7 @@ def elementProperties(self): js = super(NutritionOrder, self).elementProperties() js.extend([ ("allergyIntolerance", "allergyIntolerance", fhirreference.FHIRReference, True, None, False), - ("dateTime", "dateTime", fhirdate.FHIRDate, False, None, True), + ("dateTime", "dateTime", fhirdate.FHIRDateTime, False, None, True), ("encounter", "encounter", fhirreference.FHIRReference, False, None, False), ("enteralFormula", "enteralFormula", NutritionOrderEnteralFormula, False, None, False), ("excludeFoodModifier", "excludeFoodModifier", codeableconcept.CodeableConcept, True, None, False), diff --git a/fhirclient/models/observation.py b/fhirclient/models/observation.py index 5bdf46866..ebbf1fa0f 100644 --- a/fhirclient/models/observation.py +++ b/fhirclient/models/observation.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Observation) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Observation). +# 2024, SMART Health IT. from . import domainresource @@ -55,11 +55,11 @@ def __init__(self, jsondict=None, strict=True): self.effectiveDateTime = None """ Clinically relevant time/time-period for observation. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.effectiveInstant = None """ Clinically relevant time/time-period for observation. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.effectivePeriod = None """ Clinically relevant time/time-period for observation. @@ -92,7 +92,7 @@ def __init__(self, jsondict=None, strict=True): self.issued = None """ Date/Time this version was made available. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.method = None """ How it was done. @@ -136,7 +136,7 @@ def __init__(self, jsondict=None, strict=True): self.valueDateTime = None """ Actual result. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.valueInteger = None """ Actual result. @@ -168,7 +168,7 @@ def __init__(self, jsondict=None, strict=True): self.valueTime = None """ Actual result. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ super(Observation, self).__init__(jsondict=jsondict, strict=strict) @@ -183,8 +183,8 @@ def elementProperties(self): ("dataAbsentReason", "dataAbsentReason", codeableconcept.CodeableConcept, False, None, False), ("derivedFrom", "derivedFrom", fhirreference.FHIRReference, True, None, False), ("device", "device", fhirreference.FHIRReference, False, None, False), - ("effectiveDateTime", "effectiveDateTime", fhirdate.FHIRDate, False, "effective", False), - ("effectiveInstant", "effectiveInstant", fhirdate.FHIRDate, False, "effective", False), + ("effectiveDateTime", "effectiveDateTime", fhirdate.FHIRDateTime, False, "effective", False), + ("effectiveInstant", "effectiveInstant", fhirdate.FHIRInstant, False, "effective", False), ("effectivePeriod", "effectivePeriod", period.Period, False, "effective", False), ("effectiveTiming", "effectiveTiming", timing.Timing, False, "effective", False), ("encounter", "encounter", fhirreference.FHIRReference, False, None, False), @@ -192,7 +192,7 @@ def elementProperties(self): ("hasMember", "hasMember", fhirreference.FHIRReference, True, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("interpretation", "interpretation", codeableconcept.CodeableConcept, True, None, False), - ("issued", "issued", fhirdate.FHIRDate, False, None, False), + ("issued", "issued", fhirdate.FHIRInstant, False, None, False), ("method", "method", codeableconcept.CodeableConcept, False, None, False), ("note", "note", annotation.Annotation, True, None, False), ("partOf", "partOf", fhirreference.FHIRReference, True, None, False), @@ -203,7 +203,7 @@ def elementProperties(self): ("subject", "subject", fhirreference.FHIRReference, False, None, False), ("valueBoolean", "valueBoolean", bool, False, "value", False), ("valueCodeableConcept", "valueCodeableConcept", codeableconcept.CodeableConcept, False, "value", False), - ("valueDateTime", "valueDateTime", fhirdate.FHIRDate, False, "value", False), + ("valueDateTime", "valueDateTime", fhirdate.FHIRDateTime, False, "value", False), ("valueInteger", "valueInteger", int, False, "value", False), ("valuePeriod", "valuePeriod", period.Period, False, "value", False), ("valueQuantity", "valueQuantity", quantity.Quantity, False, "value", False), @@ -211,7 +211,7 @@ def elementProperties(self): ("valueRatio", "valueRatio", ratio.Ratio, False, "value", False), ("valueSampledData", "valueSampledData", sampleddata.SampledData, False, "value", False), ("valueString", "valueString", str, False, "value", False), - ("valueTime", "valueTime", fhirdate.FHIRDate, False, "value", False), + ("valueTime", "valueTime", fhirdate.FHIRTime, False, "value", False), ]) return js @@ -264,7 +264,7 @@ def __init__(self, jsondict=None, strict=True): self.valueDateTime = None """ Actual component result. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.valueInteger = None """ Actual component result. @@ -296,7 +296,7 @@ def __init__(self, jsondict=None, strict=True): self.valueTime = None """ Actual component result. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ super(ObservationComponent, self).__init__(jsondict=jsondict, strict=strict) @@ -309,7 +309,7 @@ def elementProperties(self): ("referenceRange", "referenceRange", ObservationReferenceRange, True, None, False), ("valueBoolean", "valueBoolean", bool, False, "value", False), ("valueCodeableConcept", "valueCodeableConcept", codeableconcept.CodeableConcept, False, "value", False), - ("valueDateTime", "valueDateTime", fhirdate.FHIRDate, False, "value", False), + ("valueDateTime", "valueDateTime", fhirdate.FHIRDateTime, False, "value", False), ("valueInteger", "valueInteger", int, False, "value", False), ("valuePeriod", "valuePeriod", period.Period, False, "value", False), ("valueQuantity", "valueQuantity", quantity.Quantity, False, "value", False), @@ -317,7 +317,7 @@ def elementProperties(self): ("valueRatio", "valueRatio", ratio.Ratio, False, "value", False), ("valueSampledData", "valueSampledData", sampleddata.SampledData, False, "value", False), ("valueString", "valueString", str, False, "value", False), - ("valueTime", "valueTime", fhirdate.FHIRDate, False, "value", False), + ("valueTime", "valueTime", fhirdate.FHIRTime, False, "value", False), ]) return js @@ -383,6 +383,8 @@ def elementProperties(self): from . import annotation from . import codeableconcept from . import fhirdate +from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/observationdefinition.py b/fhirclient/models/observationdefinition.py index 826c74ca2..8b483171f 100644 --- a/fhirclient/models/observationdefinition.py +++ b/fhirclient/models/observationdefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ObservationDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ObservationDefinition). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/operationdefinition.py b/fhirclient/models/operationdefinition.py index 4a12dd25c..42362fb3b 100644 --- a/fhirclient/models/operationdefinition.py +++ b/fhirclient/models/operationdefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/OperationDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/OperationDefinition). +# 2024, SMART Health IT. from . import domainresource @@ -43,7 +43,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the operation definition. @@ -136,7 +136,7 @@ def elementProperties(self): ("code", "code", str, False, None, True), ("comment", "comment", str, False, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("experimental", "experimental", bool, False, None, False), ("inputProfile", "inputProfile", str, False, None, False), diff --git a/fhirclient/models/operationoutcome.py b/fhirclient/models/operationoutcome.py index b945e344c..734b8eb5e 100644 --- a/fhirclient/models/operationoutcome.py +++ b/fhirclient/models/operationoutcome.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/OperationOutcome) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/OperationOutcome). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/organization.py b/fhirclient/models/organization.py index 97f26265e..fd39d1ce8 100644 --- a/fhirclient/models/organization.py +++ b/fhirclient/models/organization.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Organization) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Organization). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/organizationaffiliation.py b/fhirclient/models/organizationaffiliation.py index 0c445328f..9aeef430e 100644 --- a/fhirclient/models/organizationaffiliation.py +++ b/fhirclient/models/organizationaffiliation.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/OrganizationAffiliation). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/parameterdefinition.py b/fhirclient/models/parameterdefinition.py index 88c5b8824..eba5c3b76 100644 --- a/fhirclient/models/parameterdefinition.py +++ b/fhirclient/models/parameterdefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ParameterDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ParameterDefinition). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/parameters.py b/fhirclient/models/parameters.py index e2bd1ec41..cf3377905 100644 --- a/fhirclient/models/parameters.py +++ b/fhirclient/models/parameters.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Parameters) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Parameters). +# 2024, SMART Health IT. from . import resource @@ -132,7 +132,7 @@ def __init__(self, jsondict=None, strict=True): self.valueDateTime = None """ If parameter is a data type. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.valueDecimal = None """ If parameter is a data type. @@ -168,7 +168,7 @@ def __init__(self, jsondict=None, strict=True): self.valueInstant = None """ If parameter is a data type. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.valueInteger = None """ If parameter is a data type. @@ -236,7 +236,7 @@ def __init__(self, jsondict=None, strict=True): self.valueTime = None """ If parameter is a data type. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.valueTiming = None """ If parameter is a data type. @@ -290,7 +290,7 @@ def elementProperties(self): ("valueCount", "valueCount", count.Count, False, "value", False), ("valueDataRequirement", "valueDataRequirement", datarequirement.DataRequirement, False, "value", False), ("valueDate", "valueDate", fhirdate.FHIRDate, False, "value", False), - ("valueDateTime", "valueDateTime", fhirdate.FHIRDate, False, "value", False), + ("valueDateTime", "valueDateTime", fhirdate.FHIRDateTime, False, "value", False), ("valueDecimal", "valueDecimal", float, False, "value", False), ("valueDistance", "valueDistance", distance.Distance, False, "value", False), ("valueDosage", "valueDosage", dosage.Dosage, False, "value", False), @@ -299,7 +299,7 @@ def elementProperties(self): ("valueHumanName", "valueHumanName", humanname.HumanName, False, "value", False), ("valueId", "valueId", str, False, "value", False), ("valueIdentifier", "valueIdentifier", identifier.Identifier, False, "value", False), - ("valueInstant", "valueInstant", fhirdate.FHIRDate, False, "value", False), + ("valueInstant", "valueInstant", fhirdate.FHIRInstant, False, "value", False), ("valueInteger", "valueInteger", int, False, "value", False), ("valueMarkdown", "valueMarkdown", str, False, "value", False), ("valueMeta", "valueMeta", meta.Meta, False, "value", False), @@ -316,7 +316,7 @@ def elementProperties(self): ("valueSampledData", "valueSampledData", sampleddata.SampledData, False, "value", False), ("valueSignature", "valueSignature", signature.Signature, False, "value", False), ("valueString", "valueString", str, False, "value", False), - ("valueTime", "valueTime", fhirdate.FHIRDate, False, "value", False), + ("valueTime", "valueTime", fhirdate.FHIRTime, False, "value", False), ("valueTiming", "valueTiming", timing.Timing, False, "value", False), ("valueTriggerDefinition", "valueTriggerDefinition", triggerdefinition.TriggerDefinition, False, "value", False), ("valueUnsignedInt", "valueUnsignedInt", int, False, "value", False), @@ -344,6 +344,9 @@ def elementProperties(self): from . import duration from . import expression from . import fhirdate +from . import fhirdate +from . import fhirdate +from . import fhirdate from . import fhirreference from . import humanname from . import identifier diff --git a/fhirclient/models/patient.py b/fhirclient/models/patient.py index 811c6f25b..2ea4d028a 100644 --- a/fhirclient/models/patient.py +++ b/fhirclient/models/patient.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Patient) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Patient). +# 2024, SMART Health IT. from . import domainresource @@ -48,7 +48,7 @@ def __init__(self, jsondict=None, strict=True): self.deceasedDateTime = None """ Indicates if the individual is deceased or not. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.gender = None """ male | female | other | unknown. @@ -106,7 +106,7 @@ def elementProperties(self): ("communication", "communication", PatientCommunication, True, None, False), ("contact", "contact", PatientContact, True, None, False), ("deceasedBoolean", "deceasedBoolean", bool, False, "deceased", False), - ("deceasedDateTime", "deceasedDateTime", fhirdate.FHIRDate, False, "deceased", False), + ("deceasedDateTime", "deceasedDateTime", fhirdate.FHIRDateTime, False, "deceased", False), ("gender", "gender", str, False, None, False), ("generalPractitioner", "generalPractitioner", fhirreference.FHIRReference, True, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), @@ -259,6 +259,7 @@ def elementProperties(self): from . import codeableconcept from . import contactpoint from . import fhirdate +from . import fhirdate from . import fhirreference from . import humanname from . import identifier diff --git a/fhirclient/models/paymentnotice.py b/fhirclient/models/paymentnotice.py index f617ea170..1a6677a0b 100644 --- a/fhirclient/models/paymentnotice.py +++ b/fhirclient/models/paymentnotice.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/PaymentNotice) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/PaymentNotice). +# 2024, SMART Health IT. from . import domainresource @@ -27,7 +27,7 @@ def __init__(self, jsondict=None, strict=True): self.created = None """ Creation date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.identifier = None """ Business Identifier for the payment noctice. @@ -75,7 +75,7 @@ def elementProperties(self): js = super(PaymentNotice, self).elementProperties() js.extend([ ("amount", "amount", money.Money, False, None, True), - ("created", "created", fhirdate.FHIRDate, False, None, True), + ("created", "created", fhirdate.FHIRDateTime, False, None, True), ("identifier", "identifier", identifier.Identifier, True, None, False), ("payee", "payee", fhirreference.FHIRReference, False, None, False), ("payment", "payment", fhirreference.FHIRReference, False, None, True), @@ -92,6 +92,7 @@ def elementProperties(self): from . import codeableconcept from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import money diff --git a/fhirclient/models/paymentreconciliation.py b/fhirclient/models/paymentreconciliation.py index 86b52e9b5..9839dcf6b 100644 --- a/fhirclient/models/paymentreconciliation.py +++ b/fhirclient/models/paymentreconciliation.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/PaymentReconciliation) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/PaymentReconciliation). +# 2024, SMART Health IT. from . import domainresource @@ -23,7 +23,7 @@ def __init__(self, jsondict=None, strict=True): self.created = None """ Creation date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.detail = None """ Settlement particulars. @@ -86,7 +86,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(PaymentReconciliation, self).elementProperties() js.extend([ - ("created", "created", fhirdate.FHIRDate, False, None, True), + ("created", "created", fhirdate.FHIRDateTime, False, None, True), ("detail", "detail", PaymentReconciliationDetail, True, None, False), ("disposition", "disposition", str, False, None, False), ("formCode", "formCode", codeableconcept.CodeableConcept, False, None, False), @@ -219,6 +219,7 @@ def elementProperties(self): from . import codeableconcept from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import money diff --git a/fhirclient/models/period.py b/fhirclient/models/period.py index 93f37cde0..0a3578649 100644 --- a/fhirclient/models/period.py +++ b/fhirclient/models/period.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Period) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Period). +# 2024, SMART Health IT. from . import element @@ -22,19 +22,19 @@ def __init__(self, jsondict=None, strict=True): self.end = None """ End time with inclusive boundary, if not ongoing. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.start = None """ Starting time with inclusive boundary. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ super(Period, self).__init__(jsondict=jsondict, strict=strict) def elementProperties(self): js = super(Period, self).elementProperties() js.extend([ - ("end", "end", fhirdate.FHIRDate, False, None, False), - ("start", "start", fhirdate.FHIRDate, False, None, False), + ("end", "end", fhirdate.FHIRDateTime, False, None, False), + ("start", "start", fhirdate.FHIRDateTime, False, None, False), ]) return js diff --git a/fhirclient/models/person.py b/fhirclient/models/person.py index 1e54640d6..103b459b3 100644 --- a/fhirclient/models/person.py +++ b/fhirclient/models/person.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Person) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Person). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/plandefinition.py b/fhirclient/models/plandefinition.py index 4bc7af21c..8979fbd14 100644 --- a/fhirclient/models/plandefinition.py +++ b/fhirclient/models/plandefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/PlanDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/PlanDefinition). +# 2024, SMART Health IT. from . import domainresource @@ -46,7 +46,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the plan definition. @@ -163,7 +163,7 @@ def elementProperties(self): ("author", "author", contactdetail.ContactDetail, True, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("editor", "editor", contactdetail.ContactDetail, True, None, False), ("effectivePeriod", "effectivePeriod", period.Period, False, None, False), @@ -315,7 +315,7 @@ def __init__(self, jsondict=None, strict=True): self.timingDateTime = None """ When the action should take place. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.timingDuration = None """ When the action should take place. @@ -379,7 +379,7 @@ def elementProperties(self): ("subjectReference", "subjectReference", fhirreference.FHIRReference, False, "subject", False), ("textEquivalent", "textEquivalent", str, False, None, False), ("timingAge", "timingAge", age.Age, False, "timing", False), - ("timingDateTime", "timingDateTime", fhirdate.FHIRDate, False, "timing", False), + ("timingDateTime", "timingDateTime", fhirdate.FHIRDateTime, False, "timing", False), ("timingDuration", "timingDuration", duration.Duration, False, "timing", False), ("timingPeriod", "timingPeriod", period.Period, False, "timing", False), ("timingRange", "timingRange", range.Range, False, "timing", False), @@ -669,6 +669,7 @@ def elementProperties(self): from . import duration from . import expression from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/population.py b/fhirclient/models/population.py index 2b432d99c..07769f844 100644 --- a/fhirclient/models/population.py +++ b/fhirclient/models/population.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Population) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Population). +# 2024, SMART Health IT. from . import backboneelement diff --git a/fhirclient/models/practitioner.py b/fhirclient/models/practitioner.py index b79f3d4e4..7f03cc72d 100644 --- a/fhirclient/models/practitioner.py +++ b/fhirclient/models/practitioner.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Practitioner) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Practitioner). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/practitionerrole.py b/fhirclient/models/practitionerrole.py index 32e754f9d..86b740298 100644 --- a/fhirclient/models/practitionerrole.py +++ b/fhirclient/models/practitionerrole.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/PractitionerRole) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/PractitionerRole). +# 2024, SMART Health IT. from . import domainresource @@ -129,11 +129,11 @@ def __init__(self, jsondict=None, strict=True): self.availableEndTime = None """ Closing time of day (ignored if allDay = true). - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.availableStartTime = None """ Opening time of day (ignored if allDay = true). - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.daysOfWeek = None """ mon | tue | wed | thu | fri | sat | sun. @@ -145,8 +145,8 @@ def elementProperties(self): js = super(PractitionerRoleAvailableTime, self).elementProperties() js.extend([ ("allDay", "allDay", bool, False, None, False), - ("availableEndTime", "availableEndTime", fhirdate.FHIRDate, False, None, False), - ("availableStartTime", "availableStartTime", fhirdate.FHIRDate, False, None, False), + ("availableEndTime", "availableEndTime", fhirdate.FHIRTime, False, None, False), + ("availableStartTime", "availableStartTime", fhirdate.FHIRTime, False, None, False), ("daysOfWeek", "daysOfWeek", str, True, None, False), ]) return js diff --git a/fhirclient/models/procedure.py b/fhirclient/models/procedure.py index f9a949f60..0b2b7b735 100644 --- a/fhirclient/models/procedure.py +++ b/fhirclient/models/procedure.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Procedure) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Procedure). +# 2024, SMART Health IT. from . import domainresource @@ -96,7 +96,7 @@ def __init__(self, jsondict=None, strict=True): self.performedDateTime = None """ When the procedure was performed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.performedPeriod = None """ When the procedure was performed. @@ -174,7 +174,7 @@ def elementProperties(self): ("outcome", "outcome", codeableconcept.CodeableConcept, False, None, False), ("partOf", "partOf", fhirreference.FHIRReference, True, None, False), ("performedAge", "performedAge", age.Age, False, "performed", False), - ("performedDateTime", "performedDateTime", fhirdate.FHIRDate, False, "performed", False), + ("performedDateTime", "performedDateTime", fhirdate.FHIRDateTime, False, "performed", False), ("performedPeriod", "performedPeriod", period.Period, False, "performed", False), ("performedRange", "performedRange", range.Range, False, "performed", False), ("performedString", "performedString", str, False, "performed", False), diff --git a/fhirclient/models/prodcharacteristic.py b/fhirclient/models/prodcharacteristic.py index dc04657bc..655454670 100644 --- a/fhirclient/models/prodcharacteristic.py +++ b/fhirclient/models/prodcharacteristic.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ProdCharacteristic) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ProdCharacteristic). +# 2024, SMART Health IT. from . import backboneelement diff --git a/fhirclient/models/productshelflife.py b/fhirclient/models/productshelflife.py index b10ea48ae..ef45d8596 100644 --- a/fhirclient/models/productshelflife.py +++ b/fhirclient/models/productshelflife.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ProductShelfLife) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ProductShelfLife). +# 2024, SMART Health IT. from . import backboneelement diff --git a/fhirclient/models/provenance.py b/fhirclient/models/provenance.py index 248ecb2f9..488112d47 100644 --- a/fhirclient/models/provenance.py +++ b/fhirclient/models/provenance.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Provenance) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Provenance). +# 2024, SMART Health IT. from . import domainresource @@ -47,7 +47,7 @@ def __init__(self, jsondict=None, strict=True): self.occurredDateTime = None """ When the activity occurred. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.occurredPeriod = None """ When the activity occurred. @@ -63,7 +63,7 @@ def __init__(self, jsondict=None, strict=True): self.recorded = None """ When the activity was recorded / updated. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.signature = None """ Signature on target. @@ -82,11 +82,11 @@ def elementProperties(self): ("agent", "agent", ProvenanceAgent, True, None, True), ("entity", "entity", ProvenanceEntity, True, None, False), ("location", "location", fhirreference.FHIRReference, False, None, False), - ("occurredDateTime", "occurredDateTime", fhirdate.FHIRDate, False, "occurred", False), + ("occurredDateTime", "occurredDateTime", fhirdate.FHIRDateTime, False, "occurred", False), ("occurredPeriod", "occurredPeriod", period.Period, False, "occurred", False), ("policy", "policy", str, True, None, False), ("reason", "reason", codeableconcept.CodeableConcept, True, None, False), - ("recorded", "recorded", fhirdate.FHIRDate, False, None, True), + ("recorded", "recorded", fhirdate.FHIRInstant, False, None, True), ("signature", "signature", signature.Signature, True, None, False), ("target", "target", fhirreference.FHIRReference, True, None, True), ]) @@ -181,6 +181,7 @@ def elementProperties(self): from . import codeableconcept from . import fhirdate +from . import fhirdate from . import fhirreference from . import period from . import signature diff --git a/fhirclient/models/quantity.py b/fhirclient/models/quantity.py index 069c5a7f7..2ea786f1f 100644 --- a/fhirclient/models/quantity.py +++ b/fhirclient/models/quantity.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MoneyQuantity) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/MoneyQuantity). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/questionnaire.py b/fhirclient/models/questionnaire.py index 95a18d815..ebbc11ba9 100644 --- a/fhirclient/models/questionnaire.py +++ b/fhirclient/models/questionnaire.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Questionnaire) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Questionnaire). +# 2024, SMART Health IT. from . import domainresource @@ -41,7 +41,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.derivedFrom = None """ Instantiates protocol or definition. @@ -121,7 +121,7 @@ def elementProperties(self): ("code", "code", coding.Coding, True, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("derivedFrom", "derivedFrom", str, True, None, False), ("description", "description", str, False, None, False), ("effectivePeriod", "effectivePeriod", period.Period, False, None, False), @@ -293,7 +293,7 @@ def __init__(self, jsondict=None, strict=True): self.valueTime = None """ Answer value. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ super(QuestionnaireItemAnswerOption, self).__init__(jsondict=jsondict, strict=strict) @@ -306,7 +306,7 @@ def elementProperties(self): ("valueInteger", "valueInteger", int, False, "value", True), ("valueReference", "valueReference", fhirreference.FHIRReference, False, "value", True), ("valueString", "valueString", str, False, "value", True), - ("valueTime", "valueTime", fhirdate.FHIRDate, False, "value", True), + ("valueTime", "valueTime", fhirdate.FHIRTime, False, "value", True), ]) return js @@ -343,7 +343,7 @@ def __init__(self, jsondict=None, strict=True): self.answerDateTime = None """ Value for question comparison based on operator. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.answerDecimal = None """ Value for question comparison based on operator. @@ -367,7 +367,7 @@ def __init__(self, jsondict=None, strict=True): self.answerTime = None """ Value for question comparison based on operator. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.operator = None """ exists | = | != | > | < | >= | <=. @@ -385,13 +385,13 @@ def elementProperties(self): ("answerBoolean", "answerBoolean", bool, False, "answer", True), ("answerCoding", "answerCoding", coding.Coding, False, "answer", True), ("answerDate", "answerDate", fhirdate.FHIRDate, False, "answer", True), - ("answerDateTime", "answerDateTime", fhirdate.FHIRDate, False, "answer", True), + ("answerDateTime", "answerDateTime", fhirdate.FHIRDateTime, False, "answer", True), ("answerDecimal", "answerDecimal", float, False, "answer", True), ("answerInteger", "answerInteger", int, False, "answer", True), ("answerQuantity", "answerQuantity", quantity.Quantity, False, "answer", True), ("answerReference", "answerReference", fhirreference.FHIRReference, False, "answer", True), ("answerString", "answerString", str, False, "answer", True), - ("answerTime", "answerTime", fhirdate.FHIRDate, False, "answer", True), + ("answerTime", "answerTime", fhirdate.FHIRTime, False, "answer", True), ("operator", "operator", str, False, None, True), ("question", "question", str, False, None, True), ]) @@ -433,7 +433,7 @@ def __init__(self, jsondict=None, strict=True): self.valueDateTime = None """ Actual value for initializing the question. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.valueDecimal = None """ Actual value for initializing the question. @@ -457,7 +457,7 @@ def __init__(self, jsondict=None, strict=True): self.valueTime = None """ Actual value for initializing the question. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.valueUri = None """ Actual value for initializing the question. @@ -472,13 +472,13 @@ def elementProperties(self): ("valueBoolean", "valueBoolean", bool, False, "value", True), ("valueCoding", "valueCoding", coding.Coding, False, "value", True), ("valueDate", "valueDate", fhirdate.FHIRDate, False, "value", True), - ("valueDateTime", "valueDateTime", fhirdate.FHIRDate, False, "value", True), + ("valueDateTime", "valueDateTime", fhirdate.FHIRDateTime, False, "value", True), ("valueDecimal", "valueDecimal", float, False, "value", True), ("valueInteger", "valueInteger", int, False, "value", True), ("valueQuantity", "valueQuantity", quantity.Quantity, False, "value", True), ("valueReference", "valueReference", fhirreference.FHIRReference, False, "value", True), ("valueString", "valueString", str, False, "value", True), - ("valueTime", "valueTime", fhirdate.FHIRDate, False, "value", True), + ("valueTime", "valueTime", fhirdate.FHIRTime, False, "value", True), ("valueUri", "valueUri", str, False, "value", True), ]) return js @@ -489,6 +489,8 @@ def elementProperties(self): from . import coding from . import contactdetail from . import fhirdate +from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/questionnaireresponse.py b/fhirclient/models/questionnaireresponse.py index 4b10bed6a..a726df8d3 100644 --- a/fhirclient/models/questionnaireresponse.py +++ b/fhirclient/models/questionnaireresponse.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse). +# 2024, SMART Health IT. from . import domainresource @@ -28,7 +28,7 @@ def __init__(self, jsondict=None, strict=True): self.authored = None """ Date the answers were gathered. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.basedOn = None """ Request fulfilled by this QuestionnaireResponse. @@ -72,7 +72,7 @@ def elementProperties(self): js = super(QuestionnaireResponse, self).elementProperties() js.extend([ ("author", "author", fhirreference.FHIRReference, False, None, False), - ("authored", "authored", fhirdate.FHIRDate, False, None, False), + ("authored", "authored", fhirdate.FHIRDateTime, False, None, False), ("basedOn", "basedOn", fhirreference.FHIRReference, True, None, False), ("encounter", "encounter", fhirreference.FHIRReference, False, None, False), ("identifier", "identifier", identifier.Identifier, False, None, False), @@ -177,7 +177,7 @@ def __init__(self, jsondict=None, strict=True): self.valueDateTime = None """ Single-valued answer to the question. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.valueDecimal = None """ Single-valued answer to the question. @@ -201,7 +201,7 @@ def __init__(self, jsondict=None, strict=True): self.valueTime = None """ Single-valued answer to the question. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.valueUri = None """ Single-valued answer to the question. @@ -217,13 +217,13 @@ def elementProperties(self): ("valueBoolean", "valueBoolean", bool, False, "value", False), ("valueCoding", "valueCoding", coding.Coding, False, "value", False), ("valueDate", "valueDate", fhirdate.FHIRDate, False, "value", False), - ("valueDateTime", "valueDateTime", fhirdate.FHIRDate, False, "value", False), + ("valueDateTime", "valueDateTime", fhirdate.FHIRDateTime, False, "value", False), ("valueDecimal", "valueDecimal", float, False, "value", False), ("valueInteger", "valueInteger", int, False, "value", False), ("valueQuantity", "valueQuantity", quantity.Quantity, False, "value", False), ("valueReference", "valueReference", fhirreference.FHIRReference, False, "value", False), ("valueString", "valueString", str, False, "value", False), - ("valueTime", "valueTime", fhirdate.FHIRDate, False, "value", False), + ("valueTime", "valueTime", fhirdate.FHIRTime, False, "value", False), ("valueUri", "valueUri", str, False, "value", False), ]) return js @@ -232,6 +232,8 @@ def elementProperties(self): from . import attachment from . import coding from . import fhirdate +from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import quantity diff --git a/fhirclient/models/range.py b/fhirclient/models/range.py index 09384d5ff..04c8f055b 100644 --- a/fhirclient/models/range.py +++ b/fhirclient/models/range.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Range) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Range). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/ratio.py b/fhirclient/models/ratio.py index 1915be5a4..7f4d6c4ab 100644 --- a/fhirclient/models/ratio.py +++ b/fhirclient/models/ratio.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Ratio) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Ratio). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/reference.py b/fhirclient/models/reference.py index 8c7904bce..9297ddf6c 100644 --- a/fhirclient/models/reference.py +++ b/fhirclient/models/reference.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Reference) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Reference). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/relatedartifact.py b/fhirclient/models/relatedartifact.py index 4fa92f1fb..e42b57fe8 100644 --- a/fhirclient/models/relatedartifact.py +++ b/fhirclient/models/relatedartifact.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/RelatedArtifact) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/RelatedArtifact). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/relatedperson.py b/fhirclient/models/relatedperson.py index f4510fa94..e3abf39d8 100644 --- a/fhirclient/models/relatedperson.py +++ b/fhirclient/models/relatedperson.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/RelatedPerson) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/RelatedPerson). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/requestgroup.py b/fhirclient/models/requestgroup.py index c1a05af79..4f15a9e97 100644 --- a/fhirclient/models/requestgroup.py +++ b/fhirclient/models/requestgroup.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/RequestGroup) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/RequestGroup). +# 2024, SMART Health IT. from . import domainresource @@ -31,7 +31,7 @@ def __init__(self, jsondict=None, strict=True): self.authoredOn = None """ When the request group was authored. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.basedOn = None """ Fulfills plan, proposal, or order. @@ -102,7 +102,7 @@ def elementProperties(self): js.extend([ ("action", "action", RequestGroupAction, True, None, False), ("author", "author", fhirreference.FHIRReference, False, None, False), - ("authoredOn", "authoredOn", fhirdate.FHIRDate, False, None, False), + ("authoredOn", "authoredOn", fhirdate.FHIRDateTime, False, None, False), ("basedOn", "basedOn", fhirreference.FHIRReference, True, None, False), ("code", "code", codeableconcept.CodeableConcept, False, None, False), ("encounter", "encounter", fhirreference.FHIRReference, False, None, False), @@ -211,7 +211,7 @@ def __init__(self, jsondict=None, strict=True): self.timingDateTime = None """ When the action should take place. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.timingDuration = None """ When the action should take place. @@ -259,7 +259,7 @@ def elementProperties(self): ("selectionBehavior", "selectionBehavior", str, False, None, False), ("textEquivalent", "textEquivalent", str, False, None, False), ("timingAge", "timingAge", age.Age, False, "timing", False), - ("timingDateTime", "timingDateTime", fhirdate.FHIRDate, False, "timing", False), + ("timingDateTime", "timingDateTime", fhirdate.FHIRDateTime, False, "timing", False), ("timingDuration", "timingDuration", duration.Duration, False, "timing", False), ("timingPeriod", "timingPeriod", period.Period, False, "timing", False), ("timingRange", "timingRange", range.Range, False, "timing", False), diff --git a/fhirclient/models/researchdefinition.py b/fhirclient/models/researchdefinition.py index e26f93640..edcc3dbf2 100644 --- a/fhirclient/models/researchdefinition.py +++ b/fhirclient/models/researchdefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ResearchDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ResearchDefinition). +# 2024, SMART Health IT. from . import domainresource @@ -45,7 +45,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the research definition. @@ -177,7 +177,7 @@ def elementProperties(self): ("comment", "comment", str, True, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("editor", "editor", contactdetail.ContactDetail, True, None, False), ("effectivePeriod", "effectivePeriod", period.Period, False, None, False), @@ -214,6 +214,7 @@ def elementProperties(self): from . import codeableconcept from . import contactdetail from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/researchelementdefinition.py b/fhirclient/models/researchelementdefinition.py index 875b73265..f09da8367 100644 --- a/fhirclient/models/researchelementdefinition.py +++ b/fhirclient/models/researchelementdefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ResearchElementDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ResearchElementDefinition). +# 2024, SMART Health IT. from . import domainresource @@ -47,7 +47,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the research element definition. @@ -173,7 +173,7 @@ def elementProperties(self): ("comment", "comment", str, True, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("editor", "editor", contactdetail.ContactDetail, True, None, False), ("effectivePeriod", "effectivePeriod", period.Period, False, None, False), @@ -246,7 +246,7 @@ def __init__(self, jsondict=None, strict=True): self.participantEffectiveDateTime = None """ What time period do participants cover. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.participantEffectiveDescription = None """ What time period do participants cover. @@ -275,7 +275,7 @@ def __init__(self, jsondict=None, strict=True): self.studyEffectiveDateTime = None """ What time period does the study cover. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.studyEffectiveDescription = None """ What time period does the study cover. @@ -320,14 +320,14 @@ def elementProperties(self): ("definitionDataRequirement", "definitionDataRequirement", datarequirement.DataRequirement, False, "definition", True), ("definitionExpression", "definitionExpression", expression.Expression, False, "definition", True), ("exclude", "exclude", bool, False, None, False), - ("participantEffectiveDateTime", "participantEffectiveDateTime", fhirdate.FHIRDate, False, "participantEffective", False), + ("participantEffectiveDateTime", "participantEffectiveDateTime", fhirdate.FHIRDateTime, False, "participantEffective", False), ("participantEffectiveDescription", "participantEffectiveDescription", str, False, None, False), ("participantEffectiveDuration", "participantEffectiveDuration", duration.Duration, False, "participantEffective", False), ("participantEffectiveGroupMeasure", "participantEffectiveGroupMeasure", str, False, None, False), ("participantEffectivePeriod", "participantEffectivePeriod", period.Period, False, "participantEffective", False), ("participantEffectiveTimeFromStart", "participantEffectiveTimeFromStart", duration.Duration, False, None, False), ("participantEffectiveTiming", "participantEffectiveTiming", timing.Timing, False, "participantEffective", False), - ("studyEffectiveDateTime", "studyEffectiveDateTime", fhirdate.FHIRDate, False, "studyEffective", False), + ("studyEffectiveDateTime", "studyEffectiveDateTime", fhirdate.FHIRDateTime, False, "studyEffective", False), ("studyEffectiveDescription", "studyEffectiveDescription", str, False, None, False), ("studyEffectiveDuration", "studyEffectiveDuration", duration.Duration, False, "studyEffective", False), ("studyEffectiveGroupMeasure", "studyEffectiveGroupMeasure", str, False, None, False), @@ -346,6 +346,7 @@ def elementProperties(self): from . import duration from . import expression from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/researchstudy.py b/fhirclient/models/researchstudy.py index 1105b73a6..7f97827d4 100644 --- a/fhirclient/models/researchstudy.py +++ b/fhirclient/models/researchstudy.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ResearchStudy) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ResearchStudy). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/researchsubject.py b/fhirclient/models/researchsubject.py index d85fa0076..e20e34f70 100644 --- a/fhirclient/models/researchsubject.py +++ b/fhirclient/models/researchsubject.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ResearchSubject) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ResearchSubject). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/resource.py b/fhirclient/models/resource.py index 05e8ca7a2..00f193102 100644 --- a/fhirclient/models/resource.py +++ b/fhirclient/models/resource.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Resource) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Resource). +# 2024, SMART Health IT. from . import fhirabstractresource diff --git a/fhirclient/models/riskassessment.py b/fhirclient/models/riskassessment.py index a11479335..57dd3341d 100644 --- a/fhirclient/models/riskassessment.py +++ b/fhirclient/models/riskassessment.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/RiskAssessment) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/RiskAssessment). +# 2024, SMART Health IT. from . import domainresource @@ -59,7 +59,7 @@ def __init__(self, jsondict=None, strict=True): self.occurrenceDateTime = None """ When was assessment made?. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.occurrencePeriod = None """ When was assessment made?. @@ -107,7 +107,7 @@ def elementProperties(self): ("method", "method", codeableconcept.CodeableConcept, False, None, False), ("mitigation", "mitigation", str, False, None, False), ("note", "note", annotation.Annotation, True, None, False), - ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDate, False, "occurrence", False), + ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDateTime, False, "occurrence", False), ("occurrencePeriod", "occurrencePeriod", period.Period, False, "occurrence", False), ("parent", "parent", fhirreference.FHIRReference, False, None, False), ("performer", "performer", fhirreference.FHIRReference, False, None, False), diff --git a/fhirclient/models/riskevidencesynthesis.py b/fhirclient/models/riskevidencesynthesis.py index 2d881af0a..19e8faaca 100644 --- a/fhirclient/models/riskevidencesynthesis.py +++ b/fhirclient/models/riskevidencesynthesis.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/RiskEvidenceSynthesis) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/RiskEvidenceSynthesis). +# 2024, SMART Health IT. from . import domainresource @@ -44,7 +44,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the risk evidence synthesis. @@ -158,7 +158,7 @@ def elementProperties(self): ("certainty", "certainty", RiskEvidenceSynthesisCertainty, True, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("editor", "editor", contactdetail.ContactDetail, True, None, False), ("effectivePeriod", "effectivePeriod", period.Period, False, None, False), @@ -419,6 +419,7 @@ def elementProperties(self): from . import codeableconcept from . import contactdetail from . import fhirdate +from . import fhirdate from . import fhirreference from . import identifier from . import period diff --git a/fhirclient/models/sampleddata.py b/fhirclient/models/sampleddata.py index 5b6a2dd49..cbd177bef 100644 --- a/fhirclient/models/sampleddata.py +++ b/fhirclient/models/sampleddata.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SampledData) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SampledData). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/schedule.py b/fhirclient/models/schedule.py index b7d269674..21d03b500 100644 --- a/fhirclient/models/schedule.py +++ b/fhirclient/models/schedule.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Schedule) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Schedule). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/searchparameter.py b/fhirclient/models/searchparameter.py index aac3be364..5aa8b39c8 100644 --- a/fhirclient/models/searchparameter.py +++ b/fhirclient/models/searchparameter.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SearchParameter) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SearchParameter). +# 2024, SMART Health IT. from . import domainresource @@ -47,7 +47,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.derivedFrom = None """ Original definition for the search parameter. @@ -139,7 +139,7 @@ def elementProperties(self): ("comparator", "comparator", str, True, None, False), ("component", "component", SearchParameterComponent, True, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("derivedFrom", "derivedFrom", str, False, None, False), ("description", "description", str, False, None, True), ("experimental", "experimental", bool, False, None, False), diff --git a/fhirclient/models/servicerequest.py b/fhirclient/models/servicerequest.py index e4e78e96e..35ee0bb5c 100644 --- a/fhirclient/models/servicerequest.py +++ b/fhirclient/models/servicerequest.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ServiceRequest) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ServiceRequest). +# 2024, SMART Health IT. from . import domainresource @@ -31,7 +31,7 @@ def __init__(self, jsondict=None, strict=True): self.authoredOn = None """ Date request signed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.basedOn = None """ What request fulfills. @@ -92,7 +92,7 @@ def __init__(self, jsondict=None, strict=True): self.occurrenceDateTime = None """ When service should occur. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.occurrencePeriod = None """ When service should occur. @@ -182,7 +182,7 @@ def elementProperties(self): js.extend([ ("asNeededBoolean", "asNeededBoolean", bool, False, "asNeeded", False), ("asNeededCodeableConcept", "asNeededCodeableConcept", codeableconcept.CodeableConcept, False, "asNeeded", False), - ("authoredOn", "authoredOn", fhirdate.FHIRDate, False, None, False), + ("authoredOn", "authoredOn", fhirdate.FHIRDateTime, False, None, False), ("basedOn", "basedOn", fhirreference.FHIRReference, True, None, False), ("bodySite", "bodySite", codeableconcept.CodeableConcept, True, None, False), ("category", "category", codeableconcept.CodeableConcept, True, None, False), @@ -197,7 +197,7 @@ def elementProperties(self): ("locationCode", "locationCode", codeableconcept.CodeableConcept, True, None, False), ("locationReference", "locationReference", fhirreference.FHIRReference, True, None, False), ("note", "note", annotation.Annotation, True, None, False), - ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDate, False, "occurrence", False), + ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDateTime, False, "occurrence", False), ("occurrencePeriod", "occurrencePeriod", period.Period, False, "occurrence", False), ("occurrenceTiming", "occurrenceTiming", timing.Timing, False, "occurrence", False), ("orderDetail", "orderDetail", codeableconcept.CodeableConcept, True, None, False), diff --git a/fhirclient/models/signature.py b/fhirclient/models/signature.py index d27753f62..3aaf92457 100644 --- a/fhirclient/models/signature.py +++ b/fhirclient/models/signature.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Signature) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Signature). +# 2024, SMART Health IT. from . import element @@ -46,7 +46,7 @@ def __init__(self, jsondict=None, strict=True): self.when = None """ When the signature was created. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.who = None """ Who signed. @@ -62,7 +62,7 @@ def elementProperties(self): ("sigFormat", "sigFormat", str, False, None, False), ("targetFormat", "targetFormat", str, False, None, False), ("type", "type", coding.Coding, True, None, True), - ("when", "when", fhirdate.FHIRDate, False, None, True), + ("when", "when", fhirdate.FHIRInstant, False, None, True), ("who", "who", fhirreference.FHIRReference, False, None, True), ]) return js diff --git a/fhirclient/models/slot.py b/fhirclient/models/slot.py index 413d334c5..5964292bd 100644 --- a/fhirclient/models/slot.py +++ b/fhirclient/models/slot.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Slot) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Slot). +# 2024, SMART Health IT. from . import domainresource @@ -30,7 +30,7 @@ def __init__(self, jsondict=None, strict=True): self.end = None """ Date/Time that the slot is to conclude. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.identifier = None """ External Ids for this item. @@ -65,7 +65,7 @@ def __init__(self, jsondict=None, strict=True): self.start = None """ Date/Time that the slot is to begin. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.status = None """ busy | free | busy-unavailable | busy-tentative | entered-in-error. @@ -78,14 +78,14 @@ def elementProperties(self): js.extend([ ("appointmentType", "appointmentType", codeableconcept.CodeableConcept, False, None, False), ("comment", "comment", str, False, None, False), - ("end", "end", fhirdate.FHIRDate, False, None, True), + ("end", "end", fhirdate.FHIRInstant, False, None, True), ("identifier", "identifier", identifier.Identifier, True, None, False), ("overbooked", "overbooked", bool, False, None, False), ("schedule", "schedule", fhirreference.FHIRReference, False, None, True), ("serviceCategory", "serviceCategory", codeableconcept.CodeableConcept, True, None, False), ("serviceType", "serviceType", codeableconcept.CodeableConcept, True, None, False), ("specialty", "specialty", codeableconcept.CodeableConcept, True, None, False), - ("start", "start", fhirdate.FHIRDate, False, None, True), + ("start", "start", fhirdate.FHIRInstant, False, None, True), ("status", "status", str, False, None, True), ]) return js diff --git a/fhirclient/models/specimen.py b/fhirclient/models/specimen.py index e0756c32c..b2686e5c0 100644 --- a/fhirclient/models/specimen.py +++ b/fhirclient/models/specimen.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Specimen) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Specimen). +# 2024, SMART Health IT. from . import domainresource @@ -54,7 +54,7 @@ def __init__(self, jsondict=None, strict=True): self.receivedTime = None """ The time when specimen was received for processing. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.request = None """ Why the specimen was collected. @@ -87,7 +87,7 @@ def elementProperties(self): ("note", "note", annotation.Annotation, True, None, False), ("parent", "parent", fhirreference.FHIRReference, True, None, False), ("processing", "processing", SpecimenProcessing, True, None, False), - ("receivedTime", "receivedTime", fhirdate.FHIRDate, False, None, False), + ("receivedTime", "receivedTime", fhirdate.FHIRDateTime, False, None, False), ("request", "request", fhirreference.FHIRReference, True, None, False), ("status", "status", str, False, None, False), ("subject", "subject", fhirreference.FHIRReference, False, None, False), @@ -120,7 +120,7 @@ def __init__(self, jsondict=None, strict=True): self.collectedDateTime = None """ Collection time. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.collectedPeriod = None """ Collection time. @@ -156,7 +156,7 @@ def elementProperties(self): js = super(SpecimenCollection, self).elementProperties() js.extend([ ("bodySite", "bodySite", codeableconcept.CodeableConcept, False, None, False), - ("collectedDateTime", "collectedDateTime", fhirdate.FHIRDate, False, "collected", False), + ("collectedDateTime", "collectedDateTime", fhirdate.FHIRDateTime, False, "collected", False), ("collectedPeriod", "collectedPeriod", period.Period, False, "collected", False), ("collector", "collector", fhirreference.FHIRReference, False, None, False), ("duration", "duration", duration.Duration, False, None, False), @@ -259,7 +259,7 @@ def __init__(self, jsondict=None, strict=True): self.timeDateTime = None """ Date and time of specimen processing. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.timePeriod = None """ Date and time of specimen processing. @@ -273,7 +273,7 @@ def elementProperties(self): ("additive", "additive", fhirreference.FHIRReference, True, None, False), ("description", "description", str, False, None, False), ("procedure", "procedure", codeableconcept.CodeableConcept, False, None, False), - ("timeDateTime", "timeDateTime", fhirdate.FHIRDate, False, "time", False), + ("timeDateTime", "timeDateTime", fhirdate.FHIRDateTime, False, "time", False), ("timePeriod", "timePeriod", period.Period, False, "time", False), ]) return js diff --git a/fhirclient/models/specimendefinition.py b/fhirclient/models/specimendefinition.py index 9221b79be..540fb2286 100644 --- a/fhirclient/models/specimendefinition.py +++ b/fhirclient/models/specimendefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SpecimenDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SpecimenDefinition). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/structuredefinition.py b/fhirclient/models/structuredefinition.py index 50bd0f91a..c46bb0820 100644 --- a/fhirclient/models/structuredefinition.py +++ b/fhirclient/models/structuredefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/StructureDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/StructureDefinition). +# 2024, SMART Health IT. from . import domainresource @@ -48,7 +48,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.derivation = None """ specialization | constraint - How relates to base definition. @@ -142,7 +142,7 @@ def elementProperties(self): ("context", "context", StructureDefinitionContext, True, None, False), ("contextInvariant", "contextInvariant", str, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("derivation", "derivation", str, False, None, False), ("description", "description", str, False, None, False), ("differential", "differential", StructureDefinitionDifferential, False, None, False), diff --git a/fhirclient/models/structuremap.py b/fhirclient/models/structuremap.py index 7aacae93b..0685e31be 100644 --- a/fhirclient/models/structuremap.py +++ b/fhirclient/models/structuremap.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/StructureMap) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/StructureMap). +# 2024, SMART Health IT. from . import domainresource @@ -29,7 +29,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the structure map. @@ -99,7 +99,7 @@ def elementProperties(self): js.extend([ ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("experimental", "experimental", bool, False, None, False), ("group", "group", StructureMapGroup, True, None, True), @@ -402,7 +402,7 @@ def __init__(self, jsondict=None, strict=True): self.defaultValueDateTime = None """ Default value if no value exists. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.defaultValueDecimal = None """ Default value if no value exists. @@ -438,7 +438,7 @@ def __init__(self, jsondict=None, strict=True): self.defaultValueInstant = None """ Default value if no value exists. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.defaultValueInteger = None """ Default value if no value exists. @@ -506,7 +506,7 @@ def __init__(self, jsondict=None, strict=True): self.defaultValueTime = None """ Default value if no value exists. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.defaultValueTiming = None """ Default value if no value exists. @@ -588,7 +588,7 @@ def elementProperties(self): ("defaultValueCount", "defaultValueCount", count.Count, False, "defaultValue", False), ("defaultValueDataRequirement", "defaultValueDataRequirement", datarequirement.DataRequirement, False, "defaultValue", False), ("defaultValueDate", "defaultValueDate", fhirdate.FHIRDate, False, "defaultValue", False), - ("defaultValueDateTime", "defaultValueDateTime", fhirdate.FHIRDate, False, "defaultValue", False), + ("defaultValueDateTime", "defaultValueDateTime", fhirdate.FHIRDateTime, False, "defaultValue", False), ("defaultValueDecimal", "defaultValueDecimal", float, False, "defaultValue", False), ("defaultValueDistance", "defaultValueDistance", distance.Distance, False, "defaultValue", False), ("defaultValueDosage", "defaultValueDosage", dosage.Dosage, False, "defaultValue", False), @@ -597,7 +597,7 @@ def elementProperties(self): ("defaultValueHumanName", "defaultValueHumanName", humanname.HumanName, False, "defaultValue", False), ("defaultValueId", "defaultValueId", str, False, "defaultValue", False), ("defaultValueIdentifier", "defaultValueIdentifier", identifier.Identifier, False, "defaultValue", False), - ("defaultValueInstant", "defaultValueInstant", fhirdate.FHIRDate, False, "defaultValue", False), + ("defaultValueInstant", "defaultValueInstant", fhirdate.FHIRInstant, False, "defaultValue", False), ("defaultValueInteger", "defaultValueInteger", int, False, "defaultValue", False), ("defaultValueMarkdown", "defaultValueMarkdown", str, False, "defaultValue", False), ("defaultValueMeta", "defaultValueMeta", meta.Meta, False, "defaultValue", False), @@ -614,7 +614,7 @@ def elementProperties(self): ("defaultValueSampledData", "defaultValueSampledData", sampleddata.SampledData, False, "defaultValue", False), ("defaultValueSignature", "defaultValueSignature", signature.Signature, False, "defaultValue", False), ("defaultValueString", "defaultValueString", str, False, "defaultValue", False), - ("defaultValueTime", "defaultValueTime", fhirdate.FHIRDate, False, "defaultValue", False), + ("defaultValueTime", "defaultValueTime", fhirdate.FHIRTime, False, "defaultValue", False), ("defaultValueTiming", "defaultValueTiming", timing.Timing, False, "defaultValue", False), ("defaultValueTriggerDefinition", "defaultValueTriggerDefinition", triggerdefinition.TriggerDefinition, False, "defaultValue", False), ("defaultValueUnsignedInt", "defaultValueUnsignedInt", int, False, "defaultValue", False), @@ -806,6 +806,9 @@ def elementProperties(self): from . import duration from . import expression from . import fhirdate +from . import fhirdate +from . import fhirdate +from . import fhirdate from . import fhirreference from . import humanname from . import identifier diff --git a/fhirclient/models/subscription.py b/fhirclient/models/subscription.py index e11865065..d7da9908d 100644 --- a/fhirclient/models/subscription.py +++ b/fhirclient/models/subscription.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Subscription) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Subscription). +# 2024, SMART Health IT. from . import domainresource @@ -38,7 +38,7 @@ def __init__(self, jsondict=None, strict=True): self.end = None """ When to automatically delete the subscription. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.error = None """ Latest error note. @@ -60,7 +60,7 @@ def elementProperties(self): ("channel", "channel", SubscriptionChannel, False, None, True), ("contact", "contact", contactpoint.ContactPoint, True, None, False), ("criteria", "criteria", str, False, None, True), - ("end", "end", fhirdate.FHIRDate, False, None, False), + ("end", "end", fhirdate.FHIRInstant, False, None, False), ("error", "error", str, False, None, False), ("reason", "reason", str, False, None, True), ("status", "status", str, False, None, True), diff --git a/fhirclient/models/substance.py b/fhirclient/models/substance.py index 57e911b48..c7950b8e0 100644 --- a/fhirclient/models/substance.py +++ b/fhirclient/models/substance.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Substance) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Substance). +# 2024, SMART Health IT. from . import domainresource @@ -123,7 +123,7 @@ def __init__(self, jsondict=None, strict=True): self.expiry = None """ When no longer valid to use. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.identifier = None """ Identifier of the package/container. @@ -138,7 +138,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(SubstanceInstance, self).elementProperties() js.extend([ - ("expiry", "expiry", fhirdate.FHIRDate, False, None, False), + ("expiry", "expiry", fhirdate.FHIRDateTime, False, None, False), ("identifier", "identifier", identifier.Identifier, False, None, False), ("quantity", "quantity", quantity.Quantity, False, None, False), ]) diff --git a/fhirclient/models/substanceamount.py b/fhirclient/models/substanceamount.py index 84f6702d7..be47f26b2 100644 --- a/fhirclient/models/substanceamount.py +++ b/fhirclient/models/substanceamount.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceAmount) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceAmount). +# 2024, SMART Health IT. from . import backboneelement diff --git a/fhirclient/models/substancenucleicacid.py b/fhirclient/models/substancenucleicacid.py index 3fba20ea4..1dde5920b 100644 --- a/fhirclient/models/substancenucleicacid.py +++ b/fhirclient/models/substancenucleicacid.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceNucleicAcid) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceNucleicAcid). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/substancepolymer.py b/fhirclient/models/substancepolymer.py index 97fe03b68..9707bf3a0 100644 --- a/fhirclient/models/substancepolymer.py +++ b/fhirclient/models/substancepolymer.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstancePolymer) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstancePolymer). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/substanceprotein.py b/fhirclient/models/substanceprotein.py index 18113563c..90c4bc8d8 100644 --- a/fhirclient/models/substanceprotein.py +++ b/fhirclient/models/substanceprotein.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceProtein) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceProtein). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/substancereferenceinformation.py b/fhirclient/models/substancereferenceinformation.py index d995be27a..abd3c7fda 100644 --- a/fhirclient/models/substancereferenceinformation.py +++ b/fhirclient/models/substancereferenceinformation.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceReferenceInformation) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceReferenceInformation). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/substancesourcematerial.py b/fhirclient/models/substancesourcematerial.py index dff6b5872..79d936da7 100644 --- a/fhirclient/models/substancesourcematerial.py +++ b/fhirclient/models/substancesourcematerial.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceSourceMaterial) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceSourceMaterial). +# 2024, SMART Health IT. from . import domainresource diff --git a/fhirclient/models/substancespecification.py b/fhirclient/models/substancespecification.py index aa2c9f48e..ec9ad7e6f 100644 --- a/fhirclient/models/substancespecification.py +++ b/fhirclient/models/substancespecification.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceSpecification) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SubstanceSpecification). +# 2024, SMART Health IT. from . import domainresource @@ -290,7 +290,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date of official name change. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.status = None """ The status of the official name. @@ -302,7 +302,7 @@ def elementProperties(self): js = super(SubstanceSpecificationNameOfficial, self).elementProperties() js.extend([ ("authority", "authority", codeableconcept.CodeableConcept, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("status", "status", codeableconcept.CodeableConcept, False, None, False), ]) return js @@ -692,7 +692,7 @@ def __init__(self, jsondict=None, strict=True): self.statusDate = None """ The date at which the code status is changed as part of the terminology maintenance. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ super(SubstanceSpecificationstr, self).__init__(jsondict=jsondict, strict=strict) @@ -703,7 +703,7 @@ def elementProperties(self): ("comment", "comment", str, False, None, False), ("source", "source", fhirreference.FHIRReference, True, None, False), ("status", "status", codeableconcept.CodeableConcept, False, None, False), - ("statusDate", "statusDate", fhirdate.FHIRDate, False, None, False), + ("statusDate", "statusDate", fhirdate.FHIRDateTime, False, None, False), ]) return js diff --git a/fhirclient/models/supplydelivery.py b/fhirclient/models/supplydelivery.py index f55d8ac5c..294baf8bb 100644 --- a/fhirclient/models/supplydelivery.py +++ b/fhirclient/models/supplydelivery.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SupplyDelivery) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SupplyDelivery). +# 2024, SMART Health IT. from . import domainresource @@ -34,7 +34,7 @@ def __init__(self, jsondict=None, strict=True): self.occurrenceDateTime = None """ When event occurred. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.occurrencePeriod = None """ When event occurred. @@ -80,7 +80,7 @@ def elementProperties(self): ("basedOn", "basedOn", fhirreference.FHIRReference, True, None, False), ("destination", "destination", fhirreference.FHIRReference, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), - ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDate, False, "occurrence", False), + ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDateTime, False, "occurrence", False), ("occurrencePeriod", "occurrencePeriod", period.Period, False, "occurrence", False), ("occurrenceTiming", "occurrenceTiming", timing.Timing, False, "occurrence", False), ("partOf", "partOf", fhirreference.FHIRReference, True, None, False), diff --git a/fhirclient/models/supplyrequest.py b/fhirclient/models/supplyrequest.py index 60ae511d0..e90375ad2 100644 --- a/fhirclient/models/supplyrequest.py +++ b/fhirclient/models/supplyrequest.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SupplyRequest) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/SupplyRequest). +# 2024, SMART Health IT. from . import domainresource @@ -23,7 +23,7 @@ def __init__(self, jsondict=None, strict=True): self.authoredOn = None """ When the request was made. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.category = None """ The kind of supply (central, non-stock, etc.). @@ -51,7 +51,7 @@ def __init__(self, jsondict=None, strict=True): self.occurrenceDateTime = None """ When the request should be fulfilled. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.occurrencePeriod = None """ When the request should be fulfilled. @@ -98,14 +98,14 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(SupplyRequest, self).elementProperties() js.extend([ - ("authoredOn", "authoredOn", fhirdate.FHIRDate, False, None, False), + ("authoredOn", "authoredOn", fhirdate.FHIRDateTime, False, None, False), ("category", "category", codeableconcept.CodeableConcept, False, None, False), ("deliverFrom", "deliverFrom", fhirreference.FHIRReference, False, None, False), ("deliverTo", "deliverTo", fhirreference.FHIRReference, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("itemCodeableConcept", "itemCodeableConcept", codeableconcept.CodeableConcept, False, "item", True), ("itemReference", "itemReference", fhirreference.FHIRReference, False, "item", True), - ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDate, False, "occurrence", False), + ("occurrenceDateTime", "occurrenceDateTime", fhirdate.FHIRDateTime, False, "occurrence", False), ("occurrencePeriod", "occurrencePeriod", period.Period, False, "occurrence", False), ("occurrenceTiming", "occurrenceTiming", timing.Timing, False, "occurrence", False), ("parameter", "parameter", SupplyRequestParameter, True, None, False), diff --git a/fhirclient/models/task.py b/fhirclient/models/task.py index 423bb751e..8fd7f0d9a 100644 --- a/fhirclient/models/task.py +++ b/fhirclient/models/task.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Task) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Task). +# 2024, SMART Health IT. from . import domainresource @@ -20,7 +20,7 @@ def __init__(self, jsondict=None, strict=True): self.authoredOn = None """ Task Creation Date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.basedOn = None """ Request fulfilled by this task. @@ -85,7 +85,7 @@ def __init__(self, jsondict=None, strict=True): self.lastModified = None """ Task Last Modified Date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.location = None """ Where task occurs. @@ -148,7 +148,7 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(Task, self).elementProperties() js.extend([ - ("authoredOn", "authoredOn", fhirdate.FHIRDate, False, None, False), + ("authoredOn", "authoredOn", fhirdate.FHIRDateTime, False, None, False), ("basedOn", "basedOn", fhirreference.FHIRReference, True, None, False), ("businessStatus", "businessStatus", codeableconcept.CodeableConcept, False, None, False), ("code", "code", codeableconcept.CodeableConcept, False, None, False), @@ -164,7 +164,7 @@ def elementProperties(self): ("instantiatesUri", "instantiatesUri", str, False, None, False), ("insurance", "insurance", fhirreference.FHIRReference, True, None, False), ("intent", "intent", str, False, None, True), - ("lastModified", "lastModified", fhirdate.FHIRDate, False, None, False), + ("lastModified", "lastModified", fhirdate.FHIRDateTime, False, None, False), ("location", "location", fhirreference.FHIRReference, False, None, False), ("note", "note", annotation.Annotation, True, None, False), ("output", "output", TaskOutput, True, None, False), @@ -271,7 +271,7 @@ def __init__(self, jsondict=None, strict=True): self.valueDateTime = None """ Content to use in performing the task. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.valueDecimal = None """ Content to use in performing the task. @@ -307,7 +307,7 @@ def __init__(self, jsondict=None, strict=True): self.valueInstant = None """ Content to use in performing the task. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.valueInteger = None """ Content to use in performing the task. @@ -375,7 +375,7 @@ def __init__(self, jsondict=None, strict=True): self.valueTime = None """ Content to use in performing the task. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.valueTiming = None """ Content to use in performing the task. @@ -427,7 +427,7 @@ def elementProperties(self): ("valueCount", "valueCount", count.Count, False, "value", True), ("valueDataRequirement", "valueDataRequirement", datarequirement.DataRequirement, False, "value", True), ("valueDate", "valueDate", fhirdate.FHIRDate, False, "value", True), - ("valueDateTime", "valueDateTime", fhirdate.FHIRDate, False, "value", True), + ("valueDateTime", "valueDateTime", fhirdate.FHIRDateTime, False, "value", True), ("valueDecimal", "valueDecimal", float, False, "value", True), ("valueDistance", "valueDistance", distance.Distance, False, "value", True), ("valueDosage", "valueDosage", dosage.Dosage, False, "value", True), @@ -436,7 +436,7 @@ def elementProperties(self): ("valueHumanName", "valueHumanName", humanname.HumanName, False, "value", True), ("valueId", "valueId", str, False, "value", True), ("valueIdentifier", "valueIdentifier", identifier.Identifier, False, "value", True), - ("valueInstant", "valueInstant", fhirdate.FHIRDate, False, "value", True), + ("valueInstant", "valueInstant", fhirdate.FHIRInstant, False, "value", True), ("valueInteger", "valueInteger", int, False, "value", True), ("valueMarkdown", "valueMarkdown", str, False, "value", True), ("valueMeta", "valueMeta", meta.Meta, False, "value", True), @@ -453,7 +453,7 @@ def elementProperties(self): ("valueSampledData", "valueSampledData", sampleddata.SampledData, False, "value", True), ("valueSignature", "valueSignature", signature.Signature, False, "value", True), ("valueString", "valueString", str, False, "value", True), - ("valueTime", "valueTime", fhirdate.FHIRDate, False, "value", True), + ("valueTime", "valueTime", fhirdate.FHIRTime, False, "value", True), ("valueTiming", "valueTiming", timing.Timing, False, "value", True), ("valueTriggerDefinition", "valueTriggerDefinition", triggerdefinition.TriggerDefinition, False, "value", True), ("valueUnsignedInt", "valueUnsignedInt", int, False, "value", True), @@ -551,7 +551,7 @@ def __init__(self, jsondict=None, strict=True): self.valueDateTime = None """ Result of output. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.valueDecimal = None """ Result of output. @@ -587,7 +587,7 @@ def __init__(self, jsondict=None, strict=True): self.valueInstant = None """ Result of output. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRInstant` (represented as `str` in JSON). """ self.valueInteger = None """ Result of output. @@ -655,7 +655,7 @@ def __init__(self, jsondict=None, strict=True): self.valueTime = None """ Result of output. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRTime` (represented as `str` in JSON). """ self.valueTiming = None """ Result of output. @@ -707,7 +707,7 @@ def elementProperties(self): ("valueCount", "valueCount", count.Count, False, "value", True), ("valueDataRequirement", "valueDataRequirement", datarequirement.DataRequirement, False, "value", True), ("valueDate", "valueDate", fhirdate.FHIRDate, False, "value", True), - ("valueDateTime", "valueDateTime", fhirdate.FHIRDate, False, "value", True), + ("valueDateTime", "valueDateTime", fhirdate.FHIRDateTime, False, "value", True), ("valueDecimal", "valueDecimal", float, False, "value", True), ("valueDistance", "valueDistance", distance.Distance, False, "value", True), ("valueDosage", "valueDosage", dosage.Dosage, False, "value", True), @@ -716,7 +716,7 @@ def elementProperties(self): ("valueHumanName", "valueHumanName", humanname.HumanName, False, "value", True), ("valueId", "valueId", str, False, "value", True), ("valueIdentifier", "valueIdentifier", identifier.Identifier, False, "value", True), - ("valueInstant", "valueInstant", fhirdate.FHIRDate, False, "value", True), + ("valueInstant", "valueInstant", fhirdate.FHIRInstant, False, "value", True), ("valueInteger", "valueInteger", int, False, "value", True), ("valueMarkdown", "valueMarkdown", str, False, "value", True), ("valueMeta", "valueMeta", meta.Meta, False, "value", True), @@ -733,7 +733,7 @@ def elementProperties(self): ("valueSampledData", "valueSampledData", sampleddata.SampledData, False, "value", True), ("valueSignature", "valueSignature", signature.Signature, False, "value", True), ("valueString", "valueString", str, False, "value", True), - ("valueTime", "valueTime", fhirdate.FHIRDate, False, "value", True), + ("valueTime", "valueTime", fhirdate.FHIRTime, False, "value", True), ("valueTiming", "valueTiming", timing.Timing, False, "value", True), ("valueTriggerDefinition", "valueTriggerDefinition", triggerdefinition.TriggerDefinition, False, "value", True), ("valueUnsignedInt", "valueUnsignedInt", int, False, "value", True), @@ -803,6 +803,9 @@ def elementProperties(self): from . import duration from . import expression from . import fhirdate +from . import fhirdate +from . import fhirdate +from . import fhirdate from . import fhirreference from . import humanname from . import identifier diff --git a/fhirclient/models/terminologycapabilities.py b/fhirclient/models/terminologycapabilities.py index dfd8a61fc..6923623ca 100644 --- a/fhirclient/models/terminologycapabilities.py +++ b/fhirclient/models/terminologycapabilities.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/TerminologyCapabilities). +# 2024, SMART Health IT. from . import domainresource @@ -46,7 +46,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the terminology capabilities. @@ -134,7 +134,7 @@ def elementProperties(self): ("codeSystem", "codeSystem", TerminologyCapabilitiesCodeSystem, True, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, True), + ("date", "date", fhirdate.FHIRDateTime, False, None, True), ("description", "description", str, False, None, False), ("expansion", "expansion", TerminologyCapabilitiesExpansion, False, None, False), ("experimental", "experimental", bool, False, None, False), diff --git a/fhirclient/models/testreport.py b/fhirclient/models/testreport.py index bda471ea4..88ae9eebc 100644 --- a/fhirclient/models/testreport.py +++ b/fhirclient/models/testreport.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/TestReport) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/TestReport). +# 2024, SMART Health IT. from . import domainresource @@ -26,7 +26,7 @@ def __init__(self, jsondict=None, strict=True): self.issued = None """ When the TestScript was executed and this TestReport was generated. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.name = None """ Informal name of the executed TestScript. @@ -79,7 +79,7 @@ def elementProperties(self): js = super(TestReport, self).elementProperties() js.extend([ ("identifier", "identifier", identifier.Identifier, False, None, False), - ("issued", "issued", fhirdate.FHIRDate, False, None, False), + ("issued", "issued", fhirdate.FHIRDateTime, False, None, False), ("name", "name", str, False, None, False), ("participant", "participant", TestReportParticipant, True, None, False), ("result", "result", str, False, None, True), diff --git a/fhirclient/models/testscript.py b/fhirclient/models/testscript.py index c5a5fdb33..ab16c2cfa 100644 --- a/fhirclient/models/testscript.py +++ b/fhirclient/models/testscript.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/TestScript) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/TestScript). +# 2024, SMART Health IT. from . import domainresource @@ -31,7 +31,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the test script. @@ -128,7 +128,7 @@ def elementProperties(self): js.extend([ ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("destination", "destination", TestScriptDestination, True, None, False), ("experimental", "experimental", bool, False, None, False), diff --git a/fhirclient/models/timing.py b/fhirclient/models/timing.py index cd81c0ac1..af9548412 100644 --- a/fhirclient/models/timing.py +++ b/fhirclient/models/timing.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Timing) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/Timing). +# 2024, SMART Health IT. from . import backboneelement @@ -30,7 +30,7 @@ def __init__(self, jsondict=None, strict=True): self.event = None """ When the event occurs. - List of `FHIRDate` items (represented as `str` in JSON). """ + List of `FHIRDateTime` items (represented as `str` in JSON). """ self.repeat = None """ When the event is to occur. @@ -42,7 +42,7 @@ def elementProperties(self): js = super(Timing, self).elementProperties() js.extend([ ("code", "code", codeableconcept.CodeableConcept, False, None, False), - ("event", "event", fhirdate.FHIRDate, True, None, False), + ("event", "event", fhirdate.FHIRDateTime, True, None, False), ("repeat", "repeat", TimingRepeat, False, None, False), ]) return js @@ -128,7 +128,7 @@ def __init__(self, jsondict=None, strict=True): self.timeOfDay = None """ Time of day for action. - List of `FHIRDate` items (represented as `str` in JSON). """ + List of `FHIRTime` items (represented as `str` in JSON). """ self.when = None """ Code for time period of occurrence. @@ -154,7 +154,7 @@ def elementProperties(self): ("period", "period", float, False, None, False), ("periodMax", "periodMax", float, False, None, False), ("periodUnit", "periodUnit", str, False, None, False), - ("timeOfDay", "timeOfDay", fhirdate.FHIRDate, True, None, False), + ("timeOfDay", "timeOfDay", fhirdate.FHIRTime, True, None, False), ("when", "when", str, True, None, False), ]) return js @@ -163,5 +163,6 @@ def elementProperties(self): from . import codeableconcept from . import duration from . import fhirdate +from . import fhirdate from . import period from . import range diff --git a/fhirclient/models/triggerdefinition.py b/fhirclient/models/triggerdefinition.py index 937b9b47d..79d46fbae 100644 --- a/fhirclient/models/triggerdefinition.py +++ b/fhirclient/models/triggerdefinition.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/TriggerDefinition) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/TriggerDefinition). +# 2024, SMART Health IT. from . import element @@ -39,7 +39,7 @@ def __init__(self, jsondict=None, strict=True): self.timingDateTime = None """ Timing of the event. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.timingReference = None """ Timing of the event. @@ -63,7 +63,7 @@ def elementProperties(self): ("data", "data", datarequirement.DataRequirement, True, None, False), ("name", "name", str, False, None, False), ("timingDate", "timingDate", fhirdate.FHIRDate, False, "timing", False), - ("timingDateTime", "timingDateTime", fhirdate.FHIRDate, False, "timing", False), + ("timingDateTime", "timingDateTime", fhirdate.FHIRDateTime, False, "timing", False), ("timingReference", "timingReference", fhirreference.FHIRReference, False, "timing", False), ("timingTiming", "timingTiming", timing.Timing, False, "timing", False), ("type", "type", str, False, None, True), @@ -74,5 +74,6 @@ def elementProperties(self): from . import datarequirement from . import expression from . import fhirdate +from . import fhirdate from . import fhirreference from . import timing diff --git a/fhirclient/models/usagecontext.py b/fhirclient/models/usagecontext.py index 9df107cb1..29343f4ad 100644 --- a/fhirclient/models/usagecontext.py +++ b/fhirclient/models/usagecontext.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/UsageContext) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/UsageContext). +# 2024, SMART Health IT. from . import element diff --git a/fhirclient/models/valueset.py b/fhirclient/models/valueset.py index 297930ebd..6d3d659a7 100644 --- a/fhirclient/models/valueset.py +++ b/fhirclient/models/valueset.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ValueSet) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/ValueSet). +# 2024, SMART Health IT. from . import domainresource @@ -37,7 +37,7 @@ def __init__(self, jsondict=None, strict=True): self.date = None """ Date last changed. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.description = None """ Natural language description of the value set. @@ -105,7 +105,7 @@ def elementProperties(self): ("compose", "compose", ValueSetCompose, False, None, False), ("contact", "contact", contactdetail.ContactDetail, True, None, False), ("copyright", "copyright", str, False, None, False), - ("date", "date", fhirdate.FHIRDate, False, None, False), + ("date", "date", fhirdate.FHIRDateTime, False, None, False), ("description", "description", str, False, None, False), ("expansion", "expansion", ValueSetExpansion, False, None, False), ("experimental", "experimental", bool, False, None, False), @@ -383,7 +383,7 @@ def __init__(self, jsondict=None, strict=True): self.timestamp = None """ Time ValueSet expansion happened. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.total = None """ Total number of codes in the expansion. @@ -398,7 +398,7 @@ def elementProperties(self): ("identifier", "identifier", str, False, None, False), ("offset", "offset", int, False, None, False), ("parameter", "parameter", ValueSetExpansionParameter, True, None, False), - ("timestamp", "timestamp", fhirdate.FHIRDate, False, None, True), + ("timestamp", "timestamp", fhirdate.FHIRDateTime, False, None, True), ("total", "total", int, False, None, False), ]) return js @@ -501,7 +501,7 @@ def __init__(self, jsondict=None, strict=True): self.valueDateTime = None """ Value of the named parameter. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.valueDecimal = None """ Value of the named parameter. @@ -527,7 +527,7 @@ def elementProperties(self): ("name", "name", str, False, None, True), ("valueBoolean", "valueBoolean", bool, False, "value", False), ("valueCode", "valueCode", str, False, "value", False), - ("valueDateTime", "valueDateTime", fhirdate.FHIRDate, False, "value", False), + ("valueDateTime", "valueDateTime", fhirdate.FHIRDateTime, False, "value", False), ("valueDecimal", "valueDecimal", float, False, "value", False), ("valueInteger", "valueInteger", int, False, "value", False), ("valueString", "valueString", str, False, "value", False), @@ -540,5 +540,6 @@ def elementProperties(self): from . import coding from . import contactdetail from . import fhirdate +from . import fhirdate from . import identifier from . import usagecontext diff --git a/fhirclient/models/verificationresult.py b/fhirclient/models/verificationresult.py index e735dbec9..b7f227561 100644 --- a/fhirclient/models/verificationresult.py +++ b/fhirclient/models/verificationresult.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/VerificationResult) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/VerificationResult). +# 2024, SMART Health IT. from . import domainresource @@ -34,7 +34,7 @@ def __init__(self, jsondict=None, strict=True): self.lastPerformed = None """ The date/time validation was last completed (including failed validations). - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.need = None """ none | initial | periodic. @@ -55,7 +55,7 @@ def __init__(self, jsondict=None, strict=True): self.statusDate = None """ When the validation status was updated. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.target = None """ A resource that was validated. @@ -87,12 +87,12 @@ def elementProperties(self): ("attestation", "attestation", VerificationResultAttestation, False, None, False), ("failureAction", "failureAction", codeableconcept.CodeableConcept, False, None, False), ("frequency", "frequency", timing.Timing, False, None, False), - ("lastPerformed", "lastPerformed", fhirdate.FHIRDate, False, None, False), + ("lastPerformed", "lastPerformed", fhirdate.FHIRDateTime, False, None, False), ("need", "need", codeableconcept.CodeableConcept, False, None, False), ("nextScheduled", "nextScheduled", fhirdate.FHIRDate, False, None, False), ("primarySource", "primarySource", VerificationResultPrimarySource, True, None, False), ("status", "status", str, False, None, True), - ("statusDate", "statusDate", fhirdate.FHIRDate, False, None, False), + ("statusDate", "statusDate", fhirdate.FHIRDateTime, False, None, False), ("target", "target", fhirreference.FHIRReference, True, None, False), ("targetLocation", "targetLocation", str, True, None, False), ("validationProcess", "validationProcess", codeableconcept.CodeableConcept, True, None, False), @@ -205,7 +205,7 @@ def __init__(self, jsondict=None, strict=True): self.validationDate = None """ When the target was validated against the primary source. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.validationStatus = None """ successful | failed | unknown. @@ -224,7 +224,7 @@ def elementProperties(self): ("communicationMethod", "communicationMethod", codeableconcept.CodeableConcept, True, None, False), ("pushTypeAvailable", "pushTypeAvailable", codeableconcept.CodeableConcept, True, None, False), ("type", "type", codeableconcept.CodeableConcept, True, None, False), - ("validationDate", "validationDate", fhirdate.FHIRDate, False, None, False), + ("validationDate", "validationDate", fhirdate.FHIRDateTime, False, None, False), ("validationStatus", "validationStatus", codeableconcept.CodeableConcept, False, None, False), ("who", "who", fhirreference.FHIRReference, False, None, False), ]) @@ -271,6 +271,7 @@ def elementProperties(self): from . import codeableconcept from . import fhirdate +from . import fhirdate from . import fhirreference from . import signature from . import timing diff --git a/fhirclient/models/visionprescription.py b/fhirclient/models/visionprescription.py index 64fd78ea7..1a385f8b8 100644 --- a/fhirclient/models/visionprescription.py +++ b/fhirclient/models/visionprescription.py @@ -1,5 +1,5 @@ -# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/VisionPrescription) on 2024-07-15. -# 2024, SMART Health IT. +# Generated from FHIR 4.0.1-9346c8cc45 (http://hl7.org/fhir/StructureDefinition/VisionPrescription). +# 2024, SMART Health IT. from . import domainresource @@ -23,11 +23,11 @@ def __init__(self, jsondict=None, strict=True): self.created = None """ Response creation date. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.dateWritten = None """ When prescription was authorized. - Type `FHIRDate` (represented as `str` in JSON). """ + Type `FHIRDateTime` (represented as `str` in JSON). """ self.encounter = None """ Created during encounter / admission / stay. @@ -58,8 +58,8 @@ def __init__(self, jsondict=None, strict=True): def elementProperties(self): js = super(VisionPrescription, self).elementProperties() js.extend([ - ("created", "created", fhirdate.FHIRDate, False, None, True), - ("dateWritten", "dateWritten", fhirdate.FHIRDate, False, None, True), + ("created", "created", fhirdate.FHIRDateTime, False, None, True), + ("dateWritten", "dateWritten", fhirdate.FHIRDateTime, False, None, True), ("encounter", "encounter", fhirreference.FHIRReference, False, None, False), ("identifier", "identifier", identifier.Identifier, True, None, False), ("lensSpecification", "lensSpecification", VisionPrescriptionLensSpecification, True, None, True), diff --git a/pyproject.toml b/pyproject.toml index 3120a541e..14aade095 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,6 @@ name = "fhirclient" requires-python = ">= 3.8" dependencies = [ - "isodate >= 0.5", "requests >= 2.4", ] authors = [{ name="SMART Platforms Team", email="support@smarthealthit.org" }] diff --git a/tests/fhirdate_test.py b/tests/fhirdate_test.py new file mode 100644 index 000000000..65ad3e31e --- /dev/null +++ b/tests/fhirdate_test.py @@ -0,0 +1,231 @@ +import datetime +import unittest + +from fhirclient.models.fhirabstractbase import FHIRValidationError +from fhirclient.models.fhirdate import FHIRDate, FHIRDateTime, FHIRInstant, FHIRTime +from fhirclient.models.patient import Patient +from fhirclient.models.observation import Observation +from fhirclient.models.timing import Timing + + +class TestFHIRDate(unittest.TestCase): + + def test_empty(self): + date = FHIRDate() + self.assertIsNone(date.date) + self.assertIsNone(date.isostring) + self.assertIsNone(date.as_json()) + + def test_class_hierarchy_backwards_compatibility(self): + """Confirm that code that calls issubclass(cls, FHIRDate) will still work in >=4.2.0""" + self.assertTrue(issubclass(FHIRDateTime, FHIRDate)) + self.assertTrue(issubclass(FHIRInstant, FHIRDate)) + self.assertTrue(issubclass(FHIRTime, FHIRDate)) + + def test_object_validation(self): + """Confirm that when constructing an invalid JSON class, we complain""" + with self.assertRaisesRegex(FHIRValidationError, "Expecting string when initializing"): + Timing({"event": [1923, "1924"]}) + with self.assertRaisesRegex(FHIRValidationError, "does not match expected format"): + Patient({"birthDate": "1923-10-11T12:34:56Z"}) + + def test_aliases(self): + """Confirm that we keep the backwards-compatible date alias""" + # DateTime + date = FHIRDateTime("2024-01-02") + self.assertIs(date.datetime, date.date) + date.date = datetime.datetime(1982, 12, 12) + self.assertEqual(date.datetime.isoformat(), "1982-12-12T00:00:00") + self.assertIs(date.datetime, date.date) + + # Instant + instant = FHIRInstant("2024-01-02T10:11:12Z") + self.assertIs(instant.datetime, instant.date) + instant.date = datetime.datetime(1982, 12, 12) + self.assertEqual(instant.datetime.isoformat(), "1982-12-12T00:00:00") + self.assertIs(instant.datetime, instant.date) + + # Time + time = FHIRTime("10:10:10") + self.assertIs(time.time, time.date) + time.time = datetime.time(12, 12, 12) + self.assertEqual(time.time.isoformat(), "12:12:12") + self.assertIs(time.time, time.date) + self.assertIsNone(time.origval) + + def test_with_json(self): + """Confirm we can make objects correctly""" + self.assertEqual(FHIRDate.with_json_and_owner("2024", None).isostring, "2024-01-01") + self.assertEqual(FHIRTime.with_json("10:12:14").isostring, "10:12:14") + self.assertEqual( + [x.isostring for x in FHIRTime.with_json(["10:12:14", "01:01:01"])], + ["10:12:14", "01:01:01"] + ) + with self.assertRaisesRegex(TypeError, "only takes string or list"): + FHIRDateTime.with_json(2024) + + def test_date(self): + """ + Verify we parse valid date values. + + From http://hl7.org/fhir/datatypes.html#date: + - The format is YYYY, YYYY-MM, or YYYY-MM-DD, e.g. 2018, 1973-06, or 1905-08-23. + - There SHALL be no timezone offset + """ + # Various happy path strings + self.assertEqual(FHIRDate("0001").isostring, "0001-01-01") + self.assertEqual(FHIRDate("2018").isostring, "2018-01-01") + self.assertEqual(FHIRDate("1973-06").isostring, "1973-06-01") + self.assertEqual(FHIRDate("1905-08-23").isostring, "1905-08-23") + + # Check that we also correctly provide the date property + date = FHIRDate("1982").date # datetime.date + self.assertIsInstance(date, datetime.date) + self.assertEqual(date.isoformat(), "1982-01-01") + + # Check that we give back the original input when converting back to as_json() + self.assertEqual(FHIRDate("1982").as_json(), "1982") + + # Confirm we're used in actual objects + p = Patient({"birthDate": "1923-10-11"}) + self.assertIsInstance(p.birthDate, FHIRDate) + self.assertEqual(p.birthDate.isostring, "1923-10-11") + + # Now test a bunch of invalid strings + self.assertRaises(ValueError, FHIRDate, "82") + self.assertRaises(ValueError, FHIRDate, "82/07/23") + self.assertRaises(ValueError, FHIRDate, "07-23-1982") + self.assertRaises(ValueError, FHIRDate, "13:28:17") + self.assertRaises(ValueError, FHIRDate, "2015-02-07T13:28:17-05:00") + + def test_datetime(self): + """ + Verify we parse valid datetime values. + + From http://hl7.org/fhir/datatypes.html#datetime: + - The format is YYYY, YYYY-MM, YYYY-MM-DD or YYYY-MM-DDThh:mm:ss+zz:zz + - e.g. 2018, 1973-06, 1905-08-23, 2015-02-07T13:28:17-05:00 or 2017-01-01T00:00:00.000Z + - If hours and minutes are specified, a timezone offset SHALL be populated + - Seconds must be provided due to schema type constraints + but may be zero-filled and may be ignored at receiver discretion. + - Milliseconds are optionally allowed (the spec's regex actually allows arbitrary + sub-second precision) + """ + # Various happy path strings + self.assertEqual(FHIRDateTime("2018").isostring, "2018-01-01T00:00:00") + self.assertEqual(FHIRDateTime("1973-06").isostring, "1973-06-01T00:00:00") + self.assertEqual(FHIRDateTime("1905-08-23").isostring, "1905-08-23T00:00:00") + self.assertEqual( + FHIRDateTime("2015-02-07T13:28:17-05:00").isostring, "2015-02-07T13:28:17-05:00" + ) + self.assertEqual( + FHIRDateTime("2017-01-01T00:00:00.123456Z").isostring, + "2017-01-01T00:00:00.123456+00:00" + ) + self.assertEqual( # leap second + FHIRDateTime("2015-02-07T13:28:60Z").isostring, "2015-02-07T13:28:59+00:00" + ) + + # Check that we also correctly provide the date property + self.assertIsInstance(FHIRDateTime("2015").date, datetime.datetime) + self.assertIsInstance(FHIRDateTime("2015-02-07").date, datetime.datetime) + self.assertIsInstance(FHIRDateTime("2015-02-07T13:28:17Z").date, datetime.datetime) + + # Check that we give back the original input when converting back to as_json() + self.assertEqual(FHIRDateTime("1982").as_json(), "1982") + + # Confirm we're used in actual objects + p = Patient({"deceasedDateTime": "1923-10-11"}) + self.assertIsInstance(p.deceasedDateTime, FHIRDateTime) + self.assertEqual(p.deceasedDateTime.isostring, "1923-10-11T00:00:00") + + # Now test a bunch of invalid strings + self.assertRaises(ValueError, FHIRDateTime, "82") + self.assertRaises(ValueError, FHIRDateTime, "82/07/23") + self.assertRaises(ValueError, FHIRDateTime, "07-23-1982") + self.assertRaises(ValueError, FHIRDateTime, "13:28:17") + self.assertRaises(ValueError, FHIRDateTime, "2015-02-07T13:28") # no seconds + self.assertRaises(ValueError, FHIRDateTime, "2015-02-07T13:28:17") # no timezone + + def test_instant(self): + """ + Verify we parse valid instant values. + + From http://hl7.org/fhir/datatypes.html#instant: + - The format is YYYY-MM-DDThh:mm:ss.sss+zz:zz + - e.g. 2015-02-07T13:28:17.239+02:00 or 2017-01-01T00:00:00Z + - The time SHALL be specified at least to the second and SHALL include a time zone. + """ + # Various happy path strings + self.assertEqual( + FHIRInstant("2015-02-07T13:28:17-05:00").isostring, "2015-02-07T13:28:17-05:00" + ) + self.assertEqual( + FHIRInstant("2017-01-01T00:00:00.123456Z").isostring, + "2017-01-01T00:00:00.123456+00:00" + ) + self.assertEqual( # leap second + FHIRInstant("2017-01-01T00:00:60Z").isostring, "2017-01-01T00:00:59+00:00" + ) + + # Check that we also correctly provide the date property + self.assertIsInstance(FHIRInstant("2015-02-07T13:28:17Z").date, datetime.datetime) + + # Check that we give back the original input when converting back to as_json() + self.assertEqual( + FHIRInstant("2017-01-01T00:00:00Z").as_json(), + "2017-01-01T00:00:00Z" # Z instead of +00.00 + ) + + # Confirm we're used in actual objects + obs = Observation({ + "issued": "2017-01-01T00:00:00.123Z", + "status": "X", + "code": {"text": "X"}}, + ) + self.assertIsInstance(obs.issued, FHIRInstant) + self.assertEqual(obs.issued.isostring, "2017-01-01T00:00:00.123000+00:00") + + # Now test a bunch of invalid strings + self.assertRaises(ValueError, FHIRInstant, "82") + self.assertRaises(ValueError, FHIRInstant, "82/07/23") + self.assertRaises(ValueError, FHIRInstant, "07-23-1982") + self.assertRaises(ValueError, FHIRInstant, "13:28:17") + self.assertRaises(ValueError, FHIRInstant, "2015") + self.assertRaises(ValueError, FHIRInstant, "2015-02-07") + self.assertRaises(ValueError, FHIRInstant, "2015-02-07T13:28") # no seconds + self.assertRaises(ValueError, FHIRInstant, "2015-02-07T13:28:17") # no timezone + + def test_time(self): + """ + Verify we parse valid time values. + + From http://hl7.org/fhir/datatypes.html#time: + - The format is hh:mm:ss + - A timezone offset SHALL NOT be present + - Uses 24-hour time + - Sub-seconds allowed (to arbitrary precision, per the regex...) + """ + # Various happy path strings + self.assertEqual(FHIRTime("13:28:17").isostring, "13:28:17") + self.assertEqual(FHIRTime("13:28:17.123456").isostring, "13:28:17.123456") + self.assertEqual(FHIRTime("00:00:60").isostring, "00:00:59") # leap second + + # Check that we also correctly provide the date property (though it's a misnomer) + self.assertIsInstance(FHIRTime("13:28:17").date, datetime.time) + + # Check that we give back the original input when converting back to as_json() + self.assertEqual(FHIRTime("00:00:00").as_json(), "00:00:00") + + # Confirm we're used in actual objects + obs = Observation({"valueTime": "14:49:32", "status": "X", "code": {"text": "X"}}) + self.assertIsInstance(obs.valueTime, FHIRTime) + self.assertEqual(obs.valueTime.isostring, "14:49:32") + + # Now test a bunch of invalid strings + self.assertRaises(ValueError, FHIRTime, "82") + self.assertRaises(ValueError, FHIRTime, "82/07/23") + self.assertRaises(ValueError, FHIRTime, "07-23-1982") + self.assertRaises(ValueError, FHIRTime, "2015") + self.assertRaises(ValueError, FHIRTime, "2015-02-07T13:28:17Z") + self.assertRaises(ValueError, FHIRTime, "10:12") diff --git a/tests/models/account_test.py b/tests/models/account_test.py index 1c8355f7c..96a39bca8 100644 --- a/tests/models/account_test.py +++ b/tests/models/account_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import account -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, account class AccountTests(unittest.TestCase): @@ -31,7 +30,7 @@ def implAccount1(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -40,9 +39,9 @@ def implAccount1(self, inst): 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.servicePeriod.end.date, FHIRDate("2016-06-30").date) + self.assertEqual(inst.servicePeriod.end.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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
") @@ -72,9 +71,9 @@ def implAccount2(self, inst): 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.servicePeriod.end.date, FHIRDate("2016-06-30").date) + self.assertEqual(inst.servicePeriod.end.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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
") diff --git a/tests/models/activitydefinition_test.py b/tests/models/activitydefinition_test.py index f9bf5a9cc..4446d5e86 100644 --- a/tests/models/activitydefinition_test.py +++ b/tests/models/activitydefinition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import activitydefinition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, activitydefinition class ActivityDefinitionTests(unittest.TestCase): @@ -52,7 +51,7 @@ def testActivityDefinition2(self): self.implActivityDefinition2(inst2) def implActivityDefinition2(self, inst): - self.assertEqual(inst.approvalDate.date, FHIRDate("2016-03-12").date) + self.assertEqual(inst.approvalDate.date, fhirdate.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") @@ -71,12 +70,12 @@ def implActivityDefinition2(self, inst): self.assertEqual(inst.contact[0].telecom[1].use, "work") self.assertEqual(inst.contact[0].telecom[1].value, "info@motivemi.com") self.assertEqual(inst.copyright, "© Copyright 2016 Motive Medical Intelligence. All rights reserved.") - self.assertEqual(inst.date.date, FHIRDate("2017-03-03T14:06:00Z").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2017-03-03T14:06:00Z").date) self.assertEqual(inst.date.as_json(), "2017-03-03T14:06:00Z") self.assertEqual(inst.description, "refer to primary care mental-health integrated care program for evaluation and treatment of mental health conditions now") - self.assertEqual(inst.effectivePeriod.end.date, FHIRDate("2017-12-31").date) + self.assertEqual(inst.effectivePeriod.end.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("2016-01-01").date) self.assertEqual(inst.effectivePeriod.start.as_json(), "2016-01-01") self.assertTrue(inst.experimental) self.assertEqual(inst.id, "referralPrimaryCareMentalHealth-initial") @@ -86,7 +85,7 @@ def implActivityDefinition2(self, inst): 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.kind, "ServiceRequest") - self.assertEqual(inst.lastReviewDate.date, FHIRDate("2016-08-15").date) + self.assertEqual(inst.lastReviewDate.date, fhirdate.FHIRDate("2016-08-15").date) self.assertEqual(inst.lastReviewDate.as_json(), "2016-08-15") self.assertEqual(inst.name, "ReferralPrimaryCareMentalHealth") self.assertEqual(inst.participant[0].type, "practitioner") @@ -149,7 +148,7 @@ def testActivityDefinition3(self): self.implActivityDefinition3(inst2) def implActivityDefinition3(self, inst): - self.assertEqual(inst.approvalDate.date, FHIRDate("2016-03-12").date) + self.assertEqual(inst.approvalDate.date, fhirdate.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") @@ -167,7 +166,7 @@ def implActivityDefinition3(self, inst): self.assertEqual(inst.contained[0].id, "citalopramMedication") self.assertEqual(inst.contained[1].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.date, fhirdate.FHIRDateTime("2015-08-15").date) self.assertEqual(inst.date.as_json(), "2015-08-15") self.assertEqual(inst.description, "Citalopram 20 mg tablet 1 tablet oral 1 time daily now (30 table; 3 refills") self.assertEqual(inst.dosage[0].doseAndRate[0].doseQuantity.unit, "{tbl}") @@ -190,9 +189,9 @@ def implActivityDefinition3(self, inst): self.assertEqual(inst.dynamicValue[1].expression.expression, "30 '{tbl}'") self.assertEqual(inst.dynamicValue[1].expression.language, "text/cql") self.assertEqual(inst.dynamicValue[1].path, "dispenseRequest.quantity") - self.assertEqual(inst.effectivePeriod.end.date, FHIRDate("2017-12-31").date) + self.assertEqual(inst.effectivePeriod.end.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("2016-01-01").date) self.assertEqual(inst.effectivePeriod.start.as_json(), "2016-01-01") self.assertTrue(inst.experimental) self.assertEqual(inst.id, "citalopramPrescription") @@ -202,7 +201,7 @@ def implActivityDefinition3(self, inst): 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.kind, "MedicationRequest") - self.assertEqual(inst.lastReviewDate.date, FHIRDate("2016-08-15").date) + self.assertEqual(inst.lastReviewDate.date, fhirdate.FHIRDate("2016-08-15").date) self.assertEqual(inst.lastReviewDate.as_json(), "2016-08-15") self.assertEqual(inst.name, "CitalopramPrescription") self.assertEqual(inst.publisher, "Motive Medical Intelligence") @@ -311,7 +310,7 @@ def testActivityDefinition5(self): self.implActivityDefinition5(inst2) def implActivityDefinition5(self, inst): - self.assertEqual(inst.approvalDate.date, FHIRDate("2017-03-01").date) + self.assertEqual(inst.approvalDate.date, fhirdate.FHIRDate("2017-03-01").date) self.assertEqual(inst.approvalDate.as_json(), "2017-03-01") self.assertEqual(inst.author[0].name, "Motive Medical Intelligence") self.assertEqual(inst.author[0].telecom[0].system, "phone") @@ -330,12 +329,12 @@ def implActivityDefinition5(self, inst): self.assertEqual(inst.contact[0].telecom[1].use, "work") self.assertEqual(inst.contact[0].telecom[1].value, "info@motivemi.com") self.assertEqual(inst.copyright, "© Copyright 2016 Motive Medical Intelligence. All rights reserved.") - self.assertEqual(inst.date.date, FHIRDate("2017-03-03T14:06:00Z").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2017-03-03T14:06:00Z").date) self.assertEqual(inst.date.as_json(), "2017-03-03T14:06:00Z") self.assertEqual(inst.description, "refer to primary care mental-health integrated care program for evaluation and treatment of mental health conditions now") - self.assertEqual(inst.effectivePeriod.end.date, FHIRDate("2017-12-31").date) + self.assertEqual(inst.effectivePeriod.end.date, fhirdate.FHIRDateTime("2017-12-31").date) self.assertEqual(inst.effectivePeriod.end.as_json(), "2017-12-31") - self.assertEqual(inst.effectivePeriod.start.date, FHIRDate("2017-03-01").date) + self.assertEqual(inst.effectivePeriod.start.date, fhirdate.FHIRDateTime("2017-03-01").date) self.assertEqual(inst.effectivePeriod.start.as_json(), "2017-03-01") self.assertTrue(inst.experimental) self.assertEqual(inst.id, "referralPrimaryCareMentalHealth") @@ -345,7 +344,7 @@ def implActivityDefinition5(self, inst): 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.kind, "ServiceRequest") - self.assertEqual(inst.lastReviewDate.date, FHIRDate("2017-03-01").date) + self.assertEqual(inst.lastReviewDate.date, fhirdate.FHIRDate("2017-03-01").date) self.assertEqual(inst.lastReviewDate.as_json(), "2017-03-01") self.assertEqual(inst.name, "ReferralPrimaryCareMentalHealth") self.assertEqual(inst.participant[0].type, "practitioner") diff --git a/tests/models/adverseevent_test.py b/tests/models/adverseevent_test.py index 12aec689e..e6f747c9b 100644 --- a/tests/models/adverseevent_test.py +++ b/tests/models/adverseevent_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import adverseevent -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, adverseevent class AdverseEventTests(unittest.TestCase): @@ -31,7 +30,7 @@ def implAdverseEvent1(self, inst): self.assertEqual(inst.category[0].coding[0].code, "product-use-error") self.assertEqual(inst.category[0].coding[0].display, "Product Use Error") self.assertEqual(inst.category[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/adverse-event-category") - self.assertEqual(inst.date.date, FHIRDate("2017-01-29T12:34:56+00:00").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2017-01-29T12:34:56+00:00").date) self.assertEqual(inst.date.as_json(), "2017-01-29T12:34:56+00:00") self.assertEqual(inst.event.coding[0].code, "304386008") self.assertEqual(inst.event.coding[0].display, "O/E - itchy rash") diff --git a/tests/models/allergyintolerance_test.py b/tests/models/allergyintolerance_test.py index 945cfba6d..18c6c5a72 100644 --- a/tests/models/allergyintolerance_test.py +++ b/tests/models/allergyintolerance_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import allergyintolerance -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, allergyintolerance class AllergyIntoleranceTests(unittest.TestCase): @@ -38,13 +37,13 @@ def implAllergyIntolerance1(self, inst): self.assertEqual(inst.id, "example") self.assertEqual(inst.identifier[0].system, "http://acme.com/ids/patients/risks") self.assertEqual(inst.identifier[0].value, "49476534") - self.assertEqual(inst.lastOccurrence.date, FHIRDate("2012-06").date) + self.assertEqual(inst.lastOccurrence.date, fhirdate.FHIRDateTime("2012-06").date) self.assertEqual(inst.lastOccurrence.as_json(), "2012-06") 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 criticality is high becasue of the observed anaphylactic reaction when challenged with cashew extract.") - self.assertEqual(inst.onsetDateTime.date, FHIRDate("2004").date) + self.assertEqual(inst.onsetDateTime.date, fhirdate.FHIRDateTime("2004").date) self.assertEqual(inst.onsetDateTime.as_json(), "2004") self.assertEqual(inst.reaction[0].description, "Challenge Protocol. Severe reaction to subcutaneous cashew extract. Epinephrine administered") self.assertEqual(inst.reaction[0].exposureRoute.coding[0].code, "34206005") @@ -53,7 +52,7 @@ def implAllergyIntolerance1(self, inst): self.assertEqual(inst.reaction[0].manifestation[0].coding[0].code, "39579001") self.assertEqual(inst.reaction[0].manifestation[0].coding[0].display, "Anaphylactic reaction") self.assertEqual(inst.reaction[0].manifestation[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.reaction[0].onset.date, FHIRDate("2012-06-12").date) + self.assertEqual(inst.reaction[0].onset.date, fhirdate.FHIRDateTime("2012-06-12").date) self.assertEqual(inst.reaction[0].onset.as_json(), "2012-06-12") self.assertEqual(inst.reaction[0].severity, "severe") self.assertEqual(inst.reaction[0].substance.coding[0].code, "1160593") @@ -63,10 +62,10 @@ def implAllergyIntolerance1(self, inst): self.assertEqual(inst.reaction[1].manifestation[0].coding[0].display, "Urticaria") self.assertEqual(inst.reaction[1].manifestation[0].coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.reaction[1].note[0].text, "The patient reports that the onset of urticaria was within 15 minutes of eating cashews.") - self.assertEqual(inst.reaction[1].onset.date, FHIRDate("2004").date) + self.assertEqual(inst.reaction[1].onset.date, fhirdate.FHIRDateTime("2004").date) self.assertEqual(inst.reaction[1].onset.as_json(), "2004") self.assertEqual(inst.reaction[1].severity, "moderate") - self.assertEqual(inst.recordedDate.date, FHIRDate("2014-10-09T14:58:00+11:00").date) + self.assertEqual(inst.recordedDate.date, fhirdate.FHIRDateTime("2014-10-09T14:58:00+11:00").date) self.assertEqual(inst.recordedDate.as_json(), "2014-10-09T14:58:00+11:00") self.assertEqual(inst.text.status, "generated") self.assertEqual(inst.type, "allergy") diff --git a/tests/models/appointment_test.py b/tests/models/appointment_test.py index f681aa040..52d800f82 100644 --- a/tests/models/appointment_test.py +++ b/tests/models/appointment_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import appointment -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, appointment class AppointmentTests(unittest.TestCase): @@ -32,7 +31,7 @@ def implAppointment1(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -55,7 +54,7 @@ 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-09T09:00:00Z").date) + self.assertEqual(inst.start.date, fhirdate.FHIRInstant("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
") @@ -76,10 +75,10 @@ def implAppointment2(self, inst): 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("2013-10-10").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRInstant("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") @@ -102,7 +101,7 @@ def implAppointment2(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.date, fhirdate.FHIRInstant("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
") @@ -123,7 +122,7 @@ def implAppointment3(self, inst): 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("2015-12-02").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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") @@ -145,9 +144,9 @@ def implAppointment3(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/appointmentresponse_test.py b/tests/models/appointmentresponse_test.py index 7069a3ddf..3ba4a9f48 100644 --- a/tests/models/appointmentresponse_test.py +++ b/tests/models/appointmentresponse_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import appointmentresponse -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, appointmentresponse class AppointmentResponseTests(unittest.TestCase): @@ -28,7 +27,7 @@ def testAppointmentResponse1(self): def implAppointmentResponse1(self, inst): self.assertEqual(inst.comment, "can't we try for this time, can't do mornings") - self.assertEqual(inst.end.date, FHIRDate("2013-12-25T13:30:00Z").date) + self.assertEqual(inst.end.date, fhirdate.FHIRInstant("2013-12-25T13:30:00Z").date) self.assertEqual(inst.end.as_json(), "2013-12-25T13:30:00Z") self.assertEqual(inst.id, "exampleresp") self.assertEqual(inst.identifier[0].system, "http://example.org/sampleappointmentresponse-identifier") @@ -39,7 +38,7 @@ def implAppointmentResponse1(self, inst): self.assertEqual(inst.participantStatus, "tentative") self.assertEqual(inst.participantType[0].coding[0].code, "ATND") self.assertEqual(inst.participantType[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") - self.assertEqual(inst.start.date, FHIRDate("2013-12-25T13:15:00Z").date) + self.assertEqual(inst.start.date, fhirdate.FHIRInstant("2013-12-25T13:15:00Z").date) self.assertEqual(inst.start.as_json(), "2013-12-25T13:15:00Z") self.assertEqual(inst.text.div, "
Accept Brian MRI results discussion
") self.assertEqual(inst.text.status, "generated") diff --git a/tests/models/auditevent_test.py b/tests/models/auditevent_test.py index 8c714dd07..7c449bf2b 100644 --- a/tests/models/auditevent_test.py +++ b/tests/models/auditevent_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import auditevent -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, auditevent class AuditEventTests(unittest.TestCase): @@ -52,7 +51,7 @@ def implAuditEvent1(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -131,7 +130,7 @@ def implAuditEvent2(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -186,7 +185,7 @@ def implAuditEvent3(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -250,7 +249,7 @@ def implAuditEvent4(self, inst): 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-27T23:42:24Z").date) + self.assertEqual(inst.recorded.date, fhirdate.FHIRInstant("2015-08-27T23:42:24Z").date) self.assertEqual(inst.recorded.as_json(), "2015-08-27T23:42:24Z") self.assertEqual(inst.subtype[0].code, "ITI-32") self.assertEqual(inst.subtype[0].display, "Distribute Document Set on Media") @@ -292,7 +291,7 @@ def implAuditEvent5(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -338,7 +337,7 @@ def implAuditEvent6(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -393,7 +392,7 @@ def implAuditEvent7(self, inst): 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("2012-10-25T22:04:27+11:00").date) + self.assertEqual(inst.recorded.date, fhirdate.FHIRInstant("2012-10-25T22:04:27+11:00").date) self.assertEqual(inst.recorded.as_json(), "2012-10-25T22:04:27+11:00") self.assertEqual(inst.source.site, "Development") self.assertEqual(inst.source.type[0].code, "110122") @@ -452,7 +451,7 @@ def implAuditEvent8(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -499,7 +498,7 @@ def implAuditEvent9(self, inst): 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.date, fhirdate.FHIRInstant("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") diff --git a/tests/models/basic_test.py b/tests/models/basic_test.py index 676dc8ca0..dbbbb4db6 100644 --- a/tests/models/basic_test.py +++ b/tests/models/basic_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import basic -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, basic class BasicTests(unittest.TestCase): @@ -29,7 +28,7 @@ def testBasic1(self): 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.date, fhirdate.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") @@ -46,9 +45,9 @@ def implBasic1(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/binary_test.py b/tests/models/binary_test.py index f27c22124..c52a937f6 100644 --- a/tests/models/binary_test.py +++ b/tests/models/binary_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import binary -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, binary class BinaryTests(unittest.TestCase): diff --git a/tests/models/biologicallyderivedproduct_test.py b/tests/models/biologicallyderivedproduct_test.py index d01953fa1..39f08a309 100644 --- a/tests/models/biologicallyderivedproduct_test.py +++ b/tests/models/biologicallyderivedproduct_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import biologicallyderivedproduct -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, biologicallyderivedproduct class BiologicallyDerivedProductTests(unittest.TestCase): diff --git a/tests/models/bodystructure_test.py b/tests/models/bodystructure_test.py index ea6f4ef16..91db2fb21 100644 --- a/tests/models/bodystructure_test.py +++ b/tests/models/bodystructure_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import bodystructure -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, bodystructure class BodyStructureTests(unittest.TestCase): diff --git a/tests/models/bundle_test.py b/tests/models/bundle_test.py index a419e5129..86e6fb2e0 100644 --- a/tests/models/bundle_test.py +++ b/tests/models/bundle_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import bundle -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, bundle class BundleTests(unittest.TestCase): @@ -67,35 +66,35 @@ def implBundle2(self, inst): self.assertEqual(inst.entry[0].fullUrl, "urn:uuid:3fdc72f4-a11d-4a9d-9260-a9f745779e1d") self.assertEqual(inst.entry[0].request.method, "POST") self.assertEqual(inst.entry[0].request.url, "DocumentReference") - self.assertEqual(inst.entry[0].resource.meta.lastUpdated.date, FHIRDate("2013-07-01T13:11:33Z").date) + self.assertEqual(inst.entry[0].resource.meta.lastUpdated.date, fhirdate.FHIRInstant("2013-07-01T13:11:33Z").date) self.assertEqual(inst.entry[0].resource.meta.lastUpdated.as_json(), "2013-07-01T13:11:33Z") self.assertEqual(inst.entry[1].fullUrl, "http://localhost:9556/svc/fhir/Patient/a2") self.assertEqual(inst.entry[1].request.ifNoneExist, "Patient?identifier=http://acme.org/xds/patients!89765a87b") self.assertEqual(inst.entry[1].request.method, "POST") self.assertEqual(inst.entry[1].request.url, "Patient") self.assertEqual(inst.entry[1].resource.id, "a2") - self.assertEqual(inst.entry[1].resource.meta.lastUpdated.date, FHIRDate("2013-07-01T13:11:33Z").date) + self.assertEqual(inst.entry[1].resource.meta.lastUpdated.date, fhirdate.FHIRInstant("2013-07-01T13:11:33Z").date) self.assertEqual(inst.entry[1].resource.meta.lastUpdated.as_json(), "2013-07-01T13:11:33Z") self.assertEqual(inst.entry[2].fullUrl, "http://localhost:9556/svc/fhir/Practitioner/a3") self.assertEqual(inst.entry[2].request.method, "POST") self.assertEqual(inst.entry[2].request.url, "Practitioner") self.assertEqual(inst.entry[2].resource.id, "a3") - self.assertEqual(inst.entry[2].resource.meta.lastUpdated.date, FHIRDate("2013-07-01T13:11:33Z").date) + self.assertEqual(inst.entry[2].resource.meta.lastUpdated.date, fhirdate.FHIRInstant("2013-07-01T13:11:33Z").date) self.assertEqual(inst.entry[2].resource.meta.lastUpdated.as_json(), "2013-07-01T13:11:33Z") self.assertEqual(inst.entry[3].fullUrl, "http://localhost:9556/svc/fhir/Practitioner/a4") self.assertEqual(inst.entry[3].request.method, "POST") self.assertEqual(inst.entry[3].request.url, "Practitioner") self.assertEqual(inst.entry[3].resource.id, "a4") - self.assertEqual(inst.entry[3].resource.meta.lastUpdated.date, FHIRDate("2013-07-01T13:11:33Z").date) + self.assertEqual(inst.entry[3].resource.meta.lastUpdated.date, fhirdate.FHIRInstant("2013-07-01T13:11:33Z").date) self.assertEqual(inst.entry[3].resource.meta.lastUpdated.as_json(), "2013-07-01T13:11:33Z") self.assertEqual(inst.entry[4].fullUrl, "http://localhost:9556/svc/fhir/Binary/1e404af3-077f-4bee-b7a6-a9be97e1ce32") self.assertEqual(inst.entry[4].request.method, "POST") self.assertEqual(inst.entry[4].request.url, "Binary") self.assertEqual(inst.entry[4].resource.id, "1e404af3-077f-4bee-b7a6-a9be97e1ce32") - self.assertEqual(inst.entry[4].resource.meta.lastUpdated.date, FHIRDate("2013-07-01T13:11:33Z").date) + self.assertEqual(inst.entry[4].resource.meta.lastUpdated.date, fhirdate.FHIRInstant("2013-07-01T13:11:33Z").date) self.assertEqual(inst.entry[4].resource.meta.lastUpdated.as_json(), "2013-07-01T13:11:33Z") self.assertEqual(inst.id, "xds") - self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2013-07-01T13:11:33Z").date) + self.assertEqual(inst.meta.lastUpdated.date, fhirdate.FHIRInstant("2013-07-01T13:11:33Z").date) self.assertEqual(inst.meta.lastUpdated.as_json(), "2013-07-01T13:11:33Z") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") @@ -302,7 +301,7 @@ def implBundle8(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -342,7 +341,7 @@ def implBundle9(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -364,42 +363,42 @@ def implBundle10(self, inst): 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.date, fhirdate.FHIRInstant("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.date, fhirdate.FHIRInstant("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.date, fhirdate.FHIRInstant("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.date, fhirdate.FHIRInstant("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.date, fhirdate.FHIRInstant("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.date, fhirdate.FHIRInstant("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.date, fhirdate.FHIRInstant("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.date, fhirdate.FHIRInstant("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.date, fhirdate.FHIRInstant("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.date, fhirdate.FHIRInstant("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") diff --git a/tests/models/capabilitystatement_test.py b/tests/models/capabilitystatement_test.py index a6de6c650..35df18538 100644 --- a/tests/models/capabilitystatement_test.py +++ b/tests/models/capabilitystatement_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import capabilitystatement -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, capabilitystatement class CapabilityStatementTests(unittest.TestCase): @@ -31,7 +30,7 @@ def implCapabilityStatement1(self, inst): self.assertEqual(inst.contact[0].telecom[0].system, "email") self.assertEqual(inst.contact[0].telecom[0].value, "wile@acme.org") self.assertEqual(inst.copyright, "Copyright © Acme Healthcare and GoodCorp EHR Systems") - self.assertEqual(inst.date.date, FHIRDate("2012-01-04").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2012-01-04").date) self.assertEqual(inst.date.as_json(), "2012-01-04") self.assertEqual(inst.description, "This is the FHIR capability statement for the main EHR at ACME for the private interface - it does not describe the public interface") self.assertEqual(inst.document[0].documentation, "Basic rules for all documents in the EHR system") @@ -99,7 +98,7 @@ def implCapabilityStatement1(self, inst): self.assertEqual(inst.rest[0].security.service[0].coding[0].code, "SMART-on-FHIR") self.assertEqual(inst.rest[0].security.service[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/restful-security-service") self.assertEqual(inst.software.name, "EHR") - self.assertEqual(inst.software.releaseDate.date, FHIRDate("2012-01-04").date) + self.assertEqual(inst.software.releaseDate.date, fhirdate.FHIRDateTime("2012-01-04").date) self.assertEqual(inst.software.releaseDate.as_json(), "2012-01-04") self.assertEqual(inst.software.version, "0.00.020.2134") self.assertEqual(inst.status, "draft") @@ -125,7 +124,7 @@ def testCapabilityStatement2(self): def implCapabilityStatement2(self, inst): 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-06-18").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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.1") diff --git a/tests/models/careplan_test.py b/tests/models/careplan_test.py index 3b661876d..fa7117435 100644 --- a/tests/models/careplan_test.py +++ b/tests/models/careplan_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import careplan -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, careplan class CarePlanTests(unittest.TestCase): @@ -40,9 +39,9 @@ def implCarePlan1(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.period.end.date, FHIRDate("2013-04-21").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -82,9 +81,9 @@ def implCarePlan3(self, inst): self.assertEqual(inst.activity[0].detail.code.text, "Nurse Consultation") self.assertFalse(inst.activity[0].detail.doNotPerform) self.assertEqual(inst.activity[0].detail.kind, "Appointment") - self.assertEqual(inst.activity[0].detail.scheduledPeriod.end.date, FHIRDate("2013-01-01T10:50:00+00:00").date) + self.assertEqual(inst.activity[0].detail.scheduledPeriod.end.date, fhirdate.FHIRDateTime("2013-01-01T10:50:00+00:00").date) self.assertEqual(inst.activity[0].detail.scheduledPeriod.end.as_json(), "2013-01-01T10:50:00+00:00") - self.assertEqual(inst.activity[0].detail.scheduledPeriod.start.date, FHIRDate("2013-01-01T10:38:00+00:00").date) + self.assertEqual(inst.activity[0].detail.scheduledPeriod.start.date, fhirdate.FHIRDateTime("2013-01-01T10:38:00+00:00").date) self.assertEqual(inst.activity[0].detail.scheduledPeriod.start.as_json(), "2013-01-01T10:38:00+00:00") self.assertEqual(inst.activity[0].detail.status, "completed") self.assertEqual(inst.activity[1].detail.code.coding[0].code, "doccon") @@ -101,7 +100,7 @@ def implCarePlan3(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.period.start.date, FHIRDate("2013-01-01T10:30:00+00:00").date) + self.assertEqual(inst.period.start.date, fhirdate.FHIRDateTime("2013-01-01T10:30:00+00:00").date) self.assertEqual(inst.period.start.as_json(), "2013-01-01T10:30:00+00:00") self.assertEqual(inst.status, "active") self.assertEqual(inst.text.status, "additional") @@ -134,9 +133,9 @@ def implCarePlan4(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.period.end.date, FHIRDate("2013-07-07").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -155,115 +154,115 @@ 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") - self.assertEqual(inst.activity[0].detail.extension[0].valueDate.date, FHIRDate("2012-09-10").date) + self.assertEqual(inst.activity[0].detail.extension[0].valueDate.date, fhirdate.FHIRDate("2012-09-10").date) self.assertEqual(inst.activity[0].detail.extension[0].valueDate.as_json(), "2012-09-10") - self.assertEqual(inst.activity[0].detail.scheduledPeriod.start.date, FHIRDate("2012-09-10").date) + self.assertEqual(inst.activity[0].detail.scheduledPeriod.start.date, fhirdate.FHIRDateTime("2012-09-10").date) self.assertEqual(inst.activity[0].detail.scheduledPeriod.start.as_json(), "2012-09-10") self.assertEqual(inst.activity[0].detail.status, "not-started") self.assertEqual(inst.activity[0].progress[0].text, "Eve eats one meal a day with her parents") - self.assertEqual(inst.activity[0].progress[0].time.date, FHIRDate("2012-09-10").date) + self.assertEqual(inst.activity[0].progress[0].time.date, fhirdate.FHIRDateTime("2012-09-10").date) self.assertEqual(inst.activity[0].progress[0].time.as_json(), "2012-09-10") self.assertEqual(inst.activity[1].detail.description, "Eve will ask her dad to asist her to put the head of her bed on blocks") self.assertFalse(inst.activity[1].detail.doNotPerform) self.assertEqual(inst.activity[1].detail.extension[0].url, "http://example.org/fhir/StructureDefinition/RevisionDate") - self.assertEqual(inst.activity[1].detail.extension[0].valueDate.date, FHIRDate("2012-09-10").date) + self.assertEqual(inst.activity[1].detail.extension[0].valueDate.date, fhirdate.FHIRDate("2012-09-10").date) self.assertEqual(inst.activity[1].detail.extension[0].valueDate.as_json(), "2012-09-10") self.assertEqual(inst.activity[1].detail.kind, "CommunicationRequest") - self.assertEqual(inst.activity[1].detail.scheduledPeriod.start.date, FHIRDate("2012-09-10").date) + self.assertEqual(inst.activity[1].detail.scheduledPeriod.start.date, fhirdate.FHIRDateTime("2012-09-10").date) self.assertEqual(inst.activity[1].detail.scheduledPeriod.start.as_json(), "2012-09-10") self.assertEqual(inst.activity[1].detail.status, "not-started") self.assertEqual(inst.activity[1].progress[0].text, "Eve will sleep in her bed more often than the couch") - self.assertEqual(inst.activity[1].progress[0].time.date, FHIRDate("2012-09-10").date) + self.assertEqual(inst.activity[1].progress[0].time.date, fhirdate.FHIRDateTime("2012-09-10").date) self.assertEqual(inst.activity[1].progress[0].time.as_json(), "2012-09-10") self.assertEqual(inst.activity[2].detail.description, "Eve will reduce her intake of coffee and chocolate") self.assertFalse(inst.activity[2].detail.doNotPerform) self.assertEqual(inst.activity[2].detail.extension[0].url, "http://example.org/fhir/StructureDefinition/RevisionDate") - self.assertEqual(inst.activity[2].detail.extension[0].valueDate.date, FHIRDate("2012-09-10").date) + self.assertEqual(inst.activity[2].detail.extension[0].valueDate.date, fhirdate.FHIRDate("2012-09-10").date) self.assertEqual(inst.activity[2].detail.extension[0].valueDate.as_json(), "2012-09-10") - self.assertEqual(inst.activity[2].detail.scheduledPeriod.start.date, FHIRDate("2012-09-10").date) + self.assertEqual(inst.activity[2].detail.scheduledPeriod.start.date, fhirdate.FHIRDateTime("2012-09-10").date) self.assertEqual(inst.activity[2].detail.scheduledPeriod.start.as_json(), "2012-09-10") self.assertEqual(inst.activity[2].detail.status, "in-progress") self.assertEqual(inst.activity[3].detail.description, "Eve will walk her friend's dog up and down a big hill 15-30 minutes 3 days a week") self.assertFalse(inst.activity[3].detail.doNotPerform) self.assertEqual(inst.activity[3].detail.extension[0].url, "http://example.org/fhir/StructureDefinition/RevisionDate") - self.assertEqual(inst.activity[3].detail.extension[0].valueDate.date, FHIRDate("2012-09-10").date) + self.assertEqual(inst.activity[3].detail.extension[0].valueDate.date, fhirdate.FHIRDate("2012-09-10").date) self.assertEqual(inst.activity[3].detail.extension[0].valueDate.as_json(), "2012-09-10") - self.assertEqual(inst.activity[3].detail.scheduledPeriod.start.date, FHIRDate("2012-08-27").date) + self.assertEqual(inst.activity[3].detail.scheduledPeriod.start.date, fhirdate.FHIRDateTime("2012-08-27").date) self.assertEqual(inst.activity[3].detail.scheduledPeriod.start.as_json(), "2012-08-27") self.assertEqual(inst.activity[3].detail.status, "in-progress") self.assertEqual(inst.activity[3].progress[0].text, "Eve would like to try for 5 days a week.") - self.assertEqual(inst.activity[3].progress[0].time.date, FHIRDate("2012-08-27").date) + self.assertEqual(inst.activity[3].progress[0].time.date, fhirdate.FHIRDateTime("2012-08-27").date) self.assertEqual(inst.activity[3].progress[0].time.as_json(), "2012-08-27") self.assertEqual(inst.activity[3].progress[1].text, "Eve is still walking the dogs.") - self.assertEqual(inst.activity[3].progress[1].time.date, FHIRDate("2012-09-10").date) + self.assertEqual(inst.activity[3].progress[1].time.date, fhirdate.FHIRDateTime("2012-09-10").date) self.assertEqual(inst.activity[3].progress[1].time.as_json(), "2012-09-10") self.assertEqual(inst.activity[4].detail.description, "Eve will walk 3 blocks to her parents house twice a week") self.assertFalse(inst.activity[4].detail.doNotPerform) self.assertEqual(inst.activity[4].detail.extension[0].url, "http://example.org/fhir/StructureDefinition/RevisionDate") - self.assertEqual(inst.activity[4].detail.extension[0].valueDate.date, FHIRDate("2012-09-10").date) + self.assertEqual(inst.activity[4].detail.extension[0].valueDate.date, fhirdate.FHIRDate("2012-09-10").date) self.assertEqual(inst.activity[4].detail.extension[0].valueDate.as_json(), "2012-09-10") - self.assertEqual(inst.activity[4].detail.scheduledPeriod.start.date, FHIRDate("2012-07-23").date) + self.assertEqual(inst.activity[4].detail.scheduledPeriod.start.date, fhirdate.FHIRDateTime("2012-07-23").date) self.assertEqual(inst.activity[4].detail.scheduledPeriod.start.as_json(), "2012-07-23") self.assertEqual(inst.activity[4].detail.status, "in-progress") self.assertEqual(inst.activity[4].progress[0].text, "Eve walked 4 times the last week.") - self.assertEqual(inst.activity[4].progress[0].time.date, FHIRDate("2012-08-13").date) + self.assertEqual(inst.activity[4].progress[0].time.date, fhirdate.FHIRDateTime("2012-08-13").date) self.assertEqual(inst.activity[4].progress[0].time.as_json(), "2012-08-13") self.assertEqual(inst.activity[4].progress[1].text, "Eve did not walk to her parents the last week, but has plans to start again") - self.assertEqual(inst.activity[4].progress[1].time.date, FHIRDate("2012-09-10").date) + self.assertEqual(inst.activity[4].progress[1].time.date, fhirdate.FHIRDateTime("2012-09-10").date) self.assertEqual(inst.activity[4].progress[1].time.as_json(), "2012-09-10") self.assertEqual(inst.activity[5].detail.description, "Eve will use a calendar to check off after medications are taken") self.assertFalse(inst.activity[5].detail.doNotPerform) self.assertEqual(inst.activity[5].detail.extension[0].url, "http://example.org/fhir/StructureDefinition/RevisionDate") - self.assertEqual(inst.activity[5].detail.extension[0].valueDate.date, FHIRDate("2012-08-13").date) + self.assertEqual(inst.activity[5].detail.extension[0].valueDate.date, fhirdate.FHIRDate("2012-08-13").date) self.assertEqual(inst.activity[5].detail.extension[0].valueDate.as_json(), "2012-08-13") - self.assertEqual(inst.activity[5].detail.scheduledPeriod.start.date, FHIRDate("2012-07-23").date) + self.assertEqual(inst.activity[5].detail.scheduledPeriod.start.date, fhirdate.FHIRDateTime("2012-07-23").date) self.assertEqual(inst.activity[5].detail.scheduledPeriod.start.as_json(), "2012-07-23") self.assertEqual(inst.activity[5].detail.status, "in-progress") self.assertEqual(inst.activity[6].detail.description, "Eve will use her lights MWF after her shower for 3 minutes") self.assertFalse(inst.activity[6].detail.doNotPerform) self.assertEqual(inst.activity[6].detail.extension[0].url, "http://example.org/fhir/StructureDefinition/RevisionDate") - self.assertEqual(inst.activity[6].detail.extension[0].valueDate.date, FHIRDate("2012-08-27").date) + self.assertEqual(inst.activity[6].detail.extension[0].valueDate.date, fhirdate.FHIRDate("2012-08-27").date) self.assertEqual(inst.activity[6].detail.extension[0].valueDate.as_json(), "2012-08-27") - self.assertEqual(inst.activity[6].detail.scheduledPeriod.start.date, FHIRDate("2012-07-23").date) + self.assertEqual(inst.activity[6].detail.scheduledPeriod.start.date, fhirdate.FHIRDateTime("2012-07-23").date) self.assertEqual(inst.activity[6].detail.scheduledPeriod.start.as_json(), "2012-07-23") self.assertEqual(inst.activity[6].detail.status, "in-progress") self.assertEqual(inst.activity[6].progress[0].text, "After restarting the vinegar soaks the psoriasis is improved and Eve plans to treat the remainder with light treatments. She plans to start this week.") - self.assertEqual(inst.activity[6].progress[0].time.date, FHIRDate("2012-08-13").date) + self.assertEqual(inst.activity[6].progress[0].time.date, fhirdate.FHIRDateTime("2012-08-13").date) self.assertEqual(inst.activity[6].progress[0].time.as_json(), "2012-08-13") self.assertEqual(inst.activity[6].progress[1].text, "Since her skin is improved Eve has not been using the light treatment as often, maybe once a week. She would like to increase to 3 times a week again") - self.assertEqual(inst.activity[6].progress[1].time.date, FHIRDate("2012-08-27").date) + self.assertEqual(inst.activity[6].progress[1].time.date, fhirdate.FHIRDateTime("2012-08-27").date) self.assertEqual(inst.activity[6].progress[1].time.as_json(), "2012-08-27") self.assertEqual(inst.activity[7].detail.description, "Eve will use a calendar of a chart to help her remember when to take her medications") self.assertFalse(inst.activity[7].detail.doNotPerform) self.assertEqual(inst.activity[7].detail.extension[0].url, "http://example.org/fhir/StructureDefinition/RevisionDate") - self.assertEqual(inst.activity[7].detail.extension[0].valueDate.date, FHIRDate("2012-09-10").date) + self.assertEqual(inst.activity[7].detail.extension[0].valueDate.date, fhirdate.FHIRDate("2012-09-10").date) self.assertEqual(inst.activity[7].detail.extension[0].valueDate.as_json(), "2012-09-10") - self.assertEqual(inst.activity[7].detail.scheduledPeriod.start.date, FHIRDate("2012-07-10").date) + self.assertEqual(inst.activity[7].detail.scheduledPeriod.start.date, fhirdate.FHIRDateTime("2012-07-10").date) self.assertEqual(inst.activity[7].detail.scheduledPeriod.start.as_json(), "2012-07-10") self.assertEqual(inst.activity[7].detail.status, "in-progress") self.assertEqual(inst.activity[7].progress[0].text, "Eve created a chart as a reminer to take the medications that do not fit in her pill box") - self.assertEqual(inst.activity[7].progress[0].time.date, FHIRDate("2012-07-23").date) + self.assertEqual(inst.activity[7].progress[0].time.date, fhirdate.FHIRDateTime("2012-07-23").date) self.assertEqual(inst.activity[7].progress[0].time.as_json(), "2012-07-23") self.assertEqual(inst.activity[8].detail.description, "Eve will start using stretch bands and one step 2 days a week Mon/Wed 6-7am and maybe Friday afternoon") self.assertFalse(inst.activity[8].detail.doNotPerform) self.assertEqual(inst.activity[8].detail.extension[0].url, "http://example.org/fhir/StructureDefinition/RevisionDate") - self.assertEqual(inst.activity[8].detail.extension[0].valueDate.date, FHIRDate("2012-08-23").date) + self.assertEqual(inst.activity[8].detail.extension[0].valueDate.date, fhirdate.FHIRDate("2012-08-23").date) self.assertEqual(inst.activity[8].detail.extension[0].valueDate.as_json(), "2012-08-23") - self.assertEqual(inst.activity[8].detail.scheduledPeriod.start.date, FHIRDate("2012-07-23").date) + self.assertEqual(inst.activity[8].detail.scheduledPeriod.start.date, fhirdate.FHIRDateTime("2012-07-23").date) self.assertEqual(inst.activity[8].detail.scheduledPeriod.start.as_json(), "2012-07-23") self.assertEqual(inst.activity[8].detail.status, "on-hold") self.assertEqual(inst.activity[8].progress[0].text, "Will be able to esume exercise.") - self.assertEqual(inst.activity[8].progress[0].time.date, FHIRDate("2012-07-30").date) + self.assertEqual(inst.activity[8].progress[0].time.date, fhirdate.FHIRDateTime("2012-07-30").date) self.assertEqual(inst.activity[8].progress[0].time.as_json(), "2012-07-30") self.assertEqual(inst.activity[8].progress[1].text, "Eve prefers to focus on walking at this time") - self.assertEqual(inst.activity[8].progress[1].time.date, FHIRDate("2012-08-13").date) + self.assertEqual(inst.activity[8].progress[1].time.date, fhirdate.FHIRDateTime("2012-08-13").date) self.assertEqual(inst.activity[8].progress[1].time.as_json(), "2012-08-13") self.assertEqual(inst.activity[9].detail.description, "Eve will match a printed medication worksheet with the medication bottles at home") self.assertFalse(inst.activity[9].detail.doNotPerform) self.assertEqual(inst.activity[9].detail.extension[0].url, "http://example.org/fhir/StructureDefinition/RevisionDate") - self.assertEqual(inst.activity[9].detail.extension[0].valueDate.date, FHIRDate("2012-07-23").date) + self.assertEqual(inst.activity[9].detail.extension[0].valueDate.date, fhirdate.FHIRDate("2012-07-23").date) self.assertEqual(inst.activity[9].detail.extension[0].valueDate.as_json(), "2012-07-23") - self.assertEqual(inst.activity[9].detail.scheduledPeriod.start.date, FHIRDate("2012-07-10").date) + self.assertEqual(inst.activity[9].detail.scheduledPeriod.start.date, fhirdate.FHIRDateTime("2012-07-10").date) self.assertEqual(inst.activity[9].detail.scheduledPeriod.start.as_json(), "2012-07-10") self.assertEqual(inst.activity[9].detail.status, "completed") self.assertEqual(inst.contained[0].id, "p1") @@ -300,9 +299,9 @@ def implCarePlan6(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -313,9 +312,9 @@ def implCarePlan6(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -324,9 +323,9 @@ def implCarePlan6(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -335,16 +334,16 @@ def implCarePlan6(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -384,9 +383,9 @@ def implCarePlan7(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.period.end.date, FHIRDate("2013-03-13").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -419,9 +418,9 @@ def implCarePlan8(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.period.end.date, FHIRDate("2013-03-08T09:30:10+01:00").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("2013-03-08T09:30:10+01:00").date) self.assertEqual(inst.period.end.as_json(), "2013-03-08T09:30:10+01:00") - self.assertEqual(inst.period.start.date, FHIRDate("2013-03-08T09:00:10+01:00").date) + self.assertEqual(inst.period.start.date, fhirdate.FHIRDateTime("2013-03-08T09:00:10+01:00").date) self.assertEqual(inst.period.start.as_json(), "2013-03-08T09:00:10+01:00") self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.status, "generated") @@ -454,7 +453,7 @@ def implCarePlan9(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -464,7 +463,7 @@ def implCarePlan9(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.period.end.date, FHIRDate("2017-06-01").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("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") @@ -497,9 +496,9 @@ def implCarePlan10(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.period.end.date, FHIRDate("2011-06-27").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("2011-06-27").date) self.assertEqual(inst.period.end.as_json(), "2011-06-27") - self.assertEqual(inst.period.start.date, FHIRDate("2011-06-26").date) + self.assertEqual(inst.period.start.date, fhirdate.FHIRDateTime("2011-06-26").date) self.assertEqual(inst.period.start.as_json(), "2011-06-26") self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.status, "generated") diff --git a/tests/models/careteam_test.py b/tests/models/careteam_test.py index 490242e49..ff40a5e98 100644 --- a/tests/models/careteam_test.py +++ b/tests/models/careteam_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import careteam -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, careteam class CareTeamTests(unittest.TestCase): @@ -38,10 +37,10 @@ def implCareTeam1(self, inst): self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.name, "Peter James Charlmers Care Plan for Inpatient Encounter") self.assertEqual(inst.participant[0].role[0].text, "responsiblePerson") - self.assertEqual(inst.participant[1].period.end.date, FHIRDate("2013-01-01").date) + self.assertEqual(inst.participant[1].period.end.date, fhirdate.FHIRDateTime("2013-01-01").date) self.assertEqual(inst.participant[1].period.end.as_json(), "2013-01-01") self.assertEqual(inst.participant[1].role[0].text, "adviser") - self.assertEqual(inst.period.end.date, FHIRDate("2013-01-01").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("2013-01-01").date) self.assertEqual(inst.period.end.as_json(), "2013-01-01") self.assertEqual(inst.status, "active") self.assertEqual(inst.text.div, "
Care Team
") diff --git a/tests/models/catalogentry_test.py b/tests/models/catalogentry_test.py index 58d558dce..c2fbe11f1 100644 --- a/tests/models/catalogentry_test.py +++ b/tests/models/catalogentry_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import catalogentry -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, catalogentry class CatalogEntryTests(unittest.TestCase): diff --git a/tests/models/chargeitem_test.py b/tests/models/chargeitem_test.py index 0c44bc2bc..97638194e 100644 --- a/tests/models/chargeitem_test.py +++ b/tests/models/chargeitem_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import chargeitem -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, chargeitem class ChargeItemTests(unittest.TestCase): @@ -30,7 +29,7 @@ def implChargeItem1(self, inst): self.assertEqual(inst.code.coding[0].code, "01510") self.assertEqual(inst.code.coding[0].display, "Zusatzpauschale für Beobachtung nach diagnostischer Koronarangiografie") self.assertEqual(inst.definitionUri[0], "http://www.kbv.de/tools/ebm/html/01520_2904360860826220813632.html") - self.assertEqual(inst.enteredDate.date, FHIRDate("2017-01-25T23:55:04+01:00").date) + self.assertEqual(inst.enteredDate.date, fhirdate.FHIRDateTime("2017-01-25T23:55:04+01:00").date) self.assertEqual(inst.enteredDate.as_json(), "2017-01-25T23:55:04+01:00") self.assertEqual(inst.factorOverride, 0.8) self.assertEqual(inst.id, "example") @@ -40,11 +39,11 @@ def implChargeItem1(self, inst): 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 code is only applicable for periods longer than 4h") - self.assertEqual(inst.note[0].time.date, FHIRDate("2017-01-25T23:55:04+01:00").date) + self.assertEqual(inst.note[0].time.date, fhirdate.FHIRDateTime("2017-01-25T23:55:04+01:00").date) self.assertEqual(inst.note[0].time.as_json(), "2017-01-25T23:55:04+01:00") - self.assertEqual(inst.occurrencePeriod.end.date, FHIRDate("2017-01-25T12:35:00+01:00").date) + self.assertEqual(inst.occurrencePeriod.end.date, fhirdate.FHIRDateTime("2017-01-25T12:35:00+01:00").date) self.assertEqual(inst.occurrencePeriod.end.as_json(), "2017-01-25T12:35:00+01:00") - self.assertEqual(inst.occurrencePeriod.start.date, FHIRDate("2017-01-25T08:00:00+01:00").date) + self.assertEqual(inst.occurrencePeriod.start.date, fhirdate.FHIRDateTime("2017-01-25T08:00:00+01:00").date) self.assertEqual(inst.occurrencePeriod.start.as_json(), "2017-01-25T08:00:00+01:00") self.assertEqual(inst.overrideReason, "Patient is Cardiologist's golf buddy, so he gets a 20% discount!") self.assertEqual(inst.performer[0].function.coding[0].code, "17561000") diff --git a/tests/models/chargeitemdefinition_test.py b/tests/models/chargeitemdefinition_test.py index c472b5eff..c7671067d 100644 --- a/tests/models/chargeitemdefinition_test.py +++ b/tests/models/chargeitemdefinition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import chargeitemdefinition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, chargeitemdefinition class ChargeItemDefinitionTests(unittest.TestCase): @@ -37,9 +36,9 @@ def implChargeItemDefinition1(self, inst): self.assertEqual(inst.code.coding[0].display, "Allergologiediagnostik I") self.assertEqual(inst.code.coding[0].system, "http://fhir.de/CodingSystem/kbv/ebm") self.assertEqual(inst.description, "Allergologisch-diagnostischer Komplex zur Diagnostik und/oder zum Ausschluss einer (Kontakt-)Allergie vom Spättyp (Typ IV), einschl. Kosten") - self.assertEqual(inst.effectivePeriod.end.date, FHIRDate("2018-06-30").date) + self.assertEqual(inst.effectivePeriod.end.date, fhirdate.FHIRDateTime("2018-06-30").date) self.assertEqual(inst.effectivePeriod.end.as_json(), "2018-06-30") - self.assertEqual(inst.effectivePeriod.start.date, FHIRDate("2018-04-01").date) + self.assertEqual(inst.effectivePeriod.start.date, fhirdate.FHIRDateTime("2018-04-01").date) self.assertEqual(inst.effectivePeriod.start.as_json(), "2018-04-01") self.assertEqual(inst.id, "ebm") self.assertEqual(inst.propertyGroup[0].priceComponent[0].amount.currency, "EUR") diff --git a/tests/models/claim_test.py b/tests/models/claim_test.py index bdfaee025..8439cd32d 100644 --- a/tests/models/claim_test.py +++ b/tests/models/claim_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import claim -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, claim class ClaimTests(unittest.TestCase): @@ -28,7 +27,7 @@ def testClaim1(self): def implClaim1(self, inst): self.assertEqual(inst.careTeam[0].sequence, 1) - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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) @@ -43,7 +42,7 @@ def implClaim1(self, inst): 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.date, fhirdate.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) @@ -71,7 +70,7 @@ def testClaim2(self): def implClaim2(self, inst): self.assertEqual(inst.careTeam[0].sequence, 1) - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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) @@ -109,7 +108,7 @@ def implClaim2(self, inst): 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.date, fhirdate.FHIRDate("2014-08-16").date) self.assertEqual(inst.item[0].servicedDate.as_json(), "2014-08-16") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") @@ -153,7 +152,7 @@ def implClaim3(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") - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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) @@ -281,7 +280,7 @@ def implClaim3(self, inst): self.assertEqual(inst.item[0].revenue.coding[0].display, "Vision Clinic") self.assertEqual(inst.item[0].revenue.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-revenue-center") 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.date, fhirdate.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, 235.4) @@ -309,7 +308,7 @@ def testClaim4(self): def implClaim4(self, inst): self.assertEqual(inst.careTeam[0].sequence, 1) - self.assertEqual(inst.created.date, FHIRDate("2015-03-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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") @@ -360,7 +359,7 @@ def implClaim4(self, inst): 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("2015-05-16").date) + self.assertEqual(inst.item[0].servicedDate.date, fhirdate.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, 9000.0) @@ -372,7 +371,7 @@ def implClaim4(self, inst): 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.date, fhirdate.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") @@ -400,7 +399,7 @@ def implClaim4(self, inst): 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.date, fhirdate.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) @@ -428,7 +427,7 @@ def testClaim5(self): def implClaim5(self, inst): self.assertEqual(inst.careTeam[0].sequence, 1) - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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) @@ -444,7 +443,7 @@ def implClaim5(self, inst): 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.date, fhirdate.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) @@ -472,7 +471,7 @@ def testClaim6(self): 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.date, fhirdate.FHIRDateTime("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) @@ -510,7 +509,7 @@ def implClaim6(self, inst): 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.date, fhirdate.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) @@ -538,7 +537,7 @@ def testClaim7(self): 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.date, fhirdate.FHIRDateTime("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) @@ -553,7 +552,7 @@ def implClaim7(self, inst): 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.date, fhirdate.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) @@ -562,7 +561,7 @@ def implClaim7(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -596,7 +595,7 @@ def implClaim8(self, inst): 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.date, fhirdate.FHIRDateTime("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) @@ -610,7 +609,7 @@ def implClaim8(self, inst): 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.date, fhirdate.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) @@ -638,7 +637,7 @@ def testClaim9(self): def implClaim9(self, inst): self.assertEqual(inst.careTeam[0].sequence, 1) - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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) @@ -653,7 +652,7 @@ def implClaim9(self, inst): 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.date, fhirdate.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) @@ -681,7 +680,7 @@ def testClaim10(self): def implClaim10(self, inst): self.assertEqual(inst.careTeam[0].sequence, 1) - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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) @@ -695,7 +694,7 @@ def implClaim10(self, inst): 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.date, fhirdate.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) diff --git a/tests/models/claimresponse_test.py b/tests/models/claimresponse_test.py index 8219f56bb..54abab9b9 100644 --- a/tests/models/claimresponse_test.py +++ b/tests/models/claimresponse_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import claimresponse -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, claimresponse class ClaimResponseTests(unittest.TestCase): @@ -61,7 +60,7 @@ def implClaimResponse1(self, inst): self.assertEqual(inst.addItem[1].productOrService.coding[0].code, "2101") self.assertEqual(inst.addItem[1].productOrService.coding[0].display, "Radiograph, series (12)") self.assertEqual(inst.addItem[1].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("2014-08-16").date) self.assertEqual(inst.created.as_json(), "2014-08-16") self.assertEqual(inst.disposition, "The enclosed services are authorized for your provision within 30 days of this notice.") self.assertEqual(inst.id, "UR3503") @@ -105,7 +104,7 @@ def testClaimResponse2(self): self.implClaimResponse2(inst2) def implClaimResponse2(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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") @@ -134,7 +133,7 @@ def implClaimResponse2(self, inst): 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.date, fhirdate.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") @@ -221,7 +220,7 @@ def implClaimResponse3(self, inst): self.assertEqual(inst.addItem[2].noteNumber[0], 101) self.assertEqual(inst.addItem[2].productOrService.coding[0].code, "expense") self.assertEqual(inst.addItem[2].productOrService.coding[0].system, "http://example.org/fhir/oralservicecodes") - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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, "R3503") @@ -276,7 +275,7 @@ def implClaimResponse3(self, inst): 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.date, fhirdate.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-15507") @@ -311,7 +310,7 @@ def testClaimResponse4(self): self.implClaimResponse4(inst2) def implClaimResponse4(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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") @@ -350,7 +349,7 @@ def testClaimResponse5(self): self.implClaimResponse5(inst2) def implClaimResponse5(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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, "R3502") @@ -443,7 +442,7 @@ def implClaimResponse5(self, inst): self.assertEqual(inst.payment.adjustmentReason.coding[0].system, "http://terminology.hl7.org/CodeSystem/payment-adjustment-reason") self.assertEqual(inst.payment.amount.currency, "USD") self.assertEqual(inst.payment.amount.value, 107.0) - self.assertEqual(inst.payment.date.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.payment.date.date, fhirdate.FHIRDate("2014-08-16").date) self.assertEqual(inst.payment.date.as_json(), "2014-08-16") self.assertEqual(inst.payment.identifier.system, "http://thebenefitcompany.com/paymentidentifier") self.assertEqual(inst.payment.identifier.value, "201416-123456") diff --git a/tests/models/clinicalimpression_test.py b/tests/models/clinicalimpression_test.py index e63c1f0fb..06b61dccb 100644 --- a/tests/models/clinicalimpression_test.py +++ b/tests/models/clinicalimpression_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import clinicalimpression -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, clinicalimpression class ClinicalImpressionTests(unittest.TestCase): @@ -27,12 +26,12 @@ def testClinicalImpression1(self): self.implClinicalImpression1(inst2) def implClinicalImpression1(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2014-12-06T22:33:00+11:00").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2014-12-06T22:33:00+11:00").date) self.assertEqual(inst.date.as_json(), "2014-12-06T22:33:00+11:00") self.assertEqual(inst.description, "This 26 yo male patient is brought into ER by ambulance after being involved in a motor vehicle accident") - self.assertEqual(inst.effectivePeriod.end.date, FHIRDate("2014-12-06T22:33:00+11:00").date) + self.assertEqual(inst.effectivePeriod.end.date, fhirdate.FHIRDateTime("2014-12-06T22:33:00+11:00").date) self.assertEqual(inst.effectivePeriod.end.as_json(), "2014-12-06T22:33:00+11:00") - self.assertEqual(inst.effectivePeriod.start.date, FHIRDate("2014-12-06T20:00:00+11:00").date) + self.assertEqual(inst.effectivePeriod.start.date, fhirdate.FHIRDateTime("2014-12-06T20:00:00+11:00").date) self.assertEqual(inst.effectivePeriod.start.as_json(), "2014-12-06T20:00:00+11:00") self.assertEqual(inst.finding[0].itemCodeableConcept.coding[0].code, "850.0") self.assertEqual(inst.finding[0].itemCodeableConcept.coding[0].system, "http://hl7.org/fhir/sid/icd-9") diff --git a/tests/models/codesystem_test.py b/tests/models/codesystem_test.py index 70192bcb0..4aae6a837 100644 --- a/tests/models/codesystem_test.py +++ b/tests/models/codesystem_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import codesystem -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, codesystem class CodeSystemTests(unittest.TestCase): @@ -103,7 +102,7 @@ def implCodeSystem2(self, inst): 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.4.1105") - self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2019-11-01T09:29:23.356+11:00").date) + self.assertEqual(inst.meta.lastUpdated.date, fhirdate.FHIRInstant("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") @@ -138,7 +137,7 @@ 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("2019-11-01T09:29:23+11:00").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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) @@ -151,7 +150,7 @@ def implCodeSystem3(self, inst): 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.4.859") - self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2019-11-01T09:29:23.356+11:00").date) + self.assertEqual(inst.meta.lastUpdated.date, fhirdate.FHIRInstant("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)") @@ -196,7 +195,7 @@ def implCodeSystem4(self, inst): 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, "complete") - self.assertEqual(inst.date.date, FHIRDate("2016-01-28").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2016-01-28").date) self.assertEqual(inst.date.as_json(), "2016-01-28") self.assertEqual(inst.description, "This is an example code system that includes all the ACME codes for serum/plasma cholesterol from v2.36.") self.assertTrue(inst.experimental) @@ -240,7 +239,7 @@ def implCodeSystem5(self, inst): 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.date, fhirdate.FHIRDateTime("2016-01-28").date) self.assertEqual(inst.date.as_json(), "2016-01-28") self.assertTrue(inst.experimental) self.assertEqual(inst.id, "example-supplement") diff --git a/tests/models/communication_test.py b/tests/models/communication_test.py index 754d9c0c0..013badb32 100644 --- a/tests/models/communication_test.py +++ b/tests/models/communication_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import communication -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, communication class CommunicationTests(unittest.TestCase): @@ -43,9 +42,9 @@ def implCommunication1(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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
") @@ -71,17 +70,17 @@ def implCommunication2(self, inst): 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].contentAttachment.contentType, "application/pdf") - self.assertEqual(inst.payload[0].contentAttachment.creation.date, FHIRDate("2010-02-01T11:50:23-05:00").date) + self.assertEqual(inst.payload[0].contentAttachment.creation.date, fhirdate.FHIRDateTime("2010-02-01T11:50:23-05:00").date) self.assertEqual(inst.payload[0].contentAttachment.creation.as_json(), "2010-02-01T11:50:23-05:00") self.assertEqual(inst.payload[0].contentAttachment.data, "SGVsbG8=") self.assertEqual(inst.payload[0].contentAttachment.title, "accident notes 20100201.pdf") self.assertEqual(inst.payload[1].contentAttachment.contentType, "application/pdf") - self.assertEqual(inst.payload[1].contentAttachment.creation.date, FHIRDate("2010-02-01T10:57:34+01:00").date) + self.assertEqual(inst.payload[1].contentAttachment.creation.date, fhirdate.FHIRDateTime("2010-02-01T10:57:34+01:00").date) self.assertEqual(inst.payload[1].contentAttachment.creation.as_json(), "2010-02-01T10:57:34+01:00") self.assertEqual(inst.payload[1].contentAttachment.hash, "SGVsbG8gdGhlcmU=") self.assertEqual(inst.payload[1].contentAttachment.size, 104274) self.assertEqual(inst.payload[1].contentAttachment.url, "http://example.org/docs/AB12345") - self.assertEqual(inst.sent.date, FHIRDate("2016-06-12T18:01:10-08:00").date) + self.assertEqual(inst.sent.date, fhirdate.FHIRDateTime("2016-06-12T18:01:10-08:00").date) self.assertEqual(inst.sent.as_json(), "2016-06-12T18:01:10-08:00") self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.div, "
Attachment which is unsolicited
") @@ -110,17 +109,17 @@ def implCommunication3(self, inst): 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].contentAttachment.contentType, "application/pdf") - self.assertEqual(inst.payload[0].contentAttachment.creation.date, FHIRDate("2010-02-01T11:50:23-05:00").date) + self.assertEqual(inst.payload[0].contentAttachment.creation.date, fhirdate.FHIRDateTime("2010-02-01T11:50:23-05:00").date) self.assertEqual(inst.payload[0].contentAttachment.creation.as_json(), "2010-02-01T11:50:23-05:00") self.assertEqual(inst.payload[0].contentAttachment.data, "SGVsbG8=") self.assertEqual(inst.payload[0].contentAttachment.title, "accident notes 20100201.pdf") self.assertEqual(inst.payload[1].contentAttachment.contentType, "application/pdf") - self.assertEqual(inst.payload[1].contentAttachment.creation.date, FHIRDate("2010-02-01T10:57:34+01:00").date) + self.assertEqual(inst.payload[1].contentAttachment.creation.date, fhirdate.FHIRDateTime("2010-02-01T10:57:34+01:00").date) self.assertEqual(inst.payload[1].contentAttachment.creation.as_json(), "2010-02-01T10:57:34+01:00") self.assertEqual(inst.payload[1].contentAttachment.hash, "SGVsbG8gdGhlcmU=") self.assertEqual(inst.payload[1].contentAttachment.size, 104274) self.assertEqual(inst.payload[1].contentAttachment.url, "http://happyvalley.com/docs/AB12345") - self.assertEqual(inst.sent.date, FHIRDate("2016-06-12T18:01:10-08:00").date) + self.assertEqual(inst.sent.date, fhirdate.FHIRDateTime("2016-06-12T18:01:10-08:00").date) self.assertEqual(inst.sent.as_json(), "2016-06-12T18:01:10-08:00") self.assertEqual(inst.status, "completed") self.assertEqual(inst.text.div, "
Attachment in response to a Request
") diff --git a/tests/models/communicationrequest_test.py b/tests/models/communicationrequest_test.py index 1c5f6dec3..7a0f562a3 100644 --- a/tests/models/communicationrequest_test.py +++ b/tests/models/communicationrequest_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import communicationrequest -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, communicationrequest class CommunicationRequestTests(unittest.TestCase): @@ -46,7 +45,7 @@ def testCommunicationRequest2(self): self.implCommunicationRequest2(inst2) def implCommunicationRequest2(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2016-06-10T11:01:10-08:00").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("2016-06-10T11:01:10-08:00").date) self.assertEqual(inst.authoredOn.as_json(), "2016-06-10T11:01:10-08:00") self.assertEqual(inst.category[0].coding[0].code, "SolicitedAttachmentRequest") self.assertEqual(inst.category[0].coding[0].system, "http://acme.org/messagetypes") @@ -64,7 +63,7 @@ def implCommunicationRequest2(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.occurrenceDateTime.date, FHIRDate("2016-06-10T11:01:10-08:00").date) + self.assertEqual(inst.occurrenceDateTime.date, fhirdate.FHIRDateTime("2016-06-10T11:01:10-08:00").date) self.assertEqual(inst.occurrenceDateTime.as_json(), "2016-06-10T11:01:10-08:00") self.assertEqual(inst.payload[0].contentString, "Please provide the accident report and any associated pictures to support your Claim# DEF5647.") self.assertEqual(inst.priority, "routine") diff --git a/tests/models/compartmentdefinition_test.py b/tests/models/compartmentdefinition_test.py index 0d2e72c09..c03aadf55 100644 --- a/tests/models/compartmentdefinition_test.py +++ b/tests/models/compartmentdefinition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import compartmentdefinition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, compartmentdefinition class CompartmentDefinitionTests(unittest.TestCase): @@ -31,7 +30,7 @@ def implCompartmentDefinition1(self, inst): 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.date.date, FHIRDate("2017-02-24").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2017-02-24").date) self.assertEqual(inst.date.as_json(), "2017-02-24") self.assertEqual(inst.description, "The set of resources associated with a particular Device (example with Communication and CommunicationRequest resourses only).") self.assertTrue(inst.experimental) diff --git a/tests/models/composition_test.py b/tests/models/composition_test.py index 3ad525267..a626cd41c 100644 --- a/tests/models/composition_test.py +++ b/tests/models/composition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import composition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, composition class CompositionTests(unittest.TestCase): @@ -28,13 +27,13 @@ def testComposition1(self): def implComposition1(self, inst): self.assertEqual(inst.attester[0].mode, "legal") - self.assertEqual(inst.attester[0].time.date, FHIRDate("2012-01-04T09:10:14Z").date) + self.assertEqual(inst.attester[0].time.date, fhirdate.FHIRDateTime("2012-01-04T09:10:14Z").date) self.assertEqual(inst.attester[0].time.as_json(), "2012-01-04T09:10:14Z") self.assertEqual(inst.category[0].coding[0].code, "LP173421-1") self.assertEqual(inst.category[0].coding[0].display, "Report") self.assertEqual(inst.category[0].coding[0].system, "http://loinc.org") self.assertEqual(inst.confidentiality, "N") - self.assertEqual(inst.date.date, FHIRDate("2018-10-30T16:56:04+11:00").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2018-10-30T16:56:04+11:00").date) self.assertEqual(inst.date.as_json(), "2018-10-30T16:56:04+11:00") self.assertEqual(inst.id, "example-mixed") self.assertEqual(inst.meta.tag[0].code, "HTEST") @@ -69,20 +68,20 @@ def testComposition2(self): def implComposition2(self, inst): self.assertEqual(inst.attester[0].mode, "legal") - self.assertEqual(inst.attester[0].time.date, FHIRDate("2012-01-04T09:10:14Z").date) + self.assertEqual(inst.attester[0].time.date, fhirdate.FHIRDateTime("2012-01-04T09:10:14Z").date) self.assertEqual(inst.attester[0].time.as_json(), "2012-01-04T09:10:14Z") self.assertEqual(inst.category[0].coding[0].code, "LP173421-1") self.assertEqual(inst.category[0].coding[0].display, "Report") self.assertEqual(inst.category[0].coding[0].system, "http://loinc.org") self.assertEqual(inst.confidentiality, "N") - self.assertEqual(inst.date.date, FHIRDate("2012-01-04T09:10:14Z").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2012-01-04T09:10:14Z").date) self.assertEqual(inst.date.as_json(), "2012-01-04T09:10:14Z") self.assertEqual(inst.event[0].code[0].coding[0].code, "HEALTHREC") self.assertEqual(inst.event[0].code[0].coding[0].display, "health record") self.assertEqual(inst.event[0].code[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") - self.assertEqual(inst.event[0].period.end.date, FHIRDate("2012-11-12").date) + self.assertEqual(inst.event[0].period.end.date, fhirdate.FHIRDateTime("2012-11-12").date) self.assertEqual(inst.event[0].period.end.as_json(), "2012-11-12") - self.assertEqual(inst.event[0].period.start.date, FHIRDate("2010-07-18").date) + self.assertEqual(inst.event[0].period.start.date, fhirdate.FHIRDateTime("2010-07-18").date) self.assertEqual(inst.event[0].period.start.as_json(), "2010-07-18") self.assertEqual(inst.id, "example") self.assertEqual(inst.identifier.system, "http://healthintersections.com.au/test") diff --git a/tests/models/conceptmap_test.py b/tests/models/conceptmap_test.py index b26358099..3761700f7 100644 --- a/tests/models/conceptmap_test.py +++ b/tests/models/conceptmap_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import conceptmap -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, conceptmap class ConceptMapTests(unittest.TestCase): @@ -31,7 +30,7 @@ def implConceptMap1(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -105,7 +104,7 @@ def implConceptMap2(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.date.date, FHIRDate("2012-06-13").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2012-06-13").date) self.assertEqual(inst.date.as_json(), "2012-06-13") self.assertEqual(inst.description, "An example mapping") self.assertTrue(inst.experimental) @@ -149,7 +148,7 @@ def implConceptMap3(self, inst): 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.date, fhirdate.FHIRDateTime("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) diff --git a/tests/models/condition_test.py b/tests/models/condition_test.py index 0071db0ad..0656330a4 100644 --- a/tests/models/condition_test.py +++ b/tests/models/condition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import condition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, condition class ConditionTests(unittest.TestCase): @@ -27,7 +26,7 @@ def testCondition1(self): self.implCondition1(inst2) def implCondition1(self, inst): - self.assertEqual(inst.abatementDateTime.date, FHIRDate("2013-03-20").date) + self.assertEqual(inst.abatementDateTime.date, fhirdate.FHIRDateTime("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") @@ -47,9 +46,9 @@ def implCondition1(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -115,7 +114,7 @@ def implCondition3(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.onsetDateTime.date, FHIRDate("2010-07-18").date) + self.assertEqual(inst.onsetDateTime.date, fhirdate.FHIRDateTime("2010-07-18").date) self.assertEqual(inst.onsetDateTime.as_json(), "2010-07-18") self.assertEqual(inst.text.div, "
Ischemic stroke, July 18, 2010
") self.assertEqual(inst.text.status, "generated") @@ -151,9 +150,9 @@ def implCondition4(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.onsetDateTime.date, FHIRDate("2011-05-05").date) + self.assertEqual(inst.onsetDateTime.date, fhirdate.FHIRDateTime("2011-05-05").date) self.assertEqual(inst.onsetDateTime.as_json(), "2011-05-05") - self.assertEqual(inst.recordedDate.date, FHIRDate("2012-06-03").date) + self.assertEqual(inst.recordedDate.date, fhirdate.FHIRDateTime("2012-06-03").date) self.assertEqual(inst.recordedDate.as_json(), "2012-06-03") self.assertEqual(inst.severity.coding[0].code, "24484000") self.assertEqual(inst.severity.coding[0].display, "Severe") @@ -196,9 +195,9 @@ def implCondition5(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.onsetDateTime.date, FHIRDate("2013-03-08").date) + self.assertEqual(inst.onsetDateTime.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -238,7 +237,7 @@ def implCondition6(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.onsetDateTime.date, FHIRDate("2012-05-24").date) + self.assertEqual(inst.onsetDateTime.date, fhirdate.FHIRDateTime("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") @@ -303,9 +302,9 @@ def implCondition8(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.onsetDateTime.date, FHIRDate("2012-02-27").date) + self.assertEqual(inst.onsetDateTime.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -334,7 +333,7 @@ def implCondition9(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.recordedDate.date, FHIRDate("2013-04-04").date) + self.assertEqual(inst.recordedDate.date, fhirdate.FHIRDateTime("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, "differential") @@ -370,9 +369,9 @@ def implCondition10(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.onsetDateTime.date, FHIRDate("2011-08-05").date) + self.assertEqual(inst.onsetDateTime.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/consent_test.py b/tests/models/consent_test.py index 746c3ab99..02a96bd5b 100644 --- a/tests/models/consent_test.py +++ b/tests/models/consent_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import consent -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, consent class ConsentTests(unittest.TestCase): @@ -29,7 +28,7 @@ def testConsent1(self): def implConsent1(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.date, fhirdate.FHIRDateTime("2015-11-18").date) self.assertEqual(inst.dateTime.as_json(), "2015-11-18") self.assertEqual(inst.id, "consent-example-Out") self.assertEqual(inst.meta.tag[0].code, "HTEST") @@ -58,7 +57,7 @@ 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-05-11").date) + self.assertEqual(inst.dateTime.date, fhirdate.FHIRDateTime("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") @@ -66,9 +65,9 @@ def implConsent2(self, inst): 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-01-01").date) + self.assertEqual(inst.provision.period.end.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -89,7 +88,7 @@ def testConsent3(self): def implConsent3(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) + self.assertEqual(inst.dateTime.date, fhirdate.FHIRDateTime("2016-05-26T00:41:10-04:00").date) self.assertEqual(inst.dateTime.as_json(), "2016-05-26T00:41:10-04:00") self.assertEqual(inst.id, "consent-example-signature") self.assertEqual(inst.identifier[0].system, "urn:oid:2.16.840.1.113883.3.72.5.9.1") @@ -101,9 +100,9 @@ def implConsent3(self, inst): self.assertEqual(inst.policyRule.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") 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.period.end.date, FHIRDate("2016-10-10").date) + self.assertEqual(inst.provision.period.end.date, fhirdate.FHIRDateTime("2016-10-10").date) self.assertEqual(inst.provision.period.end.as_json(), "2016-10-10") - self.assertEqual(inst.provision.period.start.date, FHIRDate("2015-10-10").date) + self.assertEqual(inst.provision.period.start.date, fhirdate.FHIRDateTime("2015-10-10").date) self.assertEqual(inst.provision.period.start.as_json(), "2015-10-10") self.assertEqual(inst.provision.provision[0].actor[0].role.coding[0].code, "AUT") self.assertEqual(inst.provision.provision[0].actor[0].role.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") @@ -132,7 +131,7 @@ def testConsent4(self): 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) + self.assertEqual(inst.dateTime.date, fhirdate.FHIRDateTime("2015-11-18").date) self.assertEqual(inst.dateTime.as_json(), "2015-11-18") self.assertEqual(inst.id, "consent-example-grantor") self.assertEqual(inst.meta.tag[0].code, "HTEST") @@ -165,7 +164,7 @@ def testConsent5(self): 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("2016-06-23T17:02:33+10:00").date) + self.assertEqual(inst.dateTime.date, fhirdate.FHIRDateTime("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") @@ -173,9 +172,9 @@ def implConsent5(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -200,7 +199,7 @@ def testConsent6(self): 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) + self.assertEqual(inst.dateTime.date, fhirdate.FHIRDateTime("2016-06-16").date) self.assertEqual(inst.dateTime.as_json(), "2016-06-16") self.assertEqual(inst.id, "consent-example-pkb") self.assertEqual(inst.meta.tag[0].code, "HTEST") @@ -292,7 +291,7 @@ def testConsent7(self): 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.date, fhirdate.FHIRDateTime("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") @@ -300,9 +299,9 @@ def implConsent7(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -323,7 +322,7 @@ def testConsent8(self): 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.date, fhirdate.FHIRDateTime("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") @@ -352,7 +351,7 @@ def testConsent9(self): 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.date, fhirdate.FHIRDateTime("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") @@ -380,7 +379,7 @@ def testConsent10(self): def implConsent10(self, inst): 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.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/contract_test.py b/tests/models/contract_test.py index b985e1e3c..4505d3114 100644 --- a/tests/models/contract_test.py +++ b/tests/models/contract_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import contract -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, contract class ContractTests(unittest.TestCase): @@ -29,7 +28,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-notThis") - self.assertEqual(inst.issued.date, FHIRDate("2015-11-18").date) + self.assertEqual(inst.issued.date, fhirdate.FHIRDateTime("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") @@ -38,11 +37,11 @@ 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -65,7 +64,7 @@ def testContract2(self): def implContract2(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.date, fhirdate.FHIRDateTime("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") @@ -102,7 +101,7 @@ def testContract3(self): 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.date, fhirdate.FHIRDateTime("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") @@ -132,7 +131,7 @@ def testContract4(self): 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.date, fhirdate.FHIRDateTime("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") @@ -160,18 +159,18 @@ def testContract5(self): 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.date, fhirdate.FHIRDateTime("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") self.assertEqual(inst.contentDerivative.coding[0].system, "http://terminology.hl7.org/CodeSystem/contract-content-derivative") self.assertEqual(inst.id, "C-2121") - self.assertEqual(inst.issued.date, FHIRDate("2013-11-01T21:18:27-04:00").date) + self.assertEqual(inst.issued.date, fhirdate.FHIRDateTime("2013-11-01T21:18:27-04:00").date) self.assertEqual(inst.issued.as_json(), "2013-11-01T21:18:27-04:00") self.assertEqual(inst.legal[0].contentAttachment.contentType, "application/pdf") self.assertEqual(inst.legal[0].contentAttachment.language, "en-US") self.assertEqual(inst.legal[0].contentAttachment.title, "MDHHS-5515 Consent To Share Your Health Information") self.assertEqual(inst.legal[0].contentAttachment.url, "http://org.mihin.ecms/ConsentDirective-2121") - self.assertEqual(inst.meta.lastUpdated.date, FHIRDate("2016-07-19T18:18:42.108-04:00").date) + self.assertEqual(inst.meta.lastUpdated.date, fhirdate.FHIRInstant("2016-07-19T18:18:42.108-04:00").date) self.assertEqual(inst.meta.lastUpdated.as_json(), "2016-07-19T18:18:42.108-04:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") @@ -179,7 +178,7 @@ def implContract5(self, inst): self.assertEqual(inst.meta.versionId, "1") 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("2017-02-08T10:57:34+01:00").date) + self.assertEqual(inst.signer[0].signature[0].when.date, fhirdate.FHIRInstant("2017-02-08T10:57:34+01:00").date) self.assertEqual(inst.signer[0].signature[0].when.as_json(), "2017-02-08T10:57:34+01:00") self.assertEqual(inst.signer[0].type.code, "SELF") self.assertEqual(inst.signer[0].type.system, "http://mdhhs.org/fhir/consent-signer-type") @@ -199,9 +198,9 @@ def implContract5(self, inst): self.assertEqual(inst.term[0].action[0].subject[1].role.text, "Sender of restricted health information") self.assertEqual(inst.term[0].action[0].type.coding[0].code, "action-a") self.assertEqual(inst.term[0].action[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/contractaction") - self.assertEqual(inst.term[0].asset[0].period[0].end.date, FHIRDate("2019-11-01T21:18:27-04:00").date) + self.assertEqual(inst.term[0].asset[0].period[0].end.date, fhirdate.FHIRDateTime("2019-11-01T21:18:27-04:00").date) self.assertEqual(inst.term[0].asset[0].period[0].end.as_json(), "2019-11-01T21:18:27-04:00") - self.assertEqual(inst.term[0].asset[0].period[0].start.date, FHIRDate("2013-11-01T21:18:27-04:00").date) + self.assertEqual(inst.term[0].asset[0].period[0].start.date, fhirdate.FHIRDateTime("2013-11-01T21:18:27-04:00").date) self.assertEqual(inst.term[0].asset[0].period[0].start.as_json(), "2013-11-01T21:18:27-04:00") self.assertEqual(inst.term[0].offer.decision.coding[0].code, "OPTIN") self.assertEqual(inst.term[0].offer.decision.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") @@ -224,7 +223,7 @@ def testContract6(self): self.implContract6(inst2) def implContract6(self, inst): - self.assertEqual(inst.applies.start.date, FHIRDate("2017-01-01").date) + self.assertEqual(inst.applies.start.date, fhirdate.FHIRDateTime("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") @@ -232,12 +231,12 @@ def implContract6(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.term[0].asset[0].period[0].start.date, FHIRDate("2017-06-01").date) + self.assertEqual(inst.term[0].asset[0].period[0].start.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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) @@ -289,12 +288,12 @@ def implContract7(self, inst): self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.rule[0].contentAttachment.contentType, "application/txt") self.assertEqual(inst.rule[0].contentAttachment.url, "http://www.rfc-editor.org/bcp/bcp13.txt") - 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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) @@ -323,7 +322,7 @@ 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-notThem") - self.assertEqual(inst.issued.date, FHIRDate("2015-11-18").date) + self.assertEqual(inst.issued.date, fhirdate.FHIRDateTime("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") @@ -331,7 +330,7 @@ def implContract8(self, inst): 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.date, fhirdate.FHIRInstant("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") diff --git a/tests/models/coverage_test.py b/tests/models/coverage_test.py index 785a52a05..2ec83928e 100644 --- a/tests/models/coverage_test.py +++ b/tests/models/coverage_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import coverage -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, coverage class CoverageTests(unittest.TestCase): @@ -70,9 +69,9 @@ def implCoverage1(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.period.end.date, FHIRDate("2012-05-23").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -99,7 +98,7 @@ def implCoverage2(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.period.end.date, FHIRDate("2012-03-17").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("2012-03-17").date) self.assertEqual(inst.period.end.as_json(), "2012-03-17") self.assertEqual(inst.relationship.coding[0].code, "self") self.assertEqual(inst.status, "active") @@ -126,7 +125,7 @@ def implCoverage3(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.period.end.date, FHIRDate("2012-03-17").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("2012-03-17").date) self.assertEqual(inst.period.end.as_json(), "2012-03-17") self.assertEqual(inst.relationship.coding[0].code, "self") self.assertEqual(inst.status, "active") @@ -159,9 +158,9 @@ def implCoverage4(self, inst): 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, "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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -178,9 +177,9 @@ def implCoverage4(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/coverageeligibilityrequest_test.py b/tests/models/coverageeligibilityrequest_test.py index 307ab1b18..5105f65b8 100644 --- a/tests/models/coverageeligibilityrequest_test.py +++ b/tests/models/coverageeligibilityrequest_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import coverageeligibilityrequest -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, coverageeligibilityrequest class CoverageEligibilityRequestTests(unittest.TestCase): @@ -27,7 +26,7 @@ def testCoverageEligibilityRequest1(self): self.implCoverageEligibilityRequest1(inst2) def implCoverageEligibilityRequest1(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("2014-08-16").date) self.assertEqual(inst.created.as_json(), "2014-08-16") self.assertEqual(inst.id, "52345") self.assertEqual(inst.identifier[0].system, "http://happyvalley.com/coverageelegibilityrequest") @@ -53,7 +52,7 @@ def testCoverageEligibilityRequest2(self): self.implCoverageEligibilityRequest2(inst2) def implCoverageEligibilityRequest2(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("2014-08-16").date) self.assertEqual(inst.created.as_json(), "2014-08-16") self.assertEqual(inst.id, "52346") self.assertEqual(inst.identifier[0].system, "http://happyvalley.com/coverageelegibilityrequest") @@ -68,7 +67,7 @@ def implCoverageEligibilityRequest2(self, inst): self.assertEqual(inst.priority.coding[0].code, "normal") 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.date, fhirdate.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 CoverageEligibilityRequest
") diff --git a/tests/models/coverageeligibilityresponse_test.py b/tests/models/coverageeligibilityresponse_test.py index eecba157e..0b201576b 100644 --- a/tests/models/coverageeligibilityresponse_test.py +++ b/tests/models/coverageeligibilityresponse_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import coverageeligibilityresponse -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, coverageeligibilityresponse class CoverageEligibilityResponseTests(unittest.TestCase): @@ -27,7 +26,7 @@ def testCoverageEligibilityResponse1(self): self.implCoverageEligibilityResponse1(inst2) def implCoverageEligibilityResponse1(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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.id, "E2500") @@ -54,7 +53,7 @@ def testCoverageEligibilityResponse2(self): self.implCoverageEligibilityResponse2(inst2) def implCoverageEligibilityResponse2(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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.id, "E2501") @@ -134,7 +133,7 @@ def implCoverageEligibilityResponse2(self, inst): 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.date, fhirdate.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.
") @@ -152,7 +151,7 @@ def testCoverageEligibilityResponse3(self): 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.date, fhirdate.FHIRDateTime("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.form.coding[0].code, "ELRSP/2017/01") @@ -231,7 +230,7 @@ def testCoverageEligibilityResponse4(self): self.implCoverageEligibilityResponse4(inst2) def implCoverageEligibilityResponse4(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-09-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/detectedissue_test.py b/tests/models/detectedissue_test.py index eeba20395..d1977318c 100644 --- a/tests/models/detectedissue_test.py +++ b/tests/models/detectedissue_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import detectedissue -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, detectedissue class DetectedIssueTests(unittest.TestCase): @@ -70,7 +69,7 @@ def implDetectedIssue3(self, inst): self.assertEqual(inst.code.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") self.assertEqual(inst.detail, "Similar test was performed within the past 14 days") self.assertEqual(inst.id, "duplicate") - self.assertEqual(inst.identifiedDateTime.date, FHIRDate("2013-05-08").date) + self.assertEqual(inst.identifiedDateTime.date, fhirdate.FHIRDateTime("2013-05-08").date) self.assertEqual(inst.identifiedDateTime.as_json(), "2013-05-08") self.assertEqual(inst.identifier[0].system, "http://example.org") self.assertEqual(inst.identifier[0].use, "official") @@ -97,7 +96,7 @@ def implDetectedIssue4(self, inst): self.assertEqual(inst.code.coding[0].display, "Drug Interaction Alert") self.assertEqual(inst.code.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") self.assertEqual(inst.id, "ddi") - self.assertEqual(inst.identifiedDateTime.date, FHIRDate("2014-01-05").date) + self.assertEqual(inst.identifiedDateTime.date, fhirdate.FHIRDateTime("2014-01-05").date) self.assertEqual(inst.identifiedDateTime.as_json(), "2014-01-05") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") @@ -106,7 +105,7 @@ def implDetectedIssue4(self, inst): self.assertEqual(inst.mitigation[0].action.coding[0].display, "Stopped Concurrent Therapy") self.assertEqual(inst.mitigation[0].action.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActCode") self.assertEqual(inst.mitigation[0].action.text, "Asked patient to discontinue regular use of Tylenol and to consult with clinician if they need to resume to allow appropriate INR monitoring") - self.assertEqual(inst.mitigation[0].date.date, FHIRDate("2014-01-05").date) + self.assertEqual(inst.mitigation[0].date.date, fhirdate.FHIRDateTime("2014-01-05").date) self.assertEqual(inst.mitigation[0].date.as_json(), "2014-01-05") self.assertEqual(inst.severity, "high") self.assertEqual(inst.status, "final") diff --git a/tests/models/device_test.py b/tests/models/device_test.py index 752e9bdff..45fd1e8ea 100644 --- a/tests/models/device_test.py +++ b/tests/models/device_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import device -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, device class DeviceTests(unittest.TestCase): diff --git a/tests/models/devicedefinition_test.py b/tests/models/devicedefinition_test.py index 47d8c9cfa..853ce6175 100644 --- a/tests/models/devicedefinition_test.py +++ b/tests/models/devicedefinition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import devicedefinition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, devicedefinition class DeviceDefinitionTests(unittest.TestCase): diff --git a/tests/models/devicemetric_test.py b/tests/models/devicemetric_test.py index 8b5f50a0b..3fcbb4a29 100644 --- a/tests/models/devicemetric_test.py +++ b/tests/models/devicemetric_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import devicemetric -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, devicemetric class DeviceMetricTests(unittest.TestCase): @@ -28,7 +27,7 @@ def testDeviceMetric1(self): def implDeviceMetric1(self, inst): self.assertEqual(inst.calibration[0].state, "calibrated") - self.assertEqual(inst.calibration[0].time.date, FHIRDate("2016-12-28T09:03:04-05:00").date) + self.assertEqual(inst.calibration[0].time.date, fhirdate.FHIRInstant("2016-12-28T09:03:04-05:00").date) self.assertEqual(inst.calibration[0].time.as_json(), "2016-12-28T09:03:04-05:00") self.assertEqual(inst.calibration[0].type, "two-point") self.assertEqual(inst.category, "measurement") diff --git a/tests/models/devicerequest_test.py b/tests/models/devicerequest_test.py index 2a5d6f529..2ced675ee 100644 --- a/tests/models/devicerequest_test.py +++ b/tests/models/devicerequest_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import devicerequest -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, devicerequest class DeviceRequestTests(unittest.TestCase): @@ -27,7 +26,7 @@ def testDeviceRequest1(self): self.implDeviceRequest1(inst2) def implDeviceRequest1(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2013-05-08T09:33:27+07:00").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("2013-05-08T09:33:27+07:00").date) self.assertEqual(inst.authoredOn.as_json(), "2013-05-08T09:33:27+07:00") self.assertEqual(inst.codeCodeableConcept.coding[0].code, "43148-6") self.assertEqual(inst.codeCodeableConcept.coding[0].system, "http://loinc.org") @@ -41,7 +40,7 @@ def implDeviceRequest1(self, inst): 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 is the right device brand and model") - self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2013-05-08T09:33:27+07:00").date) + self.assertEqual(inst.occurrenceDateTime.date, fhirdate.FHIRDateTime("2013-05-08T09:33:27+07:00").date) self.assertEqual(inst.occurrenceDateTime.as_json(), "2013-05-08T09:33:27+07:00") self.assertEqual(inst.performerType.coding[0].display, "Qualified nurse") self.assertEqual(inst.performerType.text, "Nurse") diff --git a/tests/models/deviceusestatement_test.py b/tests/models/deviceusestatement_test.py index ac65378c7..bf4bed521 100644 --- a/tests/models/deviceusestatement_test.py +++ b/tests/models/deviceusestatement_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import deviceusestatement -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, deviceusestatement class DeviceUseStatementTests(unittest.TestCase): diff --git a/tests/models/diagnosticreport_test.py b/tests/models/diagnosticreport_test.py index 356ffc4b9..84cbac9f4 100644 --- a/tests/models/diagnosticreport_test.py +++ b/tests/models/diagnosticreport_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import diagnosticreport -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, diagnosticreport class DiagnosticReportTests(unittest.TestCase): @@ -31,16 +30,16 @@ def implDiagnosticReport1(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRInstant("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.date, fhirdate.FHIRDateTime("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") @@ -62,10 +61,10 @@ def testDiagnosticReport2(self): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRInstant("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") @@ -97,10 +96,10 @@ def implDiagnosticReport3(self, inst): self.assertEqual(inst.conclusionCode[0].coding[0].code, "188340000") self.assertEqual(inst.conclusionCode[0].coding[0].display, "Malignant tumor of craniopharyngeal duct") self.assertEqual(inst.conclusionCode[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.effectiveDateTime.date, FHIRDate("2012-12-01T12:00:00+01:00").date) + self.assertEqual(inst.effectiveDateTime.date, fhirdate.FHIRDateTime("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, "f201") - self.assertEqual(inst.issued.date, FHIRDate("2012-12-01T12:00:00+01:00").date) + self.assertEqual(inst.issued.date, fhirdate.FHIRInstant("2012-12-01T12:00:00+01:00").date) self.assertEqual(inst.issued.as_json(), "2012-12-01T12:00:00+01:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") @@ -129,10 +128,10 @@ def implDiagnosticReport4(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRInstant("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") @@ -160,12 +159,12 @@ def implDiagnosticReport5(self, inst): self.assertEqual(inst.code.coding[0].display, "Biopsy without Microscopic Description (1 Site/Lesion)-Standard") self.assertEqual(inst.code.coding[0].system, "https://www.acmeonline.com") self.assertEqual(inst.code.text, "Biopsy without Microscopic Description (1 Site/Lesion)-Standard") - self.assertEqual(inst.effectiveDateTime.date, FHIRDate("2017-03-02").date) + self.assertEqual(inst.effectiveDateTime.date, fhirdate.FHIRDateTime("2017-03-02").date) self.assertEqual(inst.effectiveDateTime.as_json(), "2017-03-02") self.assertEqual(inst.id, "gingival-mass") self.assertEqual(inst.identifier[0].system, "https://www.acmeonline.com") self.assertEqual(inst.identifier[0].value, "P73456090") - self.assertEqual(inst.issued.date, FHIRDate("2017-03-15T08:13:08Z").date) + self.assertEqual(inst.issued.date, fhirdate.FHIRInstant("2017-03-15T08:13:08Z").date) self.assertEqual(inst.issued.as_json(), "2017-03-15T08:13:08Z") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") @@ -193,10 +192,10 @@ def implDiagnosticReport6(self, inst): self.assertEqual(inst.conclusionCode[0].coding[0].code, "391040000") self.assertEqual(inst.conclusionCode[0].coding[0].display, "At risk of osteoporotic fracture") self.assertEqual(inst.conclusionCode[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.effectiveDateTime.date, FHIRDate("2008-06-17").date) + self.assertEqual(inst.effectiveDateTime.date, fhirdate.FHIRDateTime("2008-06-17").date) self.assertEqual(inst.effectiveDateTime.as_json(), "2008-06-17") self.assertEqual(inst.id, "102") - self.assertEqual(inst.issued.date, FHIRDate("2008-06-18T09:23:00+10:00").date) + self.assertEqual(inst.issued.date, fhirdate.FHIRInstant("2008-06-18T09:23:00+10:00").date) self.assertEqual(inst.issued.as_json(), "2008-06-18T09:23:00+10:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") diff --git a/tests/models/documentmanifest_test.py b/tests/models/documentmanifest_test.py index c5f4cd914..6d3036b8e 100644 --- a/tests/models/documentmanifest_test.py +++ b/tests/models/documentmanifest_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import documentmanifest -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, documentmanifest class DocumentManifestTests(unittest.TestCase): @@ -28,7 +27,7 @@ def testDocumentManifest1(self): def implDocumentManifest1(self, inst): self.assertEqual(inst.contained[0].id, "a1") - self.assertEqual(inst.created.date, FHIRDate("2004-12-25T23:50:50-05:00").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("2004-12-25T23:50:50-05:00").date) self.assertEqual(inst.created.as_json(), "2004-12-25T23:50:50-05:00") self.assertEqual(inst.description, "Physical") self.assertEqual(inst.id, "example") diff --git a/tests/models/documentreference_test.py b/tests/models/documentreference_test.py index 9403d9f84..d2ccd0f2f 100644 --- a/tests/models/documentreference_test.py +++ b/tests/models/documentreference_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import documentreference -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, documentreference class DocumentReferenceTests(unittest.TestCase): @@ -32,7 +31,7 @@ def implDocumentReference1(self, inst): self.assertEqual(inst.category[0].coding[0].system, "http://ihe.net/xds/connectathon/classCodes") self.assertEqual(inst.contained[0].id, "a2") self.assertEqual(inst.content[0].attachment.contentType, "application/hl7-v3+xml") - self.assertEqual(inst.content[0].attachment.creation.date, FHIRDate("2005-12-24T09:35:00+11:00").date) + self.assertEqual(inst.content[0].attachment.creation.date, fhirdate.FHIRDateTime("2005-12-24T09:35:00+11:00").date) self.assertEqual(inst.content[0].attachment.creation.as_json(), "2005-12-24T09:35:00+11:00") self.assertEqual(inst.content[0].attachment.hash, "2jmj7l5rSw0yVb/vlWAYkK/YBwk=") self.assertEqual(inst.content[0].attachment.language, "en-US") @@ -48,14 +47,14 @@ def implDocumentReference1(self, inst): self.assertEqual(inst.context.facilityType.coding[0].code, "Outpatient") self.assertEqual(inst.context.facilityType.coding[0].display, "Outpatient") self.assertEqual(inst.context.facilityType.coding[0].system, "http://www.ihe.net/xds/connectathon/healthcareFacilityTypeCodes") - self.assertEqual(inst.context.period.end.date, FHIRDate("2004-12-23T08:01:00+11:00").date) + self.assertEqual(inst.context.period.end.date, fhirdate.FHIRDateTime("2004-12-23T08:01:00+11:00").date) self.assertEqual(inst.context.period.end.as_json(), "2004-12-23T08:01:00+11:00") - self.assertEqual(inst.context.period.start.date, FHIRDate("2004-12-23T08:00:00+11:00").date) + self.assertEqual(inst.context.period.start.date, fhirdate.FHIRDateTime("2004-12-23T08:00:00+11:00").date) self.assertEqual(inst.context.period.start.as_json(), "2004-12-23T08:00:00+11:00") self.assertEqual(inst.context.practiceSetting.coding[0].code, "General Medicine") self.assertEqual(inst.context.practiceSetting.coding[0].display, "General Medicine") self.assertEqual(inst.context.practiceSetting.coding[0].system, "http://www.ihe.net/xds/connectathon/practiceSettingCodes") - self.assertEqual(inst.date.date, FHIRDate("2005-12-24T09:43:41+11:00").date) + self.assertEqual(inst.date.date, fhirdate.FHIRInstant("2005-12-24T09:43:41+11:00").date) self.assertEqual(inst.date.as_json(), "2005-12-24T09:43:41+11:00") self.assertEqual(inst.description, "Physical") self.assertEqual(inst.docStatus, "preliminary") diff --git a/tests/models/effectevidencesynthesis_test.py b/tests/models/effectevidencesynthesis_test.py index 3f690156d..ffd150a40 100644 --- a/tests/models/effectevidencesynthesis_test.py +++ b/tests/models/effectevidencesynthesis_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import effectevidencesynthesis -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, effectevidencesynthesis class EffectEvidenceSynthesisTests(unittest.TestCase): diff --git a/tests/models/encounter_test.py b/tests/models/encounter_test.py index 09a3d995f..96a5dc552 100644 --- a/tests/models/encounter_test.py +++ b/tests/models/encounter_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import encounter -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, encounter class EncounterTests(unittest.TestCase): @@ -164,14 +163,14 @@ 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -180,56 +179,56 @@ def implEncounter4(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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
") @@ -251,21 +250,21 @@ def implEncounter5(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.participant[0].period.end.date, FHIRDate("2015-01-17T16:30:00+10:00").date) + self.assertEqual(inst.participant[0].period.end.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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
") @@ -340,16 +339,16 @@ def implEncounter7(self, inst): self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.participant[0].type[0].coding[0].code, "PART") self.assertEqual(inst.participant[0].type[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") - self.assertEqual(inst.period.end.date, FHIRDate("2013-03-20").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("2013-03-20").date) self.assertEqual(inst.period.end.as_json(), "2013-03-20") - self.assertEqual(inst.period.start.date, FHIRDate("2013-03-11").date) + self.assertEqual(inst.period.start.date, fhirdate.FHIRDateTime("2013-03-11").date) self.assertEqual(inst.period.start.as_json(), "2013-03-11") self.assertEqual(inst.priority.coding[0].code, "394849002") self.assertEqual(inst.priority.coding[0].display, "High priority") self.assertEqual(inst.priority.coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.reasonCode[0].text, "The patient seems to suffer from bilateral pneumonia and renal insufficiency, most likely due to chemotherapy.") self.assertEqual(inst.status, "finished") - self.assertEqual(inst.statusHistory[0].period.start.date, FHIRDate("2013-03-08").date) + self.assertEqual(inst.statusHistory[0].period.start.date, fhirdate.FHIRDateTime("2013-03-08").date) self.assertEqual(inst.statusHistory[0].period.start.as_json(), "2013-03-08") self.assertEqual(inst.statusHistory[0].status, "arrived") self.assertEqual(inst.text.status, "generated") diff --git a/tests/models/endpoint_test.py b/tests/models/endpoint_test.py index 781c14c80..b1eec5154 100644 --- a/tests/models/endpoint_test.py +++ b/tests/models/endpoint_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import endpoint -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, endpoint class EndpointTests(unittest.TestCase): @@ -44,7 +43,7 @@ def implEndpoint1(self, inst): 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.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/enrollmentrequest_test.py b/tests/models/enrollmentrequest_test.py index 210c7dab6..b063206fe 100644 --- a/tests/models/enrollmentrequest_test.py +++ b/tests/models/enrollmentrequest_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import enrollmentrequest -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, enrollmentrequest class EnrollmentRequestTests(unittest.TestCase): @@ -27,7 +26,7 @@ def testEnrollmentRequest1(self): self.implEnrollmentRequest1(inst2) def implEnrollmentRequest1(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("2014-08-16").date) self.assertEqual(inst.created.as_json(), "2014-08-16") self.assertEqual(inst.id, "22345") self.assertEqual(inst.identifier[0].system, "http://happyvalley.com/enrollmentrequest") diff --git a/tests/models/enrollmentresponse_test.py b/tests/models/enrollmentresponse_test.py index 9826dc5d6..8050b4fe2 100644 --- a/tests/models/enrollmentresponse_test.py +++ b/tests/models/enrollmentresponse_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import enrollmentresponse -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, enrollmentresponse class EnrollmentResponseTests(unittest.TestCase): @@ -27,7 +26,7 @@ def testEnrollmentResponse1(self): self.implEnrollmentResponse1(inst2) def implEnrollmentResponse1(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("2014-08-16").date) self.assertEqual(inst.created.as_json(), "2014-08-16") self.assertEqual(inst.disposition, "Dependant added to policy.") self.assertEqual(inst.id, "ER2500") diff --git a/tests/models/episodeofcare_test.py b/tests/models/episodeofcare_test.py index 374c3ebca..7bb7a7a3b 100644 --- a/tests/models/episodeofcare_test.py +++ b/tests/models/episodeofcare_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import episodeofcare -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, episodeofcare class EpisodeOfCareTests(unittest.TestCase): @@ -37,25 +36,25 @@ def implEpisodeOfCare1(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.period.start.date, FHIRDate("2014-09-01").date) + self.assertEqual(inst.period.start.date, fhirdate.FHIRDateTime("2014-09-01").date) self.assertEqual(inst.period.start.as_json(), "2014-09-01") self.assertEqual(inst.status, "active") - self.assertEqual(inst.statusHistory[0].period.end.date, FHIRDate("2014-09-14").date) + self.assertEqual(inst.statusHistory[0].period.end.date, fhirdate.FHIRDateTime("2014-09-14").date) self.assertEqual(inst.statusHistory[0].period.end.as_json(), "2014-09-14") - self.assertEqual(inst.statusHistory[0].period.start.date, FHIRDate("2014-09-01").date) + self.assertEqual(inst.statusHistory[0].period.start.date, fhirdate.FHIRDateTime("2014-09-01").date) self.assertEqual(inst.statusHistory[0].period.start.as_json(), "2014-09-01") self.assertEqual(inst.statusHistory[0].status, "planned") - self.assertEqual(inst.statusHistory[1].period.end.date, FHIRDate("2014-09-21").date) + self.assertEqual(inst.statusHistory[1].period.end.date, fhirdate.FHIRDateTime("2014-09-21").date) self.assertEqual(inst.statusHistory[1].period.end.as_json(), "2014-09-21") - self.assertEqual(inst.statusHistory[1].period.start.date, FHIRDate("2014-09-15").date) + self.assertEqual(inst.statusHistory[1].period.start.date, fhirdate.FHIRDateTime("2014-09-15").date) self.assertEqual(inst.statusHistory[1].period.start.as_json(), "2014-09-15") self.assertEqual(inst.statusHistory[1].status, "active") - self.assertEqual(inst.statusHistory[2].period.end.date, FHIRDate("2014-09-24").date) + self.assertEqual(inst.statusHistory[2].period.end.date, fhirdate.FHIRDateTime("2014-09-24").date) self.assertEqual(inst.statusHistory[2].period.end.as_json(), "2014-09-24") - self.assertEqual(inst.statusHistory[2].period.start.date, FHIRDate("2014-09-22").date) + self.assertEqual(inst.statusHistory[2].period.start.date, fhirdate.FHIRDateTime("2014-09-22").date) self.assertEqual(inst.statusHistory[2].period.start.as_json(), "2014-09-22") self.assertEqual(inst.statusHistory[2].status, "onhold") - self.assertEqual(inst.statusHistory[3].period.start.date, FHIRDate("2014-09-25").date) + self.assertEqual(inst.statusHistory[3].period.start.date, fhirdate.FHIRDateTime("2014-09-25").date) self.assertEqual(inst.statusHistory[3].period.start.as_json(), "2014-09-25") self.assertEqual(inst.statusHistory[3].status, "active") self.assertEqual(inst.text.status, "generated") diff --git a/tests/models/eventdefinition_test.py b/tests/models/eventdefinition_test.py index 07bd4c79a..bdc175f68 100644 --- a/tests/models/eventdefinition_test.py +++ b/tests/models/eventdefinition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import eventdefinition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, eventdefinition class EventDefinitionTests(unittest.TestCase): diff --git a/tests/models/evidence_test.py b/tests/models/evidence_test.py index d82b6ead6..a874a4c24 100644 --- a/tests/models/evidence_test.py +++ b/tests/models/evidence_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import evidence -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, evidence class EvidenceTests(unittest.TestCase): diff --git a/tests/models/evidencevariable_test.py b/tests/models/evidencevariable_test.py index bcdcb98bb..af3583856 100644 --- a/tests/models/evidencevariable_test.py +++ b/tests/models/evidencevariable_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import evidencevariable -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, evidencevariable class EvidenceVariableTests(unittest.TestCase): diff --git a/tests/models/examplescenario_test.py b/tests/models/examplescenario_test.py index ce70cee18..3fc7b8625 100644 --- a/tests/models/examplescenario_test.py +++ b/tests/models/examplescenario_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import examplescenario -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, examplescenario class ExampleScenarioTests(unittest.TestCase): diff --git a/tests/models/explanationofbenefit_test.py b/tests/models/explanationofbenefit_test.py index 4a601c027..e901d6d14 100644 --- a/tests/models/explanationofbenefit_test.py +++ b/tests/models/explanationofbenefit_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import explanationofbenefit -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, explanationofbenefit class ExplanationOfBenefitTests(unittest.TestCase): @@ -27,15 +26,15 @@ 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.date, fhirdate.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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -49,7 +48,7 @@ def implExplanationOfBenefit1(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -67,16 +66,16 @@ def implExplanationOfBenefit1(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -101,7 +100,7 @@ def testExplanationOfBenefit2(self): 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.date, fhirdate.FHIRDateTime("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, "EB3500") @@ -122,7 +121,7 @@ def implExplanationOfBenefit2(self, inst): self.assertEqual(inst.item[0].productOrService.coding[0].code, "1205") self.assertEqual(inst.item[0].productOrService.coding[0].system, "http://terminology.hl7.org/CodeSystem/ex-USCLS") 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.date, fhirdate.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) @@ -156,7 +155,7 @@ def implExplanationOfBenefit2(self, inst): self.assertEqual(inst.item[1].net.value, 200.0) self.assertEqual(inst.item[1].productOrService.coding[0].code, "group") 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.date, fhirdate.FHIRDate("2014-08-16").date) self.assertEqual(inst.item[1].servicedDate.as_json(), "2014-08-16") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") diff --git a/tests/models/familymemberhistory_test.py b/tests/models/familymemberhistory_test.py index e5df437cd..53d0419ca 100644 --- a/tests/models/familymemberhistory_test.py +++ b/tests/models/familymemberhistory_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import familymemberhistory -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, familymemberhistory class FamilyMemberHistoryTests(unittest.TestCase): @@ -37,7 +36,7 @@ def implFamilyMemberHistory1(self, inst): self.assertEqual(inst.condition[0].onsetAge.system, "http://unitsofmeasure.org") self.assertEqual(inst.condition[0].onsetAge.unit, "yr") self.assertEqual(inst.condition[0].onsetAge.value, 74) - self.assertEqual(inst.date.date, FHIRDate("2011-03-18").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2011-03-18").date) self.assertEqual(inst.date.as_json(), "2011-03-18") self.assertEqual(inst.id, "father") self.assertEqual(inst.identifier[0].value, "12345") diff --git a/tests/models/flag_test.py b/tests/models/flag_test.py index c1170cbb4..be67db949 100644 --- a/tests/models/flag_test.py +++ b/tests/models/flag_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import flag -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, flag class FlagTests(unittest.TestCase): @@ -40,9 +39,9 @@ def implFlag1(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.period.end.date, FHIRDate("2016-12-01").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("2016-12-01").date) self.assertEqual(inst.period.end.as_json(), "2016-12-01") - self.assertEqual(inst.period.start.date, FHIRDate("2015-01-17").date) + self.assertEqual(inst.period.start.date, fhirdate.FHIRDateTime("2015-01-17").date) self.assertEqual(inst.period.start.as_json(), "2015-01-17") self.assertEqual(inst.status, "inactive") self.assertEqual(inst.text.div, "
Large Dog warning for Peter Patient
") diff --git a/tests/models/goal_test.py b/tests/models/goal_test.py index 1dfc537a2..672b746c9 100644 --- a/tests/models/goal_test.py +++ b/tests/models/goal_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import goal -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, goal class GoalTests(unittest.TestCase): @@ -40,9 +39,9 @@ def implGoal1(self, inst): self.assertEqual(inst.priority.coding[0].display, "High Priority") self.assertEqual(inst.priority.coding[0].system, "http://terminology.hl7.org/CodeSystem/goal-priority") self.assertEqual(inst.priority.text, "high") - self.assertEqual(inst.startDate.date, FHIRDate("2015-04-05").date) + self.assertEqual(inst.startDate.date, fhirdate.FHIRDate("2015-04-05").date) self.assertEqual(inst.startDate.as_json(), "2015-04-05") - self.assertEqual(inst.statusDate.date, FHIRDate("2016-02-14").date) + self.assertEqual(inst.statusDate.date, fhirdate.FHIRDate("2016-02-14").date) self.assertEqual(inst.statusDate.as_json(), "2016-02-14") self.assertEqual(inst.statusReason, "Patient wants to defer weight loss until after honeymoon.") self.assertEqual(inst.target[0].detailRange.high.code, "[lb_av]") @@ -53,7 +52,7 @@ def implGoal1(self, inst): self.assertEqual(inst.target[0].detailRange.low.system, "http://unitsofmeasure.org") self.assertEqual(inst.target[0].detailRange.low.unit, "lbs") self.assertEqual(inst.target[0].detailRange.low.value, 160) - self.assertEqual(inst.target[0].dueDate.date, FHIRDate("2016-04-05").date) + self.assertEqual(inst.target[0].dueDate.date, fhirdate.FHIRDate("2016-04-05").date) self.assertEqual(inst.target[0].dueDate.as_json(), "2016-04-05") self.assertEqual(inst.target[0].measure.coding[0].code, "3141-9") self.assertEqual(inst.target[0].measure.coding[0].display, "Weight Measured") @@ -86,7 +85,7 @@ def implGoal2(self, inst): self.assertEqual(inst.outcomeCode[0].coding[0].display, "Ex-smoker (finding)") self.assertEqual(inst.outcomeCode[0].coding[0].system, "http://snomed.info/sct") self.assertEqual(inst.outcomeCode[0].text, "Former smoker") - self.assertEqual(inst.startDate.date, FHIRDate("2015-04-05").date) + self.assertEqual(inst.startDate.date, fhirdate.FHIRDate("2015-04-05").date) self.assertEqual(inst.startDate.as_json(), "2015-04-05") self.assertEqual(inst.text.status, "additional") diff --git a/tests/models/graphdefinition_test.py b/tests/models/graphdefinition_test.py index dac2dcaf4..299717d81 100644 --- a/tests/models/graphdefinition_test.py +++ b/tests/models/graphdefinition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import graphdefinition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, graphdefinition class GraphDefinitionTests(unittest.TestCase): @@ -29,7 +28,7 @@ def testGraphDefinition1(self): def implGraphDefinition1(self, inst): 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("2015-08-04").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2015-08-04").date) self.assertEqual(inst.date.as_json(), "2015-08-04") self.assertEqual(inst.description, "Specify to include list references when generating a document using the $document operation") self.assertEqual(inst.id, "example") diff --git a/tests/models/group_test.py b/tests/models/group_test.py index 10fa3f392..183b14e00 100644 --- a/tests/models/group_test.py +++ b/tests/models/group_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import group -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, group class GroupTests(unittest.TestCase): @@ -94,14 +93,14 @@ def testGroup3(self): 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) + self.assertEqual(inst.member[0].period.start.date, fhirdate.FHIRDateTime("2014-10-08").date) self.assertEqual(inst.member[0].period.start.as_json(), "2014-10-08") self.assertTrue(inst.member[1].inactive) - self.assertEqual(inst.member[1].period.start.date, FHIRDate("2015-04-02").date) + self.assertEqual(inst.member[1].period.start.date, fhirdate.FHIRDateTime("2015-04-02").date) self.assertEqual(inst.member[1].period.start.as_json(), "2015-04-02") - self.assertEqual(inst.member[2].period.start.date, FHIRDate("2015-08-06").date) + self.assertEqual(inst.member[2].period.start.date, fhirdate.FHIRDateTime("2015-08-06").date) self.assertEqual(inst.member[2].period.start.as_json(), "2015-08-06") - self.assertEqual(inst.member[3].period.start.date, FHIRDate("2015-08-06").date) + self.assertEqual(inst.member[3].period.start.date, fhirdate.FHIRDateTime("2015-08-06").date) self.assertEqual(inst.member[3].period.start.as_json(), "2015-08-06") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") diff --git a/tests/models/guidanceresponse_test.py b/tests/models/guidanceresponse_test.py index 01821d9c6..feb88bca8 100644 --- a/tests/models/guidanceresponse_test.py +++ b/tests/models/guidanceresponse_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import guidanceresponse -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, guidanceresponse class GuidanceResponseTests(unittest.TestCase): @@ -35,7 +34,7 @@ def implGuidanceResponse1(self, inst): 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.moduleUri, "http://someguidelineprovider.org/radiology-appropriateness-guidelines.html") - self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2017-03-10T16:02:00Z").date) + self.assertEqual(inst.occurrenceDateTime.date, fhirdate.FHIRDateTime("2017-03-10T16:02:00Z").date) self.assertEqual(inst.occurrenceDateTime.as_json(), "2017-03-10T16:02:00Z") self.assertEqual(inst.reasonCode[0].text, "Guideline Appropriate Ordering Assessment") self.assertEqual(inst.requestIdentifier.system, "http://example.org") diff --git a/tests/models/healthcareservice_test.py b/tests/models/healthcareservice_test.py index 9f691fed9..21f2ed7b5 100644 --- a/tests/models/healthcareservice_test.py +++ b/tests/models/healthcareservice_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import healthcareservice -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, healthcareservice class HealthcareServiceTests(unittest.TestCase): @@ -32,17 +31,17 @@ def implHealthcareService1(self, inst): self.assertEqual(inst.availabilityExceptions, "Reduced capacity is available during the Christmas period") self.assertTrue(inst.availableTime[0].allDay) self.assertEqual(inst.availableTime[0].daysOfWeek[0], "wed") - self.assertEqual(inst.availableTime[1].availableEndTime.date, FHIRDate("05:30:00").date) + self.assertEqual(inst.availableTime[1].availableEndTime.date, fhirdate.FHIRTime("05:30:00").date) self.assertEqual(inst.availableTime[1].availableEndTime.as_json(), "05:30:00") - self.assertEqual(inst.availableTime[1].availableStartTime.date, FHIRDate("08:30:00").date) + self.assertEqual(inst.availableTime[1].availableStartTime.date, fhirdate.FHIRTime("08:30:00").date) self.assertEqual(inst.availableTime[1].availableStartTime.as_json(), "08:30:00") self.assertEqual(inst.availableTime[1].daysOfWeek[0], "mon") self.assertEqual(inst.availableTime[1].daysOfWeek[1], "tue") self.assertEqual(inst.availableTime[1].daysOfWeek[2], "thu") self.assertEqual(inst.availableTime[1].daysOfWeek[3], "fri") - self.assertEqual(inst.availableTime[2].availableEndTime.date, FHIRDate("04:30:00").date) + self.assertEqual(inst.availableTime[2].availableEndTime.date, fhirdate.FHIRTime("04:30:00").date) self.assertEqual(inst.availableTime[2].availableEndTime.as_json(), "04:30:00") - self.assertEqual(inst.availableTime[2].availableStartTime.date, FHIRDate("09:30:00").date) + self.assertEqual(inst.availableTime[2].availableStartTime.date, fhirdate.FHIRTime("09:30:00").date) self.assertEqual(inst.availableTime[2].availableStartTime.as_json(), "09:30:00") self.assertEqual(inst.availableTime[2].daysOfWeek[0], "sat") self.assertEqual(inst.availableTime[2].daysOfWeek[1], "fri") @@ -63,14 +62,14 @@ def implHealthcareService1(self, inst): self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.name, "Consulting psychologists and/or psychology services") self.assertEqual(inst.notAvailable[0].description, "Christmas/Boxing Day") - self.assertEqual(inst.notAvailable[0].during.end.date, FHIRDate("2015-12-26").date) + self.assertEqual(inst.notAvailable[0].during.end.date, fhirdate.FHIRDateTime("2015-12-26").date) self.assertEqual(inst.notAvailable[0].during.end.as_json(), "2015-12-26") - self.assertEqual(inst.notAvailable[0].during.start.date, FHIRDate("2015-12-25").date) + self.assertEqual(inst.notAvailable[0].during.start.date, fhirdate.FHIRDateTime("2015-12-25").date) self.assertEqual(inst.notAvailable[0].during.start.as_json(), "2015-12-25") self.assertEqual(inst.notAvailable[1].description, "New Years Day") - self.assertEqual(inst.notAvailable[1].during.end.date, FHIRDate("2016-01-01").date) + self.assertEqual(inst.notAvailable[1].during.end.date, fhirdate.FHIRDateTime("2016-01-01").date) self.assertEqual(inst.notAvailable[1].during.end.as_json(), "2016-01-01") - self.assertEqual(inst.notAvailable[1].during.start.date, FHIRDate("2016-01-01").date) + self.assertEqual(inst.notAvailable[1].during.start.date, fhirdate.FHIRDateTime("2016-01-01").date) self.assertEqual(inst.notAvailable[1].during.start.as_json(), "2016-01-01") self.assertEqual(inst.program[0].text, "PTSD outreach") self.assertEqual(inst.referralMethod[0].coding[0].code, "phone") diff --git a/tests/models/imagingstudy_test.py b/tests/models/imagingstudy_test.py index 638e24ae9..a07b1fc85 100644 --- a/tests/models/imagingstudy_test.py +++ b/tests/models/imagingstudy_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import imagingstudy -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, imagingstudy class ImagingStudyTests(unittest.TestCase): @@ -48,7 +47,7 @@ def implImagingStudy1(self, inst): 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.date, fhirdate.FHIRDateTime("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.
") @@ -113,10 +112,10 @@ def implImagingStudy2(self, inst): self.assertEqual(inst.series[0].numberOfInstances, 2) self.assertEqual(inst.series[0].performer[0].function.coding[0].code, "PRF") self.assertEqual(inst.series[0].performer[0].function.coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ParticipationType") - self.assertEqual(inst.series[0].started.date, FHIRDate("2011-01-01T11:01:20+03:00").date) + self.assertEqual(inst.series[0].started.date, fhirdate.FHIRDateTime("2011-01-01T11:01:20+03:00").date) self.assertEqual(inst.series[0].started.as_json(), "2011-01-01T11:01:20+03:00") self.assertEqual(inst.series[0].uid, "2.16.124.113543.6003.1154777499.30246.19789.3503430045.1") - self.assertEqual(inst.started.date, FHIRDate("2017-01-01T11:01:20+03:00").date) + self.assertEqual(inst.started.date, fhirdate.FHIRDateTime("2017-01-01T11:01:20+03:00").date) self.assertEqual(inst.started.as_json(), "2017-01-01T11:01:20+03:00") 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.
") diff --git a/tests/models/immunization_test.py b/tests/models/immunization_test.py index 579ce6f55..eac565764 100644 --- a/tests/models/immunization_test.py +++ b/tests/models/immunization_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import immunization -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, immunization class ImmunizationTests(unittest.TestCase): @@ -30,7 +29,7 @@ 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.expirationDate.date, FHIRDate("2018-12-15").date) + self.assertEqual(inst.expirationDate.date, fhirdate.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") @@ -42,7 +41,7 @@ def implImmunization1(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.occurrenceDateTime.date, FHIRDate("2018-06-18").date) + self.assertEqual(inst.occurrenceDateTime.date, fhirdate.FHIRDateTime("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") @@ -86,11 +85,11 @@ def implImmunization2(self, inst): self.assertEqual(inst.doseQuantity.system, "http://unitsofmeasure.org") 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.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") @@ -103,7 +102,7 @@ def implImmunization2(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -141,7 +140,7 @@ def implImmunization3(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.occurrenceDateTime.date, FHIRDate("2013-01-10").date) + self.assertEqual(inst.occurrenceDateTime.date, fhirdate.FHIRDateTime("2013-01-10").date) self.assertEqual(inst.occurrenceDateTime.as_json(), "2013-01-10") self.assertTrue(inst.primarySource) self.assertEqual(inst.status, "not-done") @@ -197,11 +196,11 @@ def implImmunization5(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.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") @@ -214,7 +213,7 @@ def implImmunization5(self, inst): 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.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/immunizationevaluation_test.py b/tests/models/immunizationevaluation_test.py index 1d6826932..c58621f8a 100644 --- a/tests/models/immunizationevaluation_test.py +++ b/tests/models/immunizationevaluation_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import immunizationevaluation -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, immunizationevaluation class ImmunizationEvaluationTests(unittest.TestCase): @@ -27,7 +26,7 @@ def testImmunizationEvaluation1(self): self.implImmunizationEvaluation1(inst2) def implImmunizationEvaluation1(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2013-01-10").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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") @@ -60,7 +59,7 @@ def testImmunizationEvaluation2(self): self.implImmunizationEvaluation2(inst2) def implImmunizationEvaluation2(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2013-01-10").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/immunizationrecommendation_test.py b/tests/models/immunizationrecommendation_test.py index cce84eb73..b5b6e1bf3 100644 --- a/tests/models/immunizationrecommendation_test.py +++ b/tests/models/immunizationrecommendation_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import immunizationrecommendation -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, immunizationrecommendation class ImmunizationRecommendationTests(unittest.TestCase): @@ -27,7 +26,7 @@ def testImmunizationRecommendation1(self): self.implImmunizationRecommendation1(inst2) def implImmunizationRecommendation1(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2015-02-09T11:04:15.817-05:00").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2015-02-09T11:04:15.817-05:00").date) self.assertEqual(inst.date.as_json(), "2015-02-09T11:04:15.817-05:00") self.assertEqual(inst.id, "example") self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") @@ -38,17 +37,17 @@ def implImmunizationRecommendation1(self, inst): self.assertEqual(inst.recommendation[0].dateCriterion[0].code.coding[0].code, "earliest") self.assertEqual(inst.recommendation[0].dateCriterion[0].code.coding[0].display, "Earliest Date") self.assertEqual(inst.recommendation[0].dateCriterion[0].code.coding[0].system, "http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion") - self.assertEqual(inst.recommendation[0].dateCriterion[0].value.date, FHIRDate("2015-12-01T00:00:00-05:00").date) + self.assertEqual(inst.recommendation[0].dateCriterion[0].value.date, fhirdate.FHIRDateTime("2015-12-01T00:00:00-05:00").date) self.assertEqual(inst.recommendation[0].dateCriterion[0].value.as_json(), "2015-12-01T00:00:00-05:00") self.assertEqual(inst.recommendation[0].dateCriterion[1].code.coding[0].code, "recommended") self.assertEqual(inst.recommendation[0].dateCriterion[1].code.coding[0].display, "Recommended") self.assertEqual(inst.recommendation[0].dateCriterion[1].code.coding[0].system, "http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion") - self.assertEqual(inst.recommendation[0].dateCriterion[1].value.date, FHIRDate("2015-12-01T00:00:00-05:00").date) + self.assertEqual(inst.recommendation[0].dateCriterion[1].value.date, fhirdate.FHIRDateTime("2015-12-01T00:00:00-05:00").date) self.assertEqual(inst.recommendation[0].dateCriterion[1].value.as_json(), "2015-12-01T00:00:00-05:00") self.assertEqual(inst.recommendation[0].dateCriterion[2].code.coding[0].code, "overdue") self.assertEqual(inst.recommendation[0].dateCriterion[2].code.coding[0].display, "Past Due Date") self.assertEqual(inst.recommendation[0].dateCriterion[2].code.coding[0].system, "http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion") - self.assertEqual(inst.recommendation[0].dateCriterion[2].value.date, FHIRDate("2016-12-28T00:00:00-05:00").date) + self.assertEqual(inst.recommendation[0].dateCriterion[2].value.date, fhirdate.FHIRDateTime("2016-12-28T00:00:00-05:00").date) self.assertEqual(inst.recommendation[0].dateCriterion[2].value.as_json(), "2016-12-28T00:00:00-05:00") self.assertEqual(inst.recommendation[0].description, "First sequence in protocol") self.assertEqual(inst.recommendation[0].doseNumberPositiveInt, 1) @@ -72,7 +71,7 @@ def testImmunizationRecommendation2(self): self.implImmunizationRecommendation2(inst2) def implImmunizationRecommendation2(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2015-02-09T11:04:15.817-05:00").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2015-02-09T11:04:15.817-05:00").date) self.assertEqual(inst.date.as_json(), "2015-02-09T11:04:15.817-05:00") self.assertEqual(inst.id, "example") self.assertEqual(inst.identifier[0].system, "urn:ietf:rfc:3986") @@ -83,17 +82,17 @@ def implImmunizationRecommendation2(self, inst): self.assertEqual(inst.recommendation[0].dateCriterion[0].code.coding[0].code, "30981-5") self.assertEqual(inst.recommendation[0].dateCriterion[0].code.coding[0].display, "Earliest date to give") self.assertEqual(inst.recommendation[0].dateCriterion[0].code.coding[0].system, "http://loinc.org") - self.assertEqual(inst.recommendation[0].dateCriterion[0].value.date, FHIRDate("2015-12-01T00:00:00-05:00").date) + self.assertEqual(inst.recommendation[0].dateCriterion[0].value.date, fhirdate.FHIRDateTime("2015-12-01T00:00:00-05:00").date) self.assertEqual(inst.recommendation[0].dateCriterion[0].value.as_json(), "2015-12-01T00:00:00-05:00") self.assertEqual(inst.recommendation[0].dateCriterion[1].code.coding[0].code, "recommended") self.assertEqual(inst.recommendation[0].dateCriterion[1].code.coding[0].display, "Recommended") self.assertEqual(inst.recommendation[0].dateCriterion[1].code.coding[0].system, "http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion") - self.assertEqual(inst.recommendation[0].dateCriterion[1].value.date, FHIRDate("2015-12-01T00:00:00-05:00").date) + self.assertEqual(inst.recommendation[0].dateCriterion[1].value.date, fhirdate.FHIRDateTime("2015-12-01T00:00:00-05:00").date) self.assertEqual(inst.recommendation[0].dateCriterion[1].value.as_json(), "2015-12-01T00:00:00-05:00") self.assertEqual(inst.recommendation[0].dateCriterion[2].code.coding[0].code, "overdue") self.assertEqual(inst.recommendation[0].dateCriterion[2].code.coding[0].display, "Past Due Date") self.assertEqual(inst.recommendation[0].dateCriterion[2].code.coding[0].system, "http://example.org/fhir/CodeSystem/immunization-recommendation-date-criterion") - self.assertEqual(inst.recommendation[0].dateCriterion[2].value.date, FHIRDate("2016-12-28T00:00:00-05:00").date) + self.assertEqual(inst.recommendation[0].dateCriterion[2].value.date, fhirdate.FHIRDateTime("2016-12-28T00:00:00-05:00").date) self.assertEqual(inst.recommendation[0].dateCriterion[2].value.as_json(), "2016-12-28T00:00:00-05:00") self.assertEqual(inst.recommendation[0].description, "First sequence in protocol") self.assertEqual(inst.recommendation[0].doseNumberPositiveInt, 1) diff --git a/tests/models/implementationguide_test.py b/tests/models/implementationguide_test.py index 5bf8ae423..f8f33b27d 100644 --- a/tests/models/implementationguide_test.py +++ b/tests/models/implementationguide_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import implementationguide -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, implementationguide class ImplementationGuideTests(unittest.TestCase): @@ -34,7 +33,7 @@ def implImplementationGuide1(self, inst): self.assertEqual(inst.contact[1].telecom[0].system, "url") self.assertEqual(inst.contact[1].telecom[0].value, "http://hl7.org/fhir") self.assertEqual(inst.copyright, "Published by ONC under the standard FHIR license (CC0)") - self.assertEqual(inst.date.date, FHIRDate("2015-01-01").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2015-01-01").date) self.assertEqual(inst.date.as_json(), "2015-01-01") self.assertEqual(inst.definition.grouping[0].description, "Base package (not broken up into multiple packages)") self.assertEqual(inst.definition.grouping[0].name, "test") diff --git a/tests/models/insuranceplan_test.py b/tests/models/insuranceplan_test.py index c0a1c3d56..c8e09fa31 100644 --- a/tests/models/insuranceplan_test.py +++ b/tests/models/insuranceplan_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import insuranceplan -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, insuranceplan class InsurancePlanTests(unittest.TestCase): diff --git a/tests/models/invoice_test.py b/tests/models/invoice_test.py index c47be212a..ccf3309cc 100644 --- a/tests/models/invoice_test.py +++ b/tests/models/invoice_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import invoice -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, invoice class InvoiceTests(unittest.TestCase): @@ -27,7 +26,7 @@ def testInvoice1(self): self.implInvoice1(inst2) def implInvoice1(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2017-01-25T08:00:00+01:00").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2017-01-25T08:00:00+01:00").date) self.assertEqual(inst.date.as_json(), "2017-01-25T08:00:00+01:00") self.assertEqual(inst.id, "example") self.assertEqual(inst.identifier[0].system, "http://myHospital.org/Invoices") diff --git a/tests/models/library_test.py b/tests/models/library_test.py index 7b12d7524..733ee3c3a 100644 --- a/tests/models/library_test.py +++ b/tests/models/library_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import library -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, library class LibraryTests(unittest.TestCase): @@ -67,7 +66,7 @@ def implLibrary1(self, inst): self.assertEqual(inst.dataRequirement[7].codeFilter[1].path, "medication.code") self.assertEqual(inst.dataRequirement[7].codeFilter[1].valueSet, "urn:oid:2.16.840.1.113883.3.464.1003.196.12.1001") self.assertEqual(inst.dataRequirement[7].type, "MedicationStatement") - self.assertEqual(inst.date.date, FHIRDate("2015-07-22").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2015-07-22").date) self.assertEqual(inst.date.as_json(), "2015-07-22") self.assertEqual(inst.description, "Logic for CMS 146: Appropriate Testing for Children with Pharyngitis") self.assertEqual(inst.id, "library-cms146-example") @@ -98,7 +97,7 @@ def implLibrary2(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.date, fhirdate.FHIRDateTime("2016-11-14").date) self.assertEqual(inst.date.as_json(), "2016-11-14") self.assertEqual(inst.description, "FHIR Helpers") self.assertTrue(inst.experimental) @@ -130,7 +129,7 @@ def testLibrary3(self): self.implLibrary3(inst2) def implLibrary3(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2017-03-10").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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") self.assertEqual(inst.id, "composition-example") @@ -177,7 +176,7 @@ def implLibrary4(self, inst): 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.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/linkage_test.py b/tests/models/linkage_test.py index 6db78dfca..102fec01b 100644 --- a/tests/models/linkage_test.py +++ b/tests/models/linkage_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import linkage -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, linkage class LinkageTests(unittest.TestCase): diff --git a/tests/models/list_test.py b/tests/models/list_test.py index dd0534f74..fc2a065d5 100644 --- a/tests/models/list_test.py +++ b/tests/models/list_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import list -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, list class ListTests(unittest.TestCase): @@ -114,7 +113,7 @@ def implList4(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.date, fhirdate.FHIRDateTime("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") @@ -135,7 +134,7 @@ def testList5(self): self.implList5(inst2) def implList5(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2018-02-21T12:17:00+11:00").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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") @@ -156,7 +155,7 @@ def testList6(self): self.implList6(inst2) def implList6(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2012-11-25T22:17:00+11:00").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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") @@ -186,7 +185,7 @@ def implList7(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -215,7 +214,7 @@ def implList8(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -279,7 +278,7 @@ def implList10(self, inst): 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.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/location_test.py b/tests/models/location_test.py index 868c0ae4a..fe18bc0cb 100644 --- a/tests/models/location_test.py +++ b/tests/models/location_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import location -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, location class LocationTests(unittest.TestCase): diff --git a/tests/models/measure_test.py b/tests/models/measure_test.py index 80c67366b..8a4c3bda8 100644 --- a/tests/models/measure_test.py +++ b/tests/models/measure_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import measure -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, measure class MeasureTests(unittest.TestCase): @@ -57,17 +56,17 @@ def testMeasure2(self): self.implMeasure2(inst2) def implMeasure2(self, inst): - self.assertEqual(inst.approvalDate.date, FHIRDate("2016-01-01").date) + self.assertEqual(inst.approvalDate.date, fhirdate.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") self.assertEqual(inst.contact[0].telecom[0].system, "url") self.assertEqual(inst.contact[0].telecom[0].value, "http://www.ncqa.org/") - self.assertEqual(inst.date.date, FHIRDate("2017-03-10").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2017-03-10").date) self.assertEqual(inst.date.as_json(), "2017-03-10") self.assertEqual(inst.description, "Percentage of children 3-18 years of age who were diagnosed with pharyngitis, ordered an antibiotic and received a group A streptococcus (strep) test for the episode.") - self.assertEqual(inst.effectivePeriod.end.date, FHIRDate("2017-12-31").date) + self.assertEqual(inst.effectivePeriod.end.date, fhirdate.FHIRDateTime("2017-12-31").date) self.assertEqual(inst.effectivePeriod.end.as_json(), "2017-12-31") - self.assertEqual(inst.effectivePeriod.start.date, FHIRDate("2017-01-01").date) + self.assertEqual(inst.effectivePeriod.start.date, fhirdate.FHIRDateTime("2017-01-01").date) self.assertEqual(inst.effectivePeriod.start.as_json(), "2017-01-01") self.assertTrue(inst.experimental) self.assertEqual(inst.group[0].id, "CMS146-group-1") @@ -104,7 +103,7 @@ def implMeasure2(self, inst): self.assertEqual(inst.improvementNotation.coding[0].system, "http://terminology.hl7.org/CodeSystem/measure-improvement-notation") 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-09-01").date) + self.assertEqual(inst.lastReviewDate.date, fhirdate.FHIRDate("2016-09-01").date) self.assertEqual(inst.lastReviewDate.as_json(), "2016-09-01") self.assertEqual(inst.library[0], "Library/library-cms146-example") self.assertEqual(inst.name, "CMS146") @@ -180,7 +179,7 @@ def testMeasure4(self): self.implMeasure4(inst2) def implMeasure4(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2014-03-08").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/measurereport_test.py b/tests/models/measurereport_test.py index fe13e3d98..221723a80 100644 --- a/tests/models/measurereport_test.py +++ b/tests/models/measurereport_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import measurereport -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, measurereport class MeasureReportTests(unittest.TestCase): @@ -28,7 +27,7 @@ def testMeasureReport1(self): def implMeasureReport1(self, inst): self.assertEqual(inst.contained[0].id, "reporter") - self.assertEqual(inst.date.date, FHIRDate("2014-04-01").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2014-04-01").date) self.assertEqual(inst.date.as_json(), "2014-04-01") self.assertEqual(inst.group[0].id, "CMS146-group-1") self.assertEqual(inst.group[0].population[0].code.coding[0].code, "initial-population") @@ -120,9 +119,9 @@ def implMeasureReport1(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.period.end.date, FHIRDate("2014-03-31").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("2014-03-31").date) self.assertEqual(inst.period.end.as_json(), "2014-03-31") - self.assertEqual(inst.period.start.date, FHIRDate("2014-01-01").date) + self.assertEqual(inst.period.start.date, fhirdate.FHIRDateTime("2014-01-01").date) self.assertEqual(inst.period.start.as_json(), "2014-01-01") self.assertEqual(inst.status, "complete") self.assertEqual(inst.text.status, "generated") @@ -140,7 +139,7 @@ def testMeasureReport2(self): def implMeasureReport2(self, inst): self.assertEqual(inst.contained[0].id, "reporter") - self.assertEqual(inst.date.date, FHIRDate("2014-04-01").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2014-04-01").date) self.assertEqual(inst.date.as_json(), "2014-04-01") self.assertEqual(inst.group[0].id, "CMS146-group-1") self.assertEqual(inst.group[0].population[0].code.coding[0].code, "initial-population") @@ -232,9 +231,9 @@ def implMeasureReport2(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.period.end.date, FHIRDate("2014-03-31").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("2014-03-31").date) self.assertEqual(inst.period.end.as_json(), "2014-03-31") - self.assertEqual(inst.period.start.date, FHIRDate("2014-01-01").date) + self.assertEqual(inst.period.start.date, fhirdate.FHIRDateTime("2014-01-01").date) self.assertEqual(inst.period.start.as_json(), "2014-01-01") self.assertEqual(inst.status, "complete") self.assertEqual(inst.text.status, "generated") @@ -252,7 +251,7 @@ def testMeasureReport3(self): def implMeasureReport3(self, inst): self.assertEqual(inst.contained[0].id, "reporter") - self.assertEqual(inst.date.date, FHIRDate("2014-04-01").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2014-04-01").date) self.assertEqual(inst.date.as_json(), "2014-04-01") self.assertEqual(inst.group[0].id, "CMS146-group-1") self.assertEqual(inst.group[0].population[0].code.coding[0].code, "initial-population") @@ -344,9 +343,9 @@ def implMeasureReport3(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.period.end.date, FHIRDate("2014-03-31").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("2014-03-31").date) self.assertEqual(inst.period.end.as_json(), "2014-03-31") - self.assertEqual(inst.period.start.date, FHIRDate("2014-01-01").date) + self.assertEqual(inst.period.start.date, fhirdate.FHIRDateTime("2014-01-01").date) self.assertEqual(inst.period.start.as_json(), "2014-01-01") self.assertEqual(inst.status, "complete") self.assertEqual(inst.text.status, "generated") diff --git a/tests/models/media_test.py b/tests/models/media_test.py index f843d3298..d20b5d32f 100644 --- a/tests/models/media_test.py +++ b/tests/models/media_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import media -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, media class MediaTests(unittest.TestCase): @@ -31,11 +30,11 @@ def implMedia1(self, inst): 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.date, fhirdate.FHIRDateTime("2016-03-15").date) self.assertEqual(inst.content.creation.as_json(), "2016-03-15") 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.date, fhirdate.FHIRDateTime("2016-03-15").date) self.assertEqual(inst.createdDateTime.as_json(), "2016-03-15") self.assertEqual(inst.height, 432) self.assertEqual(inst.id, "xray") @@ -103,15 +102,15 @@ def testMedia3(self): def implMedia3(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.date, fhirdate.FHIRDateTime("2009-09-03").date) self.assertEqual(inst.content.creation.as_json(), "2009-09-03") self.assertEqual(inst.content.id, "a1") - self.assertEqual(inst.createdDateTime.date, FHIRDate("2017-12-17").date) + self.assertEqual(inst.createdDateTime.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRInstant("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") diff --git a/tests/models/medicationknowledge_test.py b/tests/models/medicationknowledge_test.py index 5197ed44a..43abdc96e 100644 --- a/tests/models/medicationknowledge_test.py +++ b/tests/models/medicationknowledge_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import medicationknowledge -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, medicationknowledge class MedicationKnowledgeTests(unittest.TestCase): diff --git a/tests/models/medicinalproduct_test.py b/tests/models/medicinalproduct_test.py index 299c2f065..59d80383c 100644 --- a/tests/models/medicinalproduct_test.py +++ b/tests/models/medicinalproduct_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import medicinalproduct -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, medicinalproduct class MedicinalProductTests(unittest.TestCase): @@ -32,7 +31,7 @@ def implMedicinalProduct1(self, inst): self.assertEqual(inst.identifier[0].value, "{mpid}") self.assertEqual(inst.manufacturingBusinessOperation[0].authorisationReferenceNumber.system, "http://ema.europa.eu/example/manufacturingAuthorisationReferenceNumber") self.assertEqual(inst.manufacturingBusinessOperation[0].authorisationReferenceNumber.value, "1324TZ") - self.assertEqual(inst.manufacturingBusinessOperation[0].effectiveDate.date, FHIRDate("2013-03-15").date) + self.assertEqual(inst.manufacturingBusinessOperation[0].effectiveDate.date, fhirdate.FHIRDateTime("2013-03-15").date) self.assertEqual(inst.manufacturingBusinessOperation[0].effectiveDate.as_json(), "2013-03-15") self.assertEqual(inst.manufacturingBusinessOperation[0].operationType.coding[0].code, "Batchrelease") self.assertEqual(inst.manufacturingBusinessOperation[0].operationType.coding[0].system, "http://ema.europa.eu/example/manufacturingOperationType") diff --git a/tests/models/medicinalproductauthorization_test.py b/tests/models/medicinalproductauthorization_test.py index 572ca9d74..130e994b1 100644 --- a/tests/models/medicinalproductauthorization_test.py +++ b/tests/models/medicinalproductauthorization_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import medicinalproductauthorization -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, medicinalproductauthorization class MedicinalProductAuthorizationTests(unittest.TestCase): @@ -29,16 +28,16 @@ def testMedicinalProductAuthorization1(self): def implMedicinalProductAuthorization1(self, inst): self.assertEqual(inst.country[0].coding[0].code, "EU") self.assertEqual(inst.country[0].coding[0].system, "http://ema.europa.eu/example/country") - self.assertEqual(inst.dataExclusivityPeriod.end.date, FHIRDate("2020-08-15").date) + self.assertEqual(inst.dataExclusivityPeriod.end.date, fhirdate.FHIRDateTime("2020-08-15").date) self.assertEqual(inst.dataExclusivityPeriod.end.as_json(), "2020-08-15") - self.assertEqual(inst.dataExclusivityPeriod.start.date, FHIRDate("2010-08-15").date) + self.assertEqual(inst.dataExclusivityPeriod.start.date, fhirdate.FHIRDateTime("2010-08-15").date) self.assertEqual(inst.dataExclusivityPeriod.start.as_json(), "2010-08-15") - self.assertEqual(inst.dateOfFirstAuthorization.date, FHIRDate("2010-08-15").date) + self.assertEqual(inst.dateOfFirstAuthorization.date, fhirdate.FHIRDateTime("2010-08-15").date) self.assertEqual(inst.dateOfFirstAuthorization.as_json(), "2010-08-15") self.assertEqual(inst.id, "example") self.assertEqual(inst.identifier[0].system, "http://ema.europa.eu/example/marketingAuthorisationNumber") self.assertEqual(inst.identifier[0].value, "EU/1/11/999/001") - self.assertEqual(inst.internationalBirthDate.date, FHIRDate("2010-08-15").date) + self.assertEqual(inst.internationalBirthDate.date, fhirdate.FHIRDateTime("2010-08-15").date) self.assertEqual(inst.internationalBirthDate.as_json(), "2010-08-15") self.assertEqual(inst.jurisdictionalAuthorization[0].country.coding[0].code, "NO") self.assertEqual(inst.jurisdictionalAuthorization[0].country.coding[0].system, "http://ema.europa.eu/example/countryCode") @@ -53,15 +52,15 @@ def implMedicinalProductAuthorization1(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.procedure.application[0].dateDateTime.date, FHIRDate("2015-08-01").date) + self.assertEqual(inst.procedure.application[0].dateDateTime.date, fhirdate.FHIRDateTime("2015-08-01").date) self.assertEqual(inst.procedure.application[0].dateDateTime.as_json(), "2015-08-01") self.assertEqual(inst.procedure.application[0].identifier.system, "http://ema.europa.eu/example/applicationidentifier-number") self.assertEqual(inst.procedure.application[0].identifier.value, "IA38G") self.assertEqual(inst.procedure.application[0].type.coding[0].code, "GroupTypeIAVariationNotification") self.assertEqual(inst.procedure.application[0].type.coding[0].system, "http://ema.europa.eu/example/marketingAuthorisationApplicationType") - self.assertEqual(inst.procedure.datePeriod.end.date, FHIRDate("2015-08-21").date) + self.assertEqual(inst.procedure.datePeriod.end.date, fhirdate.FHIRDateTime("2015-08-21").date) self.assertEqual(inst.procedure.datePeriod.end.as_json(), "2015-08-21") - self.assertEqual(inst.procedure.datePeriod.start.date, FHIRDate("2015-08-02").date) + self.assertEqual(inst.procedure.datePeriod.start.date, fhirdate.FHIRDateTime("2015-08-02").date) self.assertEqual(inst.procedure.datePeriod.start.as_json(), "2015-08-02") self.assertEqual(inst.procedure.identifier.system, "http://ema.europa.eu/example/procedureidentifier-number") self.assertEqual(inst.procedure.identifier.value, "EMEA/H/C/009999/IA/0099/G") @@ -69,11 +68,11 @@ def implMedicinalProductAuthorization1(self, inst): self.assertEqual(inst.procedure.type.coding[0].system, "http://ema.europa.eu/example/marketingAuthorisationProcedureType") self.assertEqual(inst.status.coding[0].code, "active") self.assertEqual(inst.status.coding[0].system, "http://ema.europa.eu/example/authorisationstatus") - self.assertEqual(inst.statusDate.date, FHIRDate("2015-01-14").date) + self.assertEqual(inst.statusDate.date, fhirdate.FHIRDateTime("2015-01-14").date) self.assertEqual(inst.statusDate.as_json(), "2015-01-14") self.assertEqual(inst.text.status, "generated") - self.assertEqual(inst.validityPeriod.end.date, FHIRDate("2020-05-20").date) + self.assertEqual(inst.validityPeriod.end.date, fhirdate.FHIRDateTime("2020-05-20").date) self.assertEqual(inst.validityPeriod.end.as_json(), "2020-05-20") - self.assertEqual(inst.validityPeriod.start.date, FHIRDate("2015-08-16").date) + self.assertEqual(inst.validityPeriod.start.date, fhirdate.FHIRDateTime("2015-08-16").date) self.assertEqual(inst.validityPeriod.start.as_json(), "2015-08-16") diff --git a/tests/models/medicinalproductcontraindication_test.py b/tests/models/medicinalproductcontraindication_test.py index f01624648..a298d57b7 100644 --- a/tests/models/medicinalproductcontraindication_test.py +++ b/tests/models/medicinalproductcontraindication_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import medicinalproductcontraindication -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, medicinalproductcontraindication class MedicinalProductContraindicationTests(unittest.TestCase): diff --git a/tests/models/medicinalproductindication_test.py b/tests/models/medicinalproductindication_test.py index a443fed1a..7301609c4 100644 --- a/tests/models/medicinalproductindication_test.py +++ b/tests/models/medicinalproductindication_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import medicinalproductindication -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, medicinalproductindication class MedicinalProductIndicationTests(unittest.TestCase): diff --git a/tests/models/medicinalproductingredient_test.py b/tests/models/medicinalproductingredient_test.py index 3f9693482..2b2f8bfa7 100644 --- a/tests/models/medicinalproductingredient_test.py +++ b/tests/models/medicinalproductingredient_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import medicinalproductingredient -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, medicinalproductingredient class MedicinalProductIngredientTests(unittest.TestCase): diff --git a/tests/models/medicinalproductinteraction_test.py b/tests/models/medicinalproductinteraction_test.py index 8f2969c48..6f897a3e4 100644 --- a/tests/models/medicinalproductinteraction_test.py +++ b/tests/models/medicinalproductinteraction_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import medicinalproductinteraction -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, medicinalproductinteraction class MedicinalProductInteractionTests(unittest.TestCase): diff --git a/tests/models/medicinalproductmanufactured_test.py b/tests/models/medicinalproductmanufactured_test.py index a9659ed29..1cb9453a6 100644 --- a/tests/models/medicinalproductmanufactured_test.py +++ b/tests/models/medicinalproductmanufactured_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import medicinalproductmanufactured -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, medicinalproductmanufactured class MedicinalProductManufacturedTests(unittest.TestCase): diff --git a/tests/models/medicinalproductpackaged_test.py b/tests/models/medicinalproductpackaged_test.py index 5199906ec..704d9cce1 100644 --- a/tests/models/medicinalproductpackaged_test.py +++ b/tests/models/medicinalproductpackaged_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import medicinalproductpackaged -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, medicinalproductpackaged class MedicinalProductPackagedTests(unittest.TestCase): @@ -27,7 +26,7 @@ def testMedicinalProductPackaged1(self): self.implMedicinalProductPackaged1(inst2) def implMedicinalProductPackaged1(self, inst): - self.assertEqual(inst.batchIdentifier[0].outerPackaging.period.end.date, FHIRDate("2016-06-06").date) + self.assertEqual(inst.batchIdentifier[0].outerPackaging.period.end.date, fhirdate.FHIRDateTime("2016-06-06").date) self.assertEqual(inst.batchIdentifier[0].outerPackaging.period.end.as_json(), "2016-06-06") self.assertEqual(inst.batchIdentifier[0].outerPackaging.system, "http://ema.europa.eu/example/baid1") self.assertEqual(inst.batchIdentifier[0].outerPackaging.value, "AAF5699") diff --git a/tests/models/medicinalproductpharmaceutical_test.py b/tests/models/medicinalproductpharmaceutical_test.py index 3006fabe7..4b68e18b2 100644 --- a/tests/models/medicinalproductpharmaceutical_test.py +++ b/tests/models/medicinalproductpharmaceutical_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import medicinalproductpharmaceutical -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, medicinalproductpharmaceutical class MedicinalProductPharmaceuticalTests(unittest.TestCase): diff --git a/tests/models/medicinalproductundesirableeffect_test.py b/tests/models/medicinalproductundesirableeffect_test.py index f69f9d6e0..15607ddf4 100644 --- a/tests/models/medicinalproductundesirableeffect_test.py +++ b/tests/models/medicinalproductundesirableeffect_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import medicinalproductundesirableeffect -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, medicinalproductundesirableeffect class MedicinalProductUndesirableEffectTests(unittest.TestCase): diff --git a/tests/models/messagedefinition_test.py b/tests/models/messagedefinition_test.py index 49edd3356..e294a909b 100644 --- a/tests/models/messagedefinition_test.py +++ b/tests/models/messagedefinition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import messagedefinition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, messagedefinition class MessageDefinitionTests(unittest.TestCase): @@ -30,7 +29,7 @@ def implMessageDefinition1(self, inst): self.assertEqual(inst.category, "notification") self.assertEqual(inst.contact[0].telecom[0].system, "url") self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org") - self.assertEqual(inst.date.date, FHIRDate("2016-11-09").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2016-11-09").date) self.assertEqual(inst.date.as_json(), "2016-11-09") self.assertEqual(inst.eventCoding.code, "admin-notify") self.assertEqual(inst.eventCoding.system, "http://example.org/fhir/message-events") diff --git a/tests/models/messageheader_test.py b/tests/models/messageheader_test.py index 56d9653a2..83f35fc8e 100644 --- a/tests/models/messageheader_test.py +++ b/tests/models/messageheader_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import messageheader -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, messageheader class MessageHeaderTests(unittest.TestCase): diff --git a/tests/models/molecularsequence_test.py b/tests/models/molecularsequence_test.py index 4e472514a..ea06c90fd 100644 --- a/tests/models/molecularsequence_test.py +++ b/tests/models/molecularsequence_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import molecularsequence -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, molecularsequence class MolecularSequenceTests(unittest.TestCase): diff --git a/tests/models/namingsystem_test.py b/tests/models/namingsystem_test.py index db8a56e99..0b4cbc6d8 100644 --- a/tests/models/namingsystem_test.py +++ b/tests/models/namingsystem_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import namingsystem -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, namingsystem class NamingSystemTests(unittest.TestCase): @@ -30,7 +29,7 @@ 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.date, fhirdate.FHIRDateTime("2014-12-13").date) self.assertEqual(inst.date.as_json(), "2014-12-13") self.assertEqual(inst.id, "example") self.assertEqual(inst.kind, "codesystem") @@ -62,7 +61,7 @@ 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") - self.assertEqual(inst.date.date, FHIRDate("2015-08-31").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2015-08-31").date) self.assertEqual(inst.date.as_json(), "2015-08-31") self.assertEqual(inst.description, "Australian HI Identifier as established by relevant regulations etc.") self.assertEqual(inst.id, "example-id") @@ -84,7 +83,7 @@ def implNamingSystem2(self, inst): self.assertEqual(inst.uniqueId[0].comment, "This value is used in Australian CDA documents") self.assertEqual(inst.uniqueId[0].type, "oid") self.assertEqual(inst.uniqueId[0].value, "1.2.36.1.2001.1003.0") - self.assertEqual(inst.uniqueId[1].period.start.date, FHIRDate("2015-08-21").date) + self.assertEqual(inst.uniqueId[1].period.start.date, fhirdate.FHIRDateTime("2015-08-21").date) self.assertEqual(inst.uniqueId[1].period.start.as_json(), "2015-08-21") self.assertTrue(inst.uniqueId[1].preferred) self.assertEqual(inst.uniqueId[1].type, "uri") diff --git a/tests/models/nutritionorder_test.py b/tests/models/nutritionorder_test.py index 758f614da..46f338676 100644 --- a/tests/models/nutritionorder_test.py +++ b/tests/models/nutritionorder_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import nutritionorder -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, nutritionorder class NutritionOrderTests(unittest.TestCase): @@ -27,7 +26,7 @@ def testNutritionOrder1(self): self.implNutritionOrder1(inst2) def implNutritionOrder1(self, inst): - self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) + self.assertEqual(inst.dateTime.date, fhirdate.FHIRDateTime("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") @@ -36,7 +35,7 @@ def implNutritionOrder1(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.oralDiet.schedule[0].repeat.boundsPeriod.start.date, FHIRDate("2015-02-10").date) + self.assertEqual(inst.oralDiet.schedule[0].repeat.boundsPeriod.start.date, fhirdate.FHIRDateTime("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) @@ -70,7 +69,7 @@ def testNutritionOrder2(self): self.implNutritionOrder2(inst2) def implNutritionOrder2(self, inst): - self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) + self.assertEqual(inst.dateTime.date, fhirdate.FHIRDateTime("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") @@ -89,7 +88,7 @@ def implNutritionOrder2(self, inst): self.assertEqual(inst.supplement[0].productName, "Glucerna") self.assertEqual(inst.supplement[0].quantity.unit, "8 oz bottle") self.assertEqual(inst.supplement[0].quantity.value, 1) - self.assertEqual(inst.supplement[0].schedule[0].repeat.boundsPeriod.start.date, FHIRDate("2015-02-10T15:00:00Z").date) + self.assertEqual(inst.supplement[0].schedule[0].repeat.boundsPeriod.start.date, fhirdate.FHIRDateTime("2015-02-10T15:00:00Z").date) self.assertEqual(inst.supplement[0].schedule[0].repeat.boundsPeriod.start.as_json(), "2015-02-10T15:00:00Z") self.assertEqual(inst.supplement[0].schedule[0].repeat.frequency, 1) self.assertEqual(inst.supplement[0].schedule[0].repeat.period, 24) @@ -117,7 +116,7 @@ def testNutritionOrder3(self): self.implNutritionOrder3(inst2) def implNutritionOrder3(self, inst): - self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) + self.assertEqual(inst.dateTime.date, fhirdate.FHIRDateTime("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") @@ -133,7 +132,7 @@ def implNutritionOrder3(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -156,7 +155,7 @@ def testNutritionOrder4(self): self.implNutritionOrder4(inst2) def implNutritionOrder4(self, inst): - self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) + self.assertEqual(inst.dateTime.date, fhirdate.FHIRDateTime("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") @@ -214,7 +213,7 @@ def testNutritionOrder5(self): self.implNutritionOrder5(inst2) def implNutritionOrder5(self, inst): - self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) + self.assertEqual(inst.dateTime.date, fhirdate.FHIRDateTime("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") @@ -233,7 +232,7 @@ def implNutritionOrder5(self, inst): 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.date, fhirdate.FHIRDateTime("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) @@ -263,7 +262,7 @@ def testNutritionOrder6(self): self.implNutritionOrder6(inst2) def implNutritionOrder6(self, inst): - self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) + self.assertEqual(inst.dateTime.date, fhirdate.FHIRDateTime("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") @@ -285,7 +284,7 @@ def implNutritionOrder6(self, inst): 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.date, fhirdate.FHIRDateTime("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) @@ -311,7 +310,7 @@ def testNutritionOrder7(self): self.implNutritionOrder7(inst2) def implNutritionOrder7(self, inst): - self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) + self.assertEqual(inst.dateTime.date, fhirdate.FHIRDateTime("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") @@ -347,7 +346,7 @@ def implNutritionOrder7(self, inst): 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.date, fhirdate.FHIRDateTime("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) @@ -373,7 +372,7 @@ def testNutritionOrder8(self): self.implNutritionOrder8(inst2) def implNutritionOrder8(self, inst): - self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) + self.assertEqual(inst.dateTime.date, fhirdate.FHIRDateTime("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") @@ -384,7 +383,7 @@ def implNutritionOrder8(self, inst): 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.date, fhirdate.FHIRDateTime("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) @@ -431,26 +430,26 @@ def testNutritionOrder9(self): self.implNutritionOrder9(inst2) def implNutritionOrder9(self, inst): - self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) + self.assertEqual(inst.dateTime.date, fhirdate.FHIRDateTime("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") self.assertEqual(inst.enteralFormula.administration[0].rateQuantity.code, "mL/h") self.assertEqual(inst.enteralFormula.administration[0].rateQuantity.system, "http://unitsofmeasure.org") self.assertEqual(inst.enteralFormula.administration[0].rateQuantity.unit, "ml/hr") self.assertEqual(inst.enteralFormula.administration[0].rateQuantity.value, 60) - self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.boundsPeriod.start.date, FHIRDate("2014-09-17T07:00:00Z").date) + self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.boundsPeriod.start.date, fhirdate.FHIRDateTime("2014-09-17T07:00:00Z").date) self.assertEqual(inst.enteralFormula.administration[0].schedule.repeat.boundsPeriod.start.as_json(), "2014-09-17T07:00:00Z") self.assertEqual(inst.enteralFormula.administration[1].rateQuantity.code, "mL/h") self.assertEqual(inst.enteralFormula.administration[1].rateQuantity.system, "http://unitsofmeasure.org") self.assertEqual(inst.enteralFormula.administration[1].rateQuantity.unit, "ml/hr") self.assertEqual(inst.enteralFormula.administration[1].rateQuantity.value, 80) - self.assertEqual(inst.enteralFormula.administration[1].schedule.repeat.boundsPeriod.start.date, FHIRDate("2014-09-17T11:00:00Z").date) + self.assertEqual(inst.enteralFormula.administration[1].schedule.repeat.boundsPeriod.start.date, fhirdate.FHIRDateTime("2014-09-17T11:00:00Z").date) self.assertEqual(inst.enteralFormula.administration[1].schedule.repeat.boundsPeriod.start.as_json(), "2014-09-17T11:00:00Z") self.assertEqual(inst.enteralFormula.administration[2].rateQuantity.code, "mL/h") self.assertEqual(inst.enteralFormula.administration[2].rateQuantity.system, "http://unitsofmeasure.org") self.assertEqual(inst.enteralFormula.administration[2].rateQuantity.unit, "ml/hr") self.assertEqual(inst.enteralFormula.administration[2].rateQuantity.value, 100) - self.assertEqual(inst.enteralFormula.administration[2].schedule.repeat.boundsPeriod.start.date, FHIRDate("2014-09-17T15:00:00Z").date) + self.assertEqual(inst.enteralFormula.administration[2].schedule.repeat.boundsPeriod.start.date, fhirdate.FHIRDateTime("2014-09-17T15:00:00Z").date) self.assertEqual(inst.enteralFormula.administration[2].schedule.repeat.boundsPeriod.start.as_json(), "2014-09-17T15:00:00Z") self.assertEqual(inst.enteralFormula.baseFormulaProductName, " Acme Diabetes Formula") self.assertEqual(inst.enteralFormula.baseFormulaType.coding[0].code, "6547210000124112") @@ -488,7 +487,7 @@ def testNutritionOrder10(self): self.implNutritionOrder10(inst2) def implNutritionOrder10(self, inst): - self.assertEqual(inst.dateTime.date, FHIRDate("2014-09-17").date) + self.assertEqual(inst.dateTime.date, fhirdate.FHIRDateTime("2014-09-17").date) self.assertEqual(inst.dateTime.as_json(), "2014-09-17") self.assertEqual(inst.id, "pureeddiet-simple") self.assertEqual(inst.identifier[0].system, "http://goodhealthhospital.org/nutrition-requests") @@ -501,7 +500,7 @@ def implNutritionOrder10(self, inst): 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.date, fhirdate.FHIRDateTime("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) diff --git a/tests/models/observation_test.py b/tests/models/observation_test.py index 5d9c755aa..d9b700b32 100644 --- a/tests/models/observation_test.py +++ b/tests/models/observation_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import observation -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, observation class ObservationTests(unittest.TestCase): @@ -35,7 +34,7 @@ def implObservation1(self, inst): self.assertEqual(inst.code.coding[0].display, "Body temperature") self.assertEqual(inst.code.coding[0].system, "http://loinc.org") self.assertEqual(inst.code.text, "Body temperature") - self.assertEqual(inst.effectiveDateTime.date, FHIRDate("1999-07-02").date) + self.assertEqual(inst.effectiveDateTime.date, fhirdate.FHIRDateTime("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") @@ -68,7 +67,7 @@ def implObservation2(self, inst): 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, "Blood Group Panel") - self.assertEqual(inst.effectiveDateTime.date, FHIRDate("2018-03-11T16:07:54+00:00").date) + self.assertEqual(inst.effectiveDateTime.date, fhirdate.FHIRDateTime("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") @@ -91,9 +90,9 @@ def implObservation3(self, inst): 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.effectivePeriod.end.date, FHIRDate("2013-04-05T10:30:10+01:00").date) + self.assertEqual(inst.effectivePeriod.end.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -102,7 +101,7 @@ def implObservation3(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -141,7 +140,7 @@ def implObservation4(self, inst): self.assertEqual(inst.code.coding[0].display, "Heart rate") self.assertEqual(inst.code.coding[0].system, "http://loinc.org") self.assertEqual(inst.code.text, "Heart rate") - self.assertEqual(inst.effectiveDateTime.date, FHIRDate("1999-07-02").date) + self.assertEqual(inst.effectiveDateTime.date, fhirdate.FHIRDateTime("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") @@ -177,7 +176,7 @@ def implObservation5(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -230,7 +229,7 @@ def implObservation6(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -265,7 +264,7 @@ def implObservation7(self, inst): self.assertEqual(inst.code.coding[0].display, "Respiratory rate") 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.date, fhirdate.FHIRDateTime("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") @@ -304,7 +303,7 @@ def implObservation8(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -342,7 +341,7 @@ def implObservation9(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -370,7 +369,7 @@ def implObservation10(self, inst): 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.date, fhirdate.FHIRInstant("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") diff --git a/tests/models/observationdefinition_test.py b/tests/models/observationdefinition_test.py index 422b0c939..8a69d50a5 100644 --- a/tests/models/observationdefinition_test.py +++ b/tests/models/observationdefinition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import observationdefinition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, observationdefinition class ObservationDefinitionTests(unittest.TestCase): diff --git a/tests/models/operationdefinition_test.py b/tests/models/operationdefinition_test.py index fab89a969..1ee03850c 100644 --- a/tests/models/operationdefinition_test.py +++ b/tests/models/operationdefinition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import operationdefinition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, operationdefinition class OperationDefinitionTests(unittest.TestCase): @@ -33,7 +32,7 @@ def implOperationDefinition1(self, inst): self.assertEqual(inst.contact[0].name, "System Administrator") self.assertEqual(inst.contact[0].telecom[0].system, "email") self.assertEqual(inst.contact[0].telecom[0].value, "beep@coyote.acme.com") - self.assertEqual(inst.date.date, FHIRDate("2015-08-04").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2015-08-04").date) self.assertEqual(inst.date.as_json(), "2015-08-04") self.assertEqual(inst.description, "Limited implementation of the Populate Questionnaire implementation") self.assertEqual(inst.id, "example") diff --git a/tests/models/operationoutcome_test.py b/tests/models/operationoutcome_test.py index 253f22e1a..7563e767d 100644 --- a/tests/models/operationoutcome_test.py +++ b/tests/models/operationoutcome_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import operationoutcome -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, operationoutcome class OperationOutcomeTests(unittest.TestCase): diff --git a/tests/models/organization_test.py b/tests/models/organization_test.py index 8d3035760..515d09a02 100644 --- a/tests/models/organization_test.py +++ b/tests/models/organization_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import organization -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, organization class OrganizationTests(unittest.TestCase): diff --git a/tests/models/organizationaffiliation_test.py b/tests/models/organizationaffiliation_test.py index 84e1ca5fb..7fbe8a830 100644 --- a/tests/models/organizationaffiliation_test.py +++ b/tests/models/organizationaffiliation_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import organizationaffiliation -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, organizationaffiliation class OrganizationAffiliationTests(unittest.TestCase): @@ -36,9 +35,9 @@ def implOrganizationAffiliation1(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.period.end.date, FHIRDate("2012-03-31").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("2012-03-31").date) self.assertEqual(inst.period.end.as_json(), "2012-03-31") - self.assertEqual(inst.period.start.date, FHIRDate("2012-01-01").date) + self.assertEqual(inst.period.start.date, fhirdate.FHIRDateTime("2012-01-01").date) self.assertEqual(inst.period.start.as_json(), "2012-01-01") self.assertEqual(inst.specialty[0].coding[0].code, "408443003") self.assertEqual(inst.specialty[0].coding[0].display, "General medical practice") @@ -98,9 +97,9 @@ def implOrganizationAffiliation3(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.period.end.date, FHIRDate("2022-02-01").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("2022-02-01").date) self.assertEqual(inst.period.end.as_json(), "2022-02-01") - self.assertEqual(inst.period.start.date, FHIRDate("2018-02-09").date) + self.assertEqual(inst.period.start.date, fhirdate.FHIRDateTime("2018-02-09").date) self.assertEqual(inst.period.start.as_json(), "2018-02-09") self.assertEqual(inst.specialty[0].coding[0].code, "394602003") self.assertEqual(inst.specialty[0].coding[0].display, "Rehabilitation - specialty") diff --git a/tests/models/parameters_test.py b/tests/models/parameters_test.py index d1d3dfff7..351f0a717 100644 --- a/tests/models/parameters_test.py +++ b/tests/models/parameters_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import parameters -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, parameters class ParametersTests(unittest.TestCase): diff --git a/tests/models/patient_test.py b/tests/models/patient_test.py index 0f5a51925..3d211ddcf 100644 --- a/tests/models/patient_test.py +++ b/tests/models/patient_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import patient -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, patient class PatientTests(unittest.TestCase): @@ -64,7 +63,7 @@ def implPatient2(self, inst): self.assertEqual(inst.address[0].line[0], "Van Egmondkade 23") self.assertEqual(inst.address[0].postalCode, "1024 RJ") self.assertEqual(inst.address[0].use, "home") - self.assertEqual(inst.birthDate.date, FHIRDate("1944-11-17").date) + self.assertEqual(inst.birthDate.date, fhirdate.FHIRDate("1944-11-17").date) self.assertEqual(inst.birthDate.as_json(), "1944-11-17") self.assertEqual(inst.communication[0].language.coding[0].code, "nl") self.assertEqual(inst.communication[0].language.coding[0].display, "Dutch") @@ -119,7 +118,7 @@ def testPatient3(self): def implPatient3(self, inst): self.assertTrue(inst.active) - self.assertEqual(inst.birthDate.date, FHIRDate("1932-09-24").date) + self.assertEqual(inst.birthDate.date, fhirdate.FHIRDate("1932-09-24").date) self.assertEqual(inst.birthDate.as_json(), "1932-09-24") self.assertEqual(inst.gender, "male") self.assertEqual(inst.id, "xcda") @@ -146,7 +145,7 @@ def testPatient4(self): self.implPatient4(inst2) def implPatient4(self, inst): - self.assertEqual(inst.birthDate.date, FHIRDate("2017-09-05").date) + self.assertEqual(inst.birthDate.date, fhirdate.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") @@ -170,7 +169,7 @@ def testPatient5(self): def implPatient5(self, inst): self.assertTrue(inst.active) - self.assertEqual(inst.birthDate.date, FHIRDate("2010-03-23").date) + self.assertEqual(inst.birthDate.date, fhirdate.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") @@ -197,7 +196,7 @@ def implPatient5(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -220,7 +219,7 @@ def testPatient6(self): self.implPatient6(inst2) def implPatient6(self, inst): - self.assertEqual(inst.birthDate.date, FHIRDate("1995-10-12").date) + self.assertEqual(inst.birthDate.date, fhirdate.FHIRDate("1995-10-12").date) self.assertEqual(inst.birthDate.as_json(), "1995-10-12") self.assertEqual(inst.gender, "female") self.assertEqual(inst.id, "infant-mom") @@ -253,19 +252,19 @@ def implPatient7(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.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.date, fhirdate.FHIRDateTime("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") @@ -274,7 +273,7 @@ def implPatient7(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -283,7 +282,7 @@ def implPatient7(self, inst): self.assertFalse(inst.deceasedBoolean) self.assertEqual(inst.gender, "male") 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.date, fhirdate.FHIRDateTime("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") @@ -302,7 +301,7 @@ def implPatient7(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -314,7 +313,7 @@ def implPatient7(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -332,7 +331,7 @@ def testPatient8(self): self.implPatient8(inst2) def implPatient8(self, inst): - self.assertEqual(inst.birthDate.date, FHIRDate("2017-05-15").date) + self.assertEqual(inst.birthDate.date, fhirdate.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") @@ -409,9 +408,9 @@ def testPatient10(self): def implPatient10(self, inst): self.assertTrue(inst.active) - self.assertEqual(inst.birthDate.date, FHIRDate("1982-01-23").date) + self.assertEqual(inst.birthDate.date, fhirdate.FHIRDate("1982-01-23").date) self.assertEqual(inst.birthDate.as_json(), "1982-01-23") - self.assertEqual(inst.deceasedDateTime.date, FHIRDate("2015-02-14T13:42:00+10:00").date) + self.assertEqual(inst.deceasedDateTime.date, fhirdate.FHIRDateTime("2015-02-14T13:42:00+10:00").date) self.assertEqual(inst.deceasedDateTime.as_json(), "2015-02-14T13:42:00+10:00") self.assertEqual(inst.gender, "male") self.assertEqual(inst.id, "pat3") diff --git a/tests/models/paymentnotice_test.py b/tests/models/paymentnotice_test.py index f4c4b9536..ab6884c8f 100644 --- a/tests/models/paymentnotice_test.py +++ b/tests/models/paymentnotice_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import paymentnotice -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, paymentnotice class PaymentNoticeTests(unittest.TestCase): @@ -29,7 +28,7 @@ def testPaymentNotice1(self): def implPaymentNotice1(self, inst): self.assertEqual(inst.amount.currency, "USD") self.assertEqual(inst.amount.value, 12500.0) - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("2014-08-16").date) self.assertEqual(inst.created.as_json(), "2014-08-16") self.assertEqual(inst.id, "77654") self.assertEqual(inst.identifier[0].system, "http://benefitsinc.com/paymentnotice") @@ -37,7 +36,7 @@ def implPaymentNotice1(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.paymentDate.date, FHIRDate("2014-08-15").date) + self.assertEqual(inst.paymentDate.date, fhirdate.FHIRDate("2014-08-15").date) self.assertEqual(inst.paymentDate.as_json(), "2014-08-15") self.assertEqual(inst.paymentStatus.coding[0].code, "paid") self.assertEqual(inst.paymentStatus.coding[0].system, "http://terminology.hl7.org/CodeSystem/paymentstatus") diff --git a/tests/models/paymentreconciliation_test.py b/tests/models/paymentreconciliation_test.py index 7de675603..ae801538f 100644 --- a/tests/models/paymentreconciliation_test.py +++ b/tests/models/paymentreconciliation_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import paymentreconciliation -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, paymentreconciliation class PaymentReconciliationTests(unittest.TestCase): @@ -27,11 +26,11 @@ def testPaymentReconciliation1(self): self.implPaymentReconciliation1(inst2) def implPaymentReconciliation1(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("2014-08-16").date) self.assertEqual(inst.created.as_json(), "2014-08-16") self.assertEqual(inst.detail[0].amount.currency, "USD") self.assertEqual(inst.detail[0].amount.value, 3500.0) - self.assertEqual(inst.detail[0].date.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.detail[0].date.date, fhirdate.FHIRDate("2014-08-16").date) self.assertEqual(inst.detail[0].date.as_json(), "2014-08-16") self.assertEqual(inst.detail[0].identifier.system, "http://www.BenefitsInc.com/payment/2018/detail") self.assertEqual(inst.detail[0].identifier.value, "10-12345-001") @@ -39,7 +38,7 @@ def implPaymentReconciliation1(self, inst): self.assertEqual(inst.detail[0].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/payment-type") self.assertEqual(inst.detail[1].amount.currency, "USD") self.assertEqual(inst.detail[1].amount.value, 4000.0) - self.assertEqual(inst.detail[1].date.date, FHIRDate("2014-08-12").date) + self.assertEqual(inst.detail[1].date.date, fhirdate.FHIRDate("2014-08-12").date) self.assertEqual(inst.detail[1].date.as_json(), "2014-08-12") self.assertEqual(inst.detail[1].identifier.system, "http://www.BenefitsInc.com/payment/2018/detail") self.assertEqual(inst.detail[1].identifier.value, "10-12345-002") @@ -47,7 +46,7 @@ def implPaymentReconciliation1(self, inst): self.assertEqual(inst.detail[1].type.coding[0].system, "http://terminology.hl7.org/CodeSystem/payment-type") self.assertEqual(inst.detail[2].amount.currency, "USD") self.assertEqual(inst.detail[2].amount.value, -1500.0) - self.assertEqual(inst.detail[2].date.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.detail[2].date.date, fhirdate.FHIRDate("2014-08-16").date) self.assertEqual(inst.detail[2].date.as_json(), "2014-08-16") self.assertEqual(inst.detail[2].identifier.system, "http://www.BenefitsInc.com/payment/2018/detail") self.assertEqual(inst.detail[2].identifier.value, "10-12345-003") @@ -65,13 +64,13 @@ def implPaymentReconciliation1(self, inst): self.assertEqual(inst.outcome, "complete") self.assertEqual(inst.paymentAmount.currency, "USD") self.assertEqual(inst.paymentAmount.value, 7000.0) - self.assertEqual(inst.paymentDate.date, FHIRDate("2014-08-01").date) + self.assertEqual(inst.paymentDate.date, fhirdate.FHIRDate("2014-08-01").date) self.assertEqual(inst.paymentDate.as_json(), "2014-08-01") self.assertEqual(inst.paymentIdentifier.system, "http://www.BenefitsInc.com/payment/2018") self.assertEqual(inst.paymentIdentifier.value, "10-12345") - self.assertEqual(inst.period.end.date, FHIRDate("2014-08-31").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("2014-08-31").date) self.assertEqual(inst.period.end.as_json(), "2014-08-31") - self.assertEqual(inst.period.start.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.period.start.date, fhirdate.FHIRDateTime("2014-08-16").date) self.assertEqual(inst.period.start.as_json(), "2014-08-16") self.assertEqual(inst.processNote[0].text, "Due to the year end holiday the cutoff for submissions for December will be the 28th.") self.assertEqual(inst.processNote[0].type, "display") diff --git a/tests/models/person_test.py b/tests/models/person_test.py index 207dcf598..15ac291ed 100644 --- a/tests/models/person_test.py +++ b/tests/models/person_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import person -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, person class PersonTests(unittest.TestCase): @@ -28,7 +27,7 @@ def testPerson1(self): def implPerson1(self, inst): self.assertTrue(inst.active) - self.assertEqual(inst.birthDate.date, FHIRDate("1963").date) + self.assertEqual(inst.birthDate.date, fhirdate.FHIRDate("1963").date) self.assertEqual(inst.birthDate.as_json(), "1963") self.assertEqual(inst.gender, "female") self.assertEqual(inst.id, "f002") @@ -60,11 +59,11 @@ def implPerson2(self, inst): self.assertEqual(inst.address[0].postalCode, "3999") self.assertEqual(inst.address[0].state, "Vic") self.assertEqual(inst.address[0].use, "home") - self.assertEqual(inst.birthDate.date, FHIRDate("1974-12-25").date) + self.assertEqual(inst.birthDate.date, fhirdate.FHIRDate("1974-12-25").date) self.assertEqual(inst.birthDate.as_json(), "1974-12-25") self.assertEqual(inst.gender, "male") 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.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/plandefinition_test.py b/tests/models/plandefinition_test.py index d2e447f90..20000f488 100644 --- a/tests/models/plandefinition_test.py +++ b/tests/models/plandefinition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import plandefinition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, plandefinition class PlanDefinitionTests(unittest.TestCase): @@ -52,7 +51,7 @@ def implPlanDefinition1(self, inst): self.assertEqual(inst.action[0].action[0].action[0].selectionBehavior, "exactly-one") self.assertEqual(inst.action[0].action[0].selectionBehavior, "all") self.assertEqual(inst.action[0].selectionBehavior, "exactly-one") - self.assertEqual(inst.approvalDate.date, FHIRDate("2016-07-27").date) + self.assertEqual(inst.approvalDate.date, fhirdate.FHIRDate("2016-07-27").date) self.assertEqual(inst.approvalDate.as_json(), "2016-07-27") self.assertEqual(inst.author[0].name, "Lee Surprenant") self.assertEqual(inst.contained[0].id, "1111") @@ -62,7 +61,7 @@ def implPlanDefinition1(self, inst): self.assertEqual(inst.id, "KDN5") self.assertEqual(inst.identifier[0].system, "http://example.org/ordertemplates") self.assertEqual(inst.identifier[0].value, "KDN5") - self.assertEqual(inst.lastReviewDate.date, FHIRDate("2016-07-27").date) + self.assertEqual(inst.lastReviewDate.date, fhirdate.FHIRDate("2016-07-27").date) self.assertEqual(inst.lastReviewDate.as_json(), "2016-07-27") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") @@ -148,7 +147,7 @@ def implPlanDefinition2(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -249,7 +248,7 @@ def implPlanDefinition3(self, inst): 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.date, fhirdate.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") @@ -269,12 +268,12 @@ def implPlanDefinition3(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -283,7 +282,7 @@ def implPlanDefinition3(self, inst): 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.date, fhirdate.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") @@ -482,7 +481,7 @@ def implPlanDefinition5(self, inst): self.assertEqual(inst.contained[8].id, "nitroglycerinPrescription") self.assertEqual(inst.contained[9].id, "nitroglycerinMedication") self.assertEqual(inst.copyright, "© Copyright Cognitive Medical Systems, Inc. 9444 Waples Street Suite 300 San Diego, CA 92121") - self.assertEqual(inst.date.date, FHIRDate("2017-08-29").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2017-08-29").date) self.assertEqual(inst.date.as_json(), "2017-08-29") self.assertEqual(inst.id, "example-cardiology-os") self.assertEqual(inst.identifier[0].system, "urn:va.gov:kbs:knart:artifact:r1") diff --git a/tests/models/practitioner_test.py b/tests/models/practitioner_test.py index 18b09cd59..51f675a1f 100644 --- a/tests/models/practitioner_test.py +++ b/tests/models/practitioner_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import practitioner -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, practitioner class PractitionerTests(unittest.TestCase): @@ -34,7 +33,7 @@ def implPractitioner1(self, inst): 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.date, fhirdate.FHIRDate("1960-06-12").date) self.assertEqual(inst.birthDate.as_json(), "1960-06-12") self.assertEqual(inst.gender, "male") self.assertEqual(inst.id, "f202") @@ -75,7 +74,7 @@ def implPractitioner2(self, inst): 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.date, fhirdate.FHIRDate("1975-12-07").date) self.assertEqual(inst.birthDate.as_json(), "1975-12-07") self.assertEqual(inst.gender, "male") self.assertEqual(inst.id, "f001") @@ -143,7 +142,7 @@ def implPractitioner4(self, inst): 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.date, fhirdate.FHIRDate("1971-11-07").date) self.assertEqual(inst.birthDate.as_json(), "1971-11-07") self.assertEqual(inst.gender, "female") self.assertEqual(inst.id, "f007") @@ -187,7 +186,7 @@ def implPractitioner5(self, inst): 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("1967-11-05").date) + self.assertEqual(inst.birthDate.date, fhirdate.FHIRDate("1967-11-05").date) self.assertEqual(inst.birthDate.as_json(), "1967-11-05") self.assertEqual(inst.gender, "female") self.assertEqual(inst.id, "f204") @@ -243,7 +242,7 @@ def implPractitioner7(self, inst): 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.date, fhirdate.FHIRDate("1956-12-24").date) self.assertEqual(inst.birthDate.as_json(), "1956-12-24") self.assertEqual(inst.gender, "male") self.assertEqual(inst.id, "f201") @@ -283,7 +282,7 @@ def implPractitioner8(self, inst): self.assertEqual(inst.address[0].line[0], "Galapagosweg 91") self.assertEqual(inst.address[0].postalCode, "1105 AZ") self.assertEqual(inst.address[0].use, "work") - self.assertEqual(inst.birthDate.date, FHIRDate("1980-02-04").date) + self.assertEqual(inst.birthDate.date, fhirdate.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") @@ -331,7 +330,7 @@ def implPractitioner9(self, inst): 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.date, fhirdate.FHIRDate("1979-04-29").date) self.assertEqual(inst.birthDate.as_json(), "1979-04-29") self.assertEqual(inst.gender, "male") self.assertEqual(inst.id, "f002") @@ -375,7 +374,7 @@ def implPractitioner10(self, inst): 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.date, fhirdate.FHIRDate("1975-12-07").date) self.assertEqual(inst.birthDate.as_json(), "1975-12-07") self.assertEqual(inst.gender, "male") self.assertEqual(inst.id, "f006") diff --git a/tests/models/practitionerrole_test.py b/tests/models/practitionerrole_test.py index 5c44e772b..02a708f68 100644 --- a/tests/models/practitionerrole_test.py +++ b/tests/models/practitionerrole_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import practitionerrole -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, practitionerrole class PractitionerRoleTests(unittest.TestCase): @@ -29,16 +28,16 @@ def testPractitionerRole1(self): def implPractitionerRole1(self, inst): self.assertTrue(inst.active) self.assertEqual(inst.availabilityExceptions, "Adam is generally unavailable on public holidays and during the Christmas/New Year break") - self.assertEqual(inst.availableTime[0].availableEndTime.date, FHIRDate("16:30:00").date) + self.assertEqual(inst.availableTime[0].availableEndTime.date, fhirdate.FHIRTime("16:30:00").date) self.assertEqual(inst.availableTime[0].availableEndTime.as_json(), "16:30:00") - self.assertEqual(inst.availableTime[0].availableStartTime.date, FHIRDate("09:00:00").date) + self.assertEqual(inst.availableTime[0].availableStartTime.date, fhirdate.FHIRTime("09:00:00").date) self.assertEqual(inst.availableTime[0].availableStartTime.as_json(), "09:00:00") self.assertEqual(inst.availableTime[0].daysOfWeek[0], "mon") self.assertEqual(inst.availableTime[0].daysOfWeek[1], "tue") self.assertEqual(inst.availableTime[0].daysOfWeek[2], "wed") - self.assertEqual(inst.availableTime[1].availableEndTime.date, FHIRDate("12:00:00").date) + self.assertEqual(inst.availableTime[1].availableEndTime.date, fhirdate.FHIRTime("12:00:00").date) self.assertEqual(inst.availableTime[1].availableEndTime.as_json(), "12:00:00") - self.assertEqual(inst.availableTime[1].availableStartTime.date, FHIRDate("09:00:00").date) + self.assertEqual(inst.availableTime[1].availableStartTime.date, fhirdate.FHIRTime("09:00:00").date) self.assertEqual(inst.availableTime[1].availableStartTime.as_json(), "09:00:00") self.assertEqual(inst.availableTime[1].daysOfWeek[0], "thu") self.assertEqual(inst.availableTime[1].daysOfWeek[1], "fri") @@ -51,13 +50,13 @@ def implPractitionerRole1(self, inst): 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.notAvailable[0].description, "Adam will be on extended leave during May 2017") - self.assertEqual(inst.notAvailable[0].during.end.date, FHIRDate("2017-05-20").date) + self.assertEqual(inst.notAvailable[0].during.end.date, fhirdate.FHIRDateTime("2017-05-20").date) self.assertEqual(inst.notAvailable[0].during.end.as_json(), "2017-05-20") - self.assertEqual(inst.notAvailable[0].during.start.date, FHIRDate("2017-05-01").date) + self.assertEqual(inst.notAvailable[0].during.start.date, fhirdate.FHIRDateTime("2017-05-01").date) self.assertEqual(inst.notAvailable[0].during.start.as_json(), "2017-05-01") - self.assertEqual(inst.period.end.date, FHIRDate("2012-03-31").date) + self.assertEqual(inst.period.end.date, fhirdate.FHIRDateTime("2012-03-31").date) self.assertEqual(inst.period.end.as_json(), "2012-03-31") - self.assertEqual(inst.period.start.date, FHIRDate("2012-01-01").date) + self.assertEqual(inst.period.start.date, fhirdate.FHIRDateTime("2012-01-01").date) self.assertEqual(inst.period.start.as_json(), "2012-01-01") self.assertEqual(inst.specialty[0].coding[0].code, "408443003") self.assertEqual(inst.specialty[0].coding[0].display, "General medical practice") diff --git a/tests/models/procedure_test.py b/tests/models/procedure_test.py index a44e1e7bf..b8716ecf2 100644 --- a/tests/models/procedure_test.py +++ b/tests/models/procedure_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import procedure -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, procedure class ProcedureTests(unittest.TestCase): @@ -78,7 +77,7 @@ def implProcedure2(self, inst): 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, "Standard Biopsy") - self.assertEqual(inst.performedDateTime.date, FHIRDate("2014-02-03").date) + self.assertEqual(inst.performedDateTime.date, fhirdate.FHIRDateTime("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") @@ -131,9 +130,9 @@ def implProcedure4(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -166,7 +165,7 @@ def implProcedure5(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.performedDateTime.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.performedDateTime.date, fhirdate.FHIRDateTime("2014-08-16").date) self.assertEqual(inst.performedDateTime.as_json(), "2014-08-16") self.assertEqual(inst.reasonCode[0].text, "early detection of breast mass") self.assertEqual(inst.status, "completed") @@ -221,7 +220,7 @@ def implProcedure7(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -251,9 +250,9 @@ def implProcedure8(self, inst): 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, "improved blood circulation") - self.assertEqual(inst.performedPeriod.end.date, FHIRDate("2011-06-27").date) + self.assertEqual(inst.performedPeriod.end.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -286,9 +285,9 @@ def implProcedure9(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -321,7 +320,7 @@ def implProcedure10(self, inst): 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.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/provenance_test.py b/tests/models/provenance_test.py index c7ce26850..5952d7784 100644 --- a/tests/models/provenance_test.py +++ b/tests/models/provenance_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import provenance -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, provenance class ProvenanceTests(unittest.TestCase): @@ -34,10 +33,10 @@ def implProvenance1(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.occurredPeriod.start.date, FHIRDate("2016-11-30").date) + self.assertEqual(inst.occurredPeriod.start.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRInstant("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") @@ -64,7 +63,7 @@ def implProvenance2(self, inst): self.assertEqual(inst.reason[0].coding[0].code, "TREAT") self.assertEqual(inst.reason[0].coding[0].display, "treatment") self.assertEqual(inst.reason[0].coding[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") - self.assertEqual(inst.recorded.date, FHIRDate("2015-08-27T08:39:24+10:00").date) + self.assertEqual(inst.recorded.date, fhirdate.FHIRInstant("2015-08-27T08:39:24+10:00").date) self.assertEqual(inst.recorded.as_json(), "2015-08-27T08:39:24+10:00") self.assertEqual(inst.signature[0].data, "Li4u") self.assertEqual(inst.signature[0].sigFormat, "application/signature+xml") @@ -72,7 +71,7 @@ def implProvenance2(self, inst): self.assertEqual(inst.signature[0].type[0].code, "1.2.840.10065.1.12.1.5") self.assertEqual(inst.signature[0].type[0].display, "Verification Signature") self.assertEqual(inst.signature[0].type[0].system, "urn:iso-astm:E1762-95:2013") - self.assertEqual(inst.signature[0].when.date, FHIRDate("2015-08-27T08:39:24+10:00").date) + self.assertEqual(inst.signature[0].when.date, fhirdate.FHIRInstant("2015-08-27T08:39:24+10:00").date) self.assertEqual(inst.signature[0].when.as_json(), "2015-08-27T08:39:24+10:00") 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") @@ -95,10 +94,10 @@ def implProvenance3(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.occurredPeriod.start.date, FHIRDate("2017-06-06").date) + self.assertEqual(inst.occurredPeriod.start.date, fhirdate.FHIRDateTime("2017-06-06").date) self.assertEqual(inst.occurredPeriod.start.as_json(), "2017-06-06") self.assertEqual(inst.reason[0].text, "antiviral resistance detection") - self.assertEqual(inst.recorded.date, FHIRDate("2016-06-09T08:12:14+10:00").date) + self.assertEqual(inst.recorded.date, fhirdate.FHIRInstant("2016-06-09T08:12:14+10:00").date) self.assertEqual(inst.recorded.as_json(), "2016-06-09T08:12:14+10:00") self.assertEqual(inst.text.status, "generated") @@ -123,15 +122,15 @@ def implProvenance4(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.occurredPeriod.end.date, FHIRDate("2015-06-28").date) + self.assertEqual(inst.occurredPeriod.end.date, fhirdate.FHIRDateTime("2015-06-28").date) self.assertEqual(inst.occurredPeriod.end.as_json(), "2015-06-28") - self.assertEqual(inst.occurredPeriod.start.date, FHIRDate("2015-06-27").date) + self.assertEqual(inst.occurredPeriod.start.date, fhirdate.FHIRDateTime("2015-06-27").date) self.assertEqual(inst.occurredPeriod.start.as_json(), "2015-06-27") self.assertEqual(inst.policy[0], "http://acme.com/fhir/Consent/25") self.assertEqual(inst.reason[0].coding[0].code, "3457005") self.assertEqual(inst.reason[0].coding[0].display, "Referral") self.assertEqual(inst.reason[0].coding[0].system, "http://snomed.info/sct") - self.assertEqual(inst.recorded.date, FHIRDate("2015-06-27T08:39:24+10:00").date) + self.assertEqual(inst.recorded.date, fhirdate.FHIRInstant("2015-06-27T08:39:24+10:00").date) self.assertEqual(inst.recorded.as_json(), "2015-06-27T08:39:24+10:00") self.assertEqual(inst.text.status, "generated") diff --git a/tests/models/questionnaire_test.py b/tests/models/questionnaire_test.py index 6a93f8a16..a35d0f537 100644 --- a/tests/models/questionnaire_test.py +++ b/tests/models/questionnaire_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import questionnaire -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, questionnaire class QuestionnaireTests(unittest.TestCase): @@ -27,7 +26,7 @@ def testQuestionnaire1(self): self.implQuestionnaire1(inst2) def implQuestionnaire1(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2013-02-19").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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") @@ -101,7 +100,7 @@ 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.date, fhirdate.FHIRDateTime("2010").date) self.assertEqual(inst.date.as_json(), "2010") self.assertEqual(inst.id, "f201") self.assertEqual(inst.item[0].linkId, "1") @@ -152,7 +151,7 @@ def implQuestionnaire3(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -188,7 +187,7 @@ def testQuestionnaire4(self): self.implQuestionnaire4(inst2) def implQuestionnaire4(self, inst): - self.assertEqual(inst.date.date, FHIRDate("2012-01").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2012-01").date) self.assertEqual(inst.date.as_json(), "2012-01") self.assertEqual(inst.id, "3141") self.assertEqual(inst.item[0].code[0].code, "COMORBIDITY") diff --git a/tests/models/questionnaireresponse_test.py b/tests/models/questionnaireresponse_test.py index 323c2ff58..effba9c11 100644 --- a/tests/models/questionnaireresponse_test.py +++ b/tests/models/questionnaireresponse_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import questionnaireresponse -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, questionnaireresponse class QuestionnaireResponseTests(unittest.TestCase): @@ -27,7 +26,7 @@ def testQuestionnaireResponse1(self): self.implQuestionnaireResponse1(inst2) def implQuestionnaireResponse1(self, inst): - self.assertEqual(inst.authored.date, FHIRDate("2013-02-19T14:15:00-05:00").date) + self.assertEqual(inst.authored.date, fhirdate.FHIRDateTime("2013-02-19T14:15:00-05:00").date) self.assertEqual(inst.authored.as_json(), "2013-02-19T14:15:00-05:00") self.assertEqual(inst.contained[0].id, "patsub") self.assertEqual(inst.contained[1].id, "order") @@ -67,7 +66,7 @@ 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.date, fhirdate.FHIRDateTime("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") @@ -77,7 +76,7 @@ def implQuestionnaireResponse2(self, inst): 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.date, fhirdate.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?") @@ -114,10 +113,10 @@ def testQuestionnaireResponse3(self): self.implQuestionnaireResponse3(inst2) def implQuestionnaireResponse3(self, inst): - self.assertEqual(inst.authored.date, FHIRDate("2008-01-17").date) + self.assertEqual(inst.authored.date, fhirdate.FHIRDateTime("2008-01-17").date) self.assertEqual(inst.authored.as_json(), "2008-01-17") self.assertEqual(inst.id, "ussg-fht-answers") - self.assertEqual(inst.item[0].item[0].answer[0].valueDate.date, FHIRDate("2008-01-17").date) + self.assertEqual(inst.item[0].item[0].answer[0].valueDate.date, fhirdate.FHIRDate("2008-01-17").date) self.assertEqual(inst.item[0].item[0].answer[0].valueDate.as_json(), "2008-01-17") self.assertEqual(inst.item[0].item[0].linkId, "0.1") self.assertEqual(inst.item[0].item[0].text, "Date Done") @@ -133,7 +132,7 @@ def implQuestionnaireResponse3(self, inst): self.assertEqual(inst.item[1].item[0].item[1].definition, "http://loinc.org/fhir/DataElement/54131-8") self.assertEqual(inst.item[1].item[0].item[1].linkId, "1.1.2") self.assertEqual(inst.item[1].item[0].item[1].text, "Gender") - self.assertEqual(inst.item[1].item[0].item[2].answer[0].valueDate.date, FHIRDate("1966-04-04").date) + self.assertEqual(inst.item[1].item[0].item[2].answer[0].valueDate.date, fhirdate.FHIRDate("1966-04-04").date) self.assertEqual(inst.item[1].item[0].item[2].answer[0].valueDate.as_json(), "1966-04-04") self.assertEqual(inst.item[1].item[0].item[2].definition, "http://loinc.org/fhir/DataElement/21112-8") self.assertEqual(inst.item[1].item[0].item[2].linkId, "1.1.3") @@ -681,7 +680,7 @@ def testQuestionnaireResponse4(self): self.implQuestionnaireResponse4(inst2) def implQuestionnaireResponse4(self, inst): - self.assertEqual(inst.authored.date, FHIRDate("2014-12-11T04:44:16Z").date) + self.assertEqual(inst.authored.date, fhirdate.FHIRDateTime("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") @@ -720,7 +719,7 @@ def testQuestionnaireResponse5(self): self.implQuestionnaireResponse5(inst2) def implQuestionnaireResponse5(self, inst): - self.assertEqual(inst.authored.date, FHIRDate("2013-02-19T14:15:00+10:00").date) + self.assertEqual(inst.authored.date, fhirdate.FHIRDateTime("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") self.assertEqual(inst.item[0].item[0].item[0].answer[0].valueString, "Cathy Jones") @@ -736,11 +735,11 @@ def implQuestionnaireResponse5(self, inst): self.assertEqual(inst.item[0].item[1].item[1].answer[0].valueDecimal, 44.3) 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[2].answer[0].item[0].item[0].answer[0].valueDate.date, FHIRDate("1972-11-30").date) + self.assertEqual(inst.item[0].item[1].item[2].answer[0].item[0].item[0].answer[0].valueDate.date, fhirdate.FHIRDate("1972-11-30").date) self.assertEqual(inst.item[0].item[1].item[2].answer[0].item[0].item[0].answer[0].valueDate.as_json(), "1972-11-30") self.assertEqual(inst.item[0].item[1].item[2].answer[0].item[0].item[0].linkId, "vitaminKDose1") self.assertEqual(inst.item[0].item[1].item[2].answer[0].item[0].item[0].text, "1st dose") - self.assertEqual(inst.item[0].item[1].item[2].answer[0].item[0].item[1].answer[0].valueDate.date, FHIRDate("1972-12-11").date) + self.assertEqual(inst.item[0].item[1].item[2].answer[0].item[0].item[1].answer[0].valueDate.date, fhirdate.FHIRDate("1972-12-11").date) self.assertEqual(inst.item[0].item[1].item[2].answer[0].item[0].item[1].answer[0].valueDate.as_json(), "1972-12-11") self.assertEqual(inst.item[0].item[1].item[2].answer[0].item[0].item[1].linkId, "vitaminKDose2") self.assertEqual(inst.item[0].item[1].item[2].answer[0].item[0].item[1].text, "2nd dose") @@ -748,7 +747,7 @@ def implQuestionnaireResponse5(self, inst): self.assertEqual(inst.item[0].item[1].item[2].answer[0].valueCoding.code, "INJECTION") 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[3].answer[0].item[0].answer[0].valueDate.date, FHIRDate("1972-12-04").date) + self.assertEqual(inst.item[0].item[1].item[3].answer[0].item[0].answer[0].valueDate.date, fhirdate.FHIRDate("1972-12-04").date) self.assertEqual(inst.item[0].item[1].item[3].answer[0].item[0].answer[0].valueDate.as_json(), "1972-12-04") self.assertEqual(inst.item[0].item[1].item[3].answer[0].item[0].linkId, "hepBgivenDate") self.assertEqual(inst.item[0].item[1].item[3].answer[0].item[0].text, "Date given") diff --git a/tests/models/relatedperson_test.py b/tests/models/relatedperson_test.py index d3740d4ea..36f84d822 100644 --- a/tests/models/relatedperson_test.py +++ b/tests/models/relatedperson_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import relatedperson -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, relatedperson class RelatedPersonTests(unittest.TestCase): @@ -99,7 +98,7 @@ def implRelatedPerson3(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.date, fhirdate.FHIRDate("1973-05-31").date) self.assertEqual(inst.birthDate.as_json(), "1973-05-31") self.assertEqual(inst.gender, "female") self.assertEqual(inst.id, "newborn-mom") @@ -133,7 +132,7 @@ def testRelatedPerson4(self): self.implRelatedPerson4(inst2) def implRelatedPerson4(self, inst): - self.assertEqual(inst.birthDate.date, FHIRDate("1963").date) + self.assertEqual(inst.birthDate.date, fhirdate.FHIRDate("1963").date) self.assertEqual(inst.birthDate.as_json(), "1963") self.assertEqual(inst.gender, "female") self.assertEqual(inst.id, "f002") @@ -142,7 +141,7 @@ def implRelatedPerson4(self, inst): 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.date, fhirdate.FHIRDateTime("1975").date) self.assertEqual(inst.period.start.as_json(), "1975") self.assertEqual(inst.photo[0].contentType, "image/jpeg") self.assertEqual(inst.relationship[0].coding[0].code, "SIGOTHR") @@ -177,7 +176,7 @@ def implRelatedPerson5(self, inst): 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.date, fhirdate.FHIRDateTime("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.photo[0].url, "Binary/f012") diff --git a/tests/models/requestgroup_test.py b/tests/models/requestgroup_test.py index 9c67c9a0b..0b1d62a88 100644 --- a/tests/models/requestgroup_test.py +++ b/tests/models/requestgroup_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import requestgroup -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, requestgroup class RequestGroupTests(unittest.TestCase): @@ -50,7 +49,7 @@ def implRequestGroup1(self, inst): self.assertEqual(inst.action[0].action[0].action[0].selectionBehavior, "exactly-one") self.assertEqual(inst.action[0].action[0].selectionBehavior, "all") self.assertEqual(inst.action[0].selectionBehavior, "exactly-one") - self.assertEqual(inst.authoredOn.date, FHIRDate("2017-03-06T17:31:00Z").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("2017-03-06T17:31:00Z").date) self.assertEqual(inst.authoredOn.as_json(), "2017-03-06T17:31:00Z") self.assertEqual(inst.contained[0].id, "1111") self.assertEqual(inst.contained[1].id, "2222") @@ -95,10 +94,10 @@ def implRequestGroup2(self, inst): self.assertEqual(inst.action[0].requiredBehavior, "must") self.assertEqual(inst.action[0].selectionBehavior, "all") self.assertEqual(inst.action[0].textEquivalent, "Administer medication 1, followed an hour later by medication 2") - self.assertEqual(inst.action[0].timingDateTime.date, FHIRDate("2017-03-06T19:00:00Z").date) + self.assertEqual(inst.action[0].timingDateTime.date, fhirdate.FHIRDateTime("2017-03-06T19:00:00Z").date) self.assertEqual(inst.action[0].timingDateTime.as_json(), "2017-03-06T19:00:00Z") self.assertEqual(inst.action[0].title, "Administer Medications") - self.assertEqual(inst.authoredOn.date, FHIRDate("2017-03-06T17:31:00Z").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("2017-03-06T17:31:00Z").date) self.assertEqual(inst.authoredOn.as_json(), "2017-03-06T17:31:00Z") self.assertEqual(inst.contained[0].id, "medicationrequest-1") self.assertEqual(inst.contained[1].id, "medicationrequest-2") diff --git a/tests/models/researchdefinition_test.py b/tests/models/researchdefinition_test.py index 62bd88cf0..3890f249a 100644 --- a/tests/models/researchdefinition_test.py +++ b/tests/models/researchdefinition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import researchdefinition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, researchdefinition class ResearchDefinitionTests(unittest.TestCase): diff --git a/tests/models/researchelementdefinition_test.py b/tests/models/researchelementdefinition_test.py index 774f5915b..c6aa5b042 100644 --- a/tests/models/researchelementdefinition_test.py +++ b/tests/models/researchelementdefinition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import researchelementdefinition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, researchelementdefinition class ResearchElementDefinitionTests(unittest.TestCase): diff --git a/tests/models/researchstudy_test.py b/tests/models/researchstudy_test.py index 8f53feb00..5261ee4b1 100644 --- a/tests/models/researchstudy_test.py +++ b/tests/models/researchstudy_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import researchstudy -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, researchstudy class ResearchStudyTests(unittest.TestCase): diff --git a/tests/models/researchsubject_test.py b/tests/models/researchsubject_test.py index f00241e78..9773359fd 100644 --- a/tests/models/researchsubject_test.py +++ b/tests/models/researchsubject_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import researchsubject -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, researchsubject class ResearchSubjectTests(unittest.TestCase): diff --git a/tests/models/riskassessment_test.py b/tests/models/riskassessment_test.py index ee4cb3afc..eaf054dfd 100644 --- a/tests/models/riskassessment_test.py +++ b/tests/models/riskassessment_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import riskassessment -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, riskassessment class RiskAssessmentTests(unittest.TestCase): @@ -59,7 +58,7 @@ def implRiskAssessment2(self, inst): self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") self.assertEqual(inst.method.coding[0].code, "BRCAPRO") self.assertEqual(inst.note[0].text, "High degree of certainty") - self.assertEqual(inst.occurrenceDateTime.date, FHIRDate("2006-01-13T23:01:00Z").date) + self.assertEqual(inst.occurrenceDateTime.date, fhirdate.FHIRDateTime("2006-01-13T23:01:00Z").date) self.assertEqual(inst.occurrenceDateTime.as_json(), "2006-01-13T23:01:00Z") self.assertEqual(inst.prediction[0].outcome.text, "Breast Cancer") self.assertEqual(inst.prediction[0].probabilityDecimal, 0.000168) @@ -177,7 +176,7 @@ def implRiskAssessment4(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.occurrenceDateTime.date, FHIRDate("2014-07-19T16:04:00Z").date) + self.assertEqual(inst.occurrenceDateTime.date, fhirdate.FHIRDateTime("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) @@ -207,7 +206,7 @@ def implRiskAssessment5(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.occurrenceDateTime.date, FHIRDate("2010-11-22").date) + self.assertEqual(inst.occurrenceDateTime.date, fhirdate.FHIRDateTime("2010-11-22").date) self.assertEqual(inst.occurrenceDateTime.as_json(), "2010-11-22") self.assertEqual(inst.prediction[0].outcome.coding[0].code, "249943000:363698007=72098002,260868000=6934004") self.assertEqual(inst.prediction[0].outcome.coding[0].system, "http://snomed.info/sct") diff --git a/tests/models/riskevidencesynthesis_test.py b/tests/models/riskevidencesynthesis_test.py index 6cb333f4c..a71078a0b 100644 --- a/tests/models/riskevidencesynthesis_test.py +++ b/tests/models/riskevidencesynthesis_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import riskevidencesynthesis -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, riskevidencesynthesis class RiskEvidenceSynthesisTests(unittest.TestCase): diff --git a/tests/models/schedule_test.py b/tests/models/schedule_test.py index 8432d97ba..8f2ee5b47 100644 --- a/tests/models/schedule_test.py +++ b/tests/models/schedule_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import schedule -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, schedule class ScheduleTests(unittest.TestCase): @@ -36,9 +35,9 @@ def implSchedule1(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.planningHorizon.end.date, FHIRDate("2017-12-25T09:30:00Z").date) + self.assertEqual(inst.planningHorizon.end.date, fhirdate.FHIRDateTime("2017-12-25T09:30:00Z").date) 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.date, fhirdate.FHIRDateTime("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") @@ -68,9 +67,9 @@ def implSchedule2(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.planningHorizon.end.date, FHIRDate("2013-12-25T09:30:00Z").date) + self.assertEqual(inst.planningHorizon.end.date, fhirdate.FHIRDateTime("2013-12-25T09:30:00Z").date) self.assertEqual(inst.planningHorizon.end.as_json(), "2013-12-25T09:30:00Z") - self.assertEqual(inst.planningHorizon.start.date, FHIRDate("2013-12-25T09:15:00Z").date) + self.assertEqual(inst.planningHorizon.start.date, fhirdate.FHIRDateTime("2013-12-25T09:15:00Z").date) self.assertEqual(inst.planningHorizon.start.as_json(), "2013-12-25T09:15:00Z") self.assertEqual(inst.serviceCategory[0].coding[0].code, "17") self.assertEqual(inst.serviceCategory[0].coding[0].display, "General Practice") @@ -100,9 +99,9 @@ def implSchedule3(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.planningHorizon.end.date, FHIRDate("2017-12-25T09:30:00Z").date) + self.assertEqual(inst.planningHorizon.end.date, fhirdate.FHIRDateTime("2017-12-25T09:30:00Z").date) 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.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/searchparameter_test.py b/tests/models/searchparameter_test.py index d216b4bb2..c4a28bd26 100644 --- a/tests/models/searchparameter_test.py +++ b/tests/models/searchparameter_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import searchparameter -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, searchparameter class SearchParameterTests(unittest.TestCase): @@ -34,7 +33,7 @@ def implSearchParameter1(self, inst): 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.date.date, FHIRDate("2013-10-23").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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) @@ -97,7 +96,7 @@ def implSearchParameter3(self, inst): 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.date.date, FHIRDate("2013-10-23").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2013-10-23").date) self.assertEqual(inst.date.as_json(), "2013-10-23") self.assertEqual(inst.derivedFrom, "http://hl7.org/fhir/SearchParameter/Resource-id") self.assertEqual(inst.description, "Search by resource identifier - e.g. same as the read interaction, but can return included resources") diff --git a/tests/models/servicerequest_test.py b/tests/models/servicerequest_test.py index 57d084245..482737058 100644 --- a/tests/models/servicerequest_test.py +++ b/tests/models/servicerequest_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import servicerequest -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, servicerequest class ServiceRequestTests(unittest.TestCase): @@ -35,7 +34,7 @@ def implServiceRequest1(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.occurrenceDateTime.date, FHIRDate("2013-05-08T09:33:27+07:00").date) + self.assertEqual(inst.occurrenceDateTime.date, fhirdate.FHIRDateTime("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") @@ -79,7 +78,7 @@ def testServiceRequest3(self): self.implServiceRequest3(inst2) def implServiceRequest3(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2014-02-14").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("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") @@ -97,9 +96,9 @@ def implServiceRequest3(self, inst): self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -121,7 +120,7 @@ def testServiceRequest4(self): self.implServiceRequest4(inst2) def implServiceRequest4(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2017-03-05").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("2017-03-05").date) self.assertEqual(inst.authoredOn.as_json(), "2017-03-05") self.assertEqual(inst.code.coding[0].code, "76164006") self.assertEqual(inst.code.coding[0].display, "Biopsy of colon (procedure)") @@ -157,7 +156,7 @@ def implServiceRequest5(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.occurrenceDateTime.date, FHIRDate("2015-08-27T09:33:27+07:00").date) + self.assertEqual(inst.occurrenceDateTime.date, fhirdate.FHIRDateTime("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") @@ -174,7 +173,7 @@ def testServiceRequest6(self): def implServiceRequest6(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.date, fhirdate.FHIRDateTime("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) ") @@ -213,7 +212,7 @@ def testServiceRequest7(self): self.implServiceRequest7(inst2) def implServiceRequest7(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2017-03-05").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("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)") @@ -241,7 +240,7 @@ def testServiceRequest8(self): self.implServiceRequest8(inst2) def implServiceRequest8(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2017-03-05").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("2017-03-05").date) self.assertEqual(inst.authoredOn.as_json(), "2017-03-05") self.assertEqual(inst.code.coding[0].code, "62013009") self.assertEqual(inst.code.coding[0].display, "Ambulating patient (procedure)") @@ -287,7 +286,7 @@ def testServiceRequest10(self): self.implServiceRequest10(inst2) def implServiceRequest10(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2016-08-16").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("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)") @@ -302,7 +301,7 @@ def implServiceRequest10(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.occurrenceDateTime.date, FHIRDate("2014-08-16").date) + self.assertEqual(inst.occurrenceDateTime.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/slot_test.py b/tests/models/slot_test.py index aec50de6d..b6fe98ed2 100644 --- a/tests/models/slot_test.py +++ b/tests/models/slot_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import slot -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, slot class SlotTests(unittest.TestCase): @@ -31,7 +30,7 @@ def implSlot1(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -43,7 +42,7 @@ def implSlot1(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -60,7 +59,7 @@ def testSlot2(self): def implSlot2(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -71,7 +70,7 @@ def implSlot2(self, inst): 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.date, fhirdate.FHIRInstant("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") @@ -88,7 +87,7 @@ def testSlot3(self): def implSlot3(self, inst): self.assertEqual(inst.comment, "Dr Careful is out of the office") - self.assertEqual(inst.end.date, FHIRDate("2013-12-25T09:45:00Z").date) + self.assertEqual(inst.end.date, fhirdate.FHIRInstant("2013-12-25T09:45:00Z").date) self.assertEqual(inst.end.as_json(), "2013-12-25T09:45:00Z") self.assertEqual(inst.id, "3") self.assertEqual(inst.meta.tag[0].code, "HTEST") @@ -96,7 +95,7 @@ def implSlot3(self, inst): self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") 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:30:00Z").date) + self.assertEqual(inst.start.date, fhirdate.FHIRInstant("2013-12-25T09:30:00Z").date) self.assertEqual(inst.start.as_json(), "2013-12-25T09:30:00Z") self.assertEqual(inst.status, "busy-unavailable") self.assertEqual(inst.text.status, "generated") @@ -113,7 +112,7 @@ def testSlot4(self): def implSlot4(self, inst): self.assertEqual(inst.comment, "Dr Careful is out of the office") - self.assertEqual(inst.end.date, FHIRDate("2013-12-25T10:00:00Z").date) + self.assertEqual(inst.end.date, fhirdate.FHIRInstant("2013-12-25T10:00:00Z").date) self.assertEqual(inst.end.as_json(), "2013-12-25T10:00:00Z") self.assertEqual(inst.id, "2") self.assertEqual(inst.meta.tag[0].code, "HTEST") @@ -121,7 +120,7 @@ def implSlot4(self, inst): self.assertEqual(inst.meta.tag[0].system, "http://terminology.hl7.org/CodeSystem/v3-ActReason") 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:45:00Z").date) + self.assertEqual(inst.start.date, fhirdate.FHIRInstant("2013-12-25T09:45:00Z").date) self.assertEqual(inst.start.as_json(), "2013-12-25T09:45:00Z") self.assertEqual(inst.status, "busy-tentative") self.assertEqual(inst.text.status, "generated") diff --git a/tests/models/specimen_test.py b/tests/models/specimen_test.py index d50c39cc2..73bf5f9e7 100644 --- a/tests/models/specimen_test.py +++ b/tests/models/specimen_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import specimen -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, specimen class SpecimenTests(unittest.TestCase): @@ -33,7 +32,7 @@ def implSpecimen1(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -54,7 +53,7 @@ def implSpecimen1(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -75,7 +74,7 @@ def testSpecimen2(self): def implSpecimen2(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) + self.assertEqual(inst.collection.collectedDateTime.date, fhirdate.FHIRDateTime("2015-08-18T07:03:00Z").date) self.assertEqual(inst.collection.collectedDateTime.as_json(), "2015-08-18T07:03:00Z") self.assertEqual(inst.container[0].capacity.unit, "mls") self.assertEqual(inst.container[0].capacity.value, 50) @@ -89,9 +88,9 @@ def implSpecimen2(self, inst): self.assertEqual(inst.processing[0].description, "Acidify to pH < 3.0 with 6 N HCl.") self.assertEqual(inst.processing[0].procedure.coding[0].code, "ACID") self.assertEqual(inst.processing[0].procedure.coding[0].system, "http://terminology.hl7.org/CodeSystem/v2-0373") - self.assertEqual(inst.processing[0].timeDateTime.date, FHIRDate("2015-08-18T08:10:00Z").date) + self.assertEqual(inst.processing[0].timeDateTime.date, fhirdate.FHIRDateTime("2015-08-18T08:10:00Z").date) self.assertEqual(inst.processing[0].timeDateTime.as_json(), "2015-08-18T08:10:00Z") - self.assertEqual(inst.receivedTime.date, FHIRDate("2015-08-18T07:03:00Z").date) + self.assertEqual(inst.receivedTime.date, fhirdate.FHIRDateTime("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") @@ -112,7 +111,7 @@ def testSpecimen3(self): 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.date, fhirdate.FHIRDateTime("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") @@ -142,7 +141,7 @@ def testSpecimen4(self): def implSpecimen4(self, inst): self.assertEqual(inst.accessionIdentifier.system, "http://acme.com/labs/accession-ids") self.assertEqual(inst.accessionIdentifier.value, "20150816-00124") - self.assertEqual(inst.collection.collectedDateTime.date, FHIRDate("2015-08-16T06:40:17Z").date) + self.assertEqual(inst.collection.collectedDateTime.date, fhirdate.FHIRDateTime("2015-08-16T06:40:17Z").date) self.assertEqual(inst.collection.collectedDateTime.as_json(), "2015-08-16T06:40:17Z") self.assertEqual(inst.container[0].type.coding[0].code, "SST") self.assertEqual(inst.container[0].type.coding[0].display, "Serum Separator Tube") @@ -169,7 +168,7 @@ def testSpecimen5(self): def implSpecimen5(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.date, fhirdate.FHIRDateTime("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") @@ -179,7 +178,7 @@ def implSpecimen5(self, inst): 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.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/specimendefinition_test.py b/tests/models/specimendefinition_test.py index d76412770..46a857045 100644 --- a/tests/models/specimendefinition_test.py +++ b/tests/models/specimendefinition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import specimendefinition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, specimendefinition class SpecimenDefinitionTests(unittest.TestCase): diff --git a/tests/models/structuredefinition_test.py b/tests/models/structuredefinition_test.py index a0acba9ca..0b7bf6fa3 100644 --- a/tests/models/structuredefinition_test.py +++ b/tests/models/structuredefinition_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import structuredefinition -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, structuredefinition class StructureDefinitionTests(unittest.TestCase): @@ -29,7 +28,7 @@ def testStructureDefinition1(self): def implStructureDefinition1(self, inst): self.assertTrue(inst.abstract) self.assertEqual(inst.baseDefinition, "http://hl7.org/fhir/StructureDefinition/Composition") - self.assertEqual(inst.date.date, FHIRDate("2018-11-05T17:57:00+11:00").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2018-11-05T17:57:00+11:00").date) self.assertEqual(inst.date.as_json(), "2018-11-05T17:57:00+11:00") self.assertEqual(inst.derivation, "constraint") self.assertEqual(inst.differential.element[0].id, "Composition") @@ -97,7 +96,7 @@ def testStructureDefinition2(self): def implStructureDefinition2(self, inst): self.assertFalse(inst.abstract) self.assertEqual(inst.baseDefinition, "http://hl7.org/fhir/StructureDefinition/Composition") - self.assertEqual(inst.date.date, FHIRDate("2018-11-05T17:47:00+11:00").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2018-11-05T17:47:00+11:00").date) self.assertEqual(inst.date.as_json(), "2018-11-05T17:47:00+11:00") self.assertEqual(inst.derivation, "constraint") self.assertEqual(inst.differential.element[0].id, "Composition") diff --git a/tests/models/structuremap_test.py b/tests/models/structuremap_test.py index 18b1bcb19..11b32b893 100644 --- a/tests/models/structuremap_test.py +++ b/tests/models/structuremap_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import structuremap -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, structuremap class StructureMapTests(unittest.TestCase): @@ -29,7 +28,7 @@ def testStructureMap1(self): def implStructureMap1(self, inst): 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("2017-03-09").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2017-03-09").date) self.assertEqual(inst.date.as_json(), "2017-03-09") self.assertEqual(inst.description, "Example Structure Map") self.assertEqual(inst.group[0].documentation, "test -> testValue") diff --git a/tests/models/subscription_test.py b/tests/models/subscription_test.py index 94eef00a2..1ef5a0f09 100644 --- a/tests/models/subscription_test.py +++ b/tests/models/subscription_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import subscription -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, subscription class SubscriptionTests(unittest.TestCase): @@ -34,7 +33,7 @@ def implSubscription1(self, inst): self.assertEqual(inst.contact[0].system, "phone") self.assertEqual(inst.contact[0].value, "ext 4123") self.assertEqual(inst.criteria, "Observation?code=http://loinc.org|1975-2") - self.assertEqual(inst.end.date, FHIRDate("2021-01-01T00:00:00Z").date) + self.assertEqual(inst.end.date, fhirdate.FHIRInstant("2021-01-01T00:00:00Z").date) self.assertEqual(inst.end.as_json(), "2021-01-01T00:00:00Z") self.assertEqual(inst.error, "Socket Error 10060 - can't connect to host") self.assertEqual(inst.id, "example-error") @@ -64,7 +63,7 @@ def implSubscription2(self, inst): self.assertEqual(inst.contact[0].system, "phone") self.assertEqual(inst.contact[0].value, "ext 4123") self.assertEqual(inst.criteria, "Observation?code=http://loinc.org|1975-2") - self.assertEqual(inst.end.date, FHIRDate("2021-01-01T00:00:00Z").date) + self.assertEqual(inst.end.date, fhirdate.FHIRInstant("2021-01-01T00:00:00Z").date) self.assertEqual(inst.end.as_json(), "2021-01-01T00:00:00Z") self.assertEqual(inst.id, "example") self.assertEqual(inst.meta.tag[0].code, "HTEST") diff --git a/tests/models/substance_test.py b/tests/models/substance_test.py index a68ef4faf..786565c41 100644 --- a/tests/models/substance_test.py +++ b/tests/models/substance_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import substance -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, substance class SubstanceTests(unittest.TestCase): @@ -168,7 +167,7 @@ def implSubstance6(self, inst): 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.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/substancespecification_test.py b/tests/models/substancespecification_test.py index e79c4958f..dbd6b51b8 100644 --- a/tests/models/substancespecification_test.py +++ b/tests/models/substancespecification_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import substancespecification -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, substancespecification class SubstanceSpecificationTests(unittest.TestCase): diff --git a/tests/models/supplydelivery_test.py b/tests/models/supplydelivery_test.py index ba2a7ac82..30c3c9e04 100644 --- a/tests/models/supplydelivery_test.py +++ b/tests/models/supplydelivery_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import supplydelivery -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, supplydelivery class SupplyDeliveryTests(unittest.TestCase): @@ -32,7 +31,7 @@ def implSupplyDelivery1(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.occurrenceDateTime.date, FHIRDate("2016-12-31").date) + self.assertEqual(inst.occurrenceDateTime.date, fhirdate.FHIRDateTime("2016-12-31").date) self.assertEqual(inst.occurrenceDateTime.as_json(), "2016-12-31") self.assertEqual(inst.status, "completed") self.assertEqual(inst.suppliedItem.itemCodeableConcept.coding[0].code, "BlueTubes") diff --git a/tests/models/supplyrequest_test.py b/tests/models/supplyrequest_test.py index 869cf52bd..866084258 100644 --- a/tests/models/supplyrequest_test.py +++ b/tests/models/supplyrequest_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import supplyrequest -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, supplyrequest class SupplyRequestTests(unittest.TestCase): @@ -27,7 +26,7 @@ def testSupplyRequest1(self): self.implSupplyRequest1(inst2) def implSupplyRequest1(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2016-12-31").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("2016-12-31").date) self.assertEqual(inst.authoredOn.as_json(), "2016-12-31") self.assertEqual(inst.category.coding[0].code, "central") self.assertEqual(inst.category.coding[0].display, "Central Stock Resupply") @@ -38,7 +37,7 @@ def implSupplyRequest1(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.occurrenceDateTime.date, FHIRDate("2016-12-31").date) + self.assertEqual(inst.occurrenceDateTime.date, fhirdate.FHIRDateTime("2016-12-31").date) self.assertEqual(inst.occurrenceDateTime.as_json(), "2016-12-31") self.assertEqual(inst.priority, "asap") self.assertEqual(inst.quantity.value, 10) diff --git a/tests/models/task_test.py b/tests/models/task_test.py index 90bef8669..938ead036 100644 --- a/tests/models/task_test.py +++ b/tests/models/task_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import task -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, task class TaskTests(unittest.TestCase): @@ -27,11 +26,11 @@ def testTask1(self): self.implTask1(inst2) def implTask1(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2016-10-31T08:45:05+10:00").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -41,7 +40,7 @@ def implTask1(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -51,7 +50,7 @@ def implTask1(self, inst): 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.date, fhirdate.FHIRDateTime("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, "accepted") @@ -68,12 +67,12 @@ def testTask2(self): self.implTask2(inst2) def implTask2(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2016-10-31T08:45:05+10:00").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -83,7 +82,7 @@ def implTask2(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -94,7 +93,7 @@ def implTask2(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -111,12 +110,12 @@ def testTask3(self): self.implTask3(inst2) def implTask3(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2016-03-10T22:39:32-04:00").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("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-03-10T22:39:32-04:00").date) + self.assertEqual(inst.lastModified.date, fhirdate.FHIRDateTime("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") @@ -135,7 +134,7 @@ def testTask4(self): self.implTask4(inst2) def implTask4(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2018-10-04T08:25:05+10:00").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("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") @@ -147,7 +146,7 @@ def implTask4(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -170,7 +169,7 @@ def testTask5(self): self.implTask5(inst2) def implTask5(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2018-10-04T08:25:05+10:00").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("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") @@ -179,7 +178,7 @@ def implTask5(self, inst): 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("2018-10-04T08:25:05+10:00").date) + self.assertEqual(inst.lastModified.date, fhirdate.FHIRDateTime("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") @@ -199,7 +198,7 @@ def testTask6(self): self.implTask6(inst2) def implTask6(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2018-10-12T08:25:05+10:00").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("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") @@ -212,12 +211,12 @@ def implTask6(self, inst): 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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -237,14 +236,14 @@ def testTask7(self): self.implTask7(inst2) def implTask7(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2016-10-31T08:25:05+10:00").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -254,7 +253,7 @@ def implTask7(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -267,7 +266,7 @@ def implTask7(self, inst): 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.date, fhirdate.FHIRDateTime("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, "completed") @@ -284,12 +283,12 @@ def testTask8(self): self.implTask8(inst2) def implTask8(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2016-10-31T08:25:05+10:00").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -299,7 +298,7 @@ def implTask8(self, inst): 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-31T16:45:05+10:00").date) + self.assertEqual(inst.lastModified.date, fhirdate.FHIRDateTime("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") @@ -311,7 +310,7 @@ def implTask8(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -328,7 +327,7 @@ def testTask9(self): self.implTask9(inst2) def implTask9(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2018-10-04T08:25:05+10:00").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("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") @@ -339,7 +338,7 @@ def implTask9(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -359,7 +358,7 @@ def testTask10(self): self.implTask10(inst2) def implTask10(self, inst): - self.assertEqual(inst.authoredOn.date, FHIRDate("2018-10-04T08:25:05+10:00").date) + self.assertEqual(inst.authoredOn.date, fhirdate.FHIRDateTime("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") @@ -368,7 +367,7 @@ def implTask10(self, inst): 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("2018-10-04T08:25:05+10:00").date) + self.assertEqual(inst.lastModified.date, fhirdate.FHIRDateTime("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") diff --git a/tests/models/terminologycapabilities_test.py b/tests/models/terminologycapabilities_test.py index 9c24e375d..95275bd3a 100644 --- a/tests/models/terminologycapabilities_test.py +++ b/tests/models/terminologycapabilities_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import terminologycapabilities -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, terminologycapabilities class TerminologyCapabilitiesTests(unittest.TestCase): @@ -31,7 +30,7 @@ def implTerminologyCapabilities1(self, inst): self.assertEqual(inst.contact[0].name, "System Administrator") self.assertEqual(inst.contact[0].telecom[0].system, "email") self.assertEqual(inst.contact[0].telecom[0].value, "wile@acme.org") - self.assertEqual(inst.date.date, FHIRDate("2012-01-04").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2012-01-04").date) self.assertEqual(inst.date.as_json(), "2012-01-04") self.assertEqual(inst.description, "This is the FHIR capability statement for the main EHR at ACME for the private interface - it does not describe the public interface") self.assertTrue(inst.experimental) diff --git a/tests/models/testreport_test.py b/tests/models/testreport_test.py index 590c1c50b..d588b82d2 100644 --- a/tests/models/testreport_test.py +++ b/tests/models/testreport_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import testreport -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, testreport class TestReportTests(unittest.TestCase): @@ -30,7 +29,7 @@ def implTestReport1(self, inst): self.assertEqual(inst.id, "testreport-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.9878") - self.assertEqual(inst.issued.date, FHIRDate("2016-10-07T08:25:34-05:00").date) + self.assertEqual(inst.issued.date, fhirdate.FHIRDateTime("2016-10-07T08:25:34-05:00").date) self.assertEqual(inst.issued.as_json(), "2016-10-07T08:25:34-05:00") self.assertEqual(inst.meta.tag[0].code, "HTEST") self.assertEqual(inst.meta.tag[0].display, "test health data") diff --git a/tests/models/testscript_test.py b/tests/models/testscript_test.py index a7d8e2b16..0273d5ff1 100644 --- a/tests/models/testscript_test.py +++ b/tests/models/testscript_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import testscript -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, testscript class TestScriptTests(unittest.TestCase): @@ -32,7 +31,7 @@ def implTestScript1(self, inst): self.assertEqual(inst.contact[0].telecom[0].use, "work") self.assertEqual(inst.contact[0].telecom[0].value, "support@HL7.org") self.assertEqual(inst.copyright, "© HL7.org 2011+") - self.assertEqual(inst.date.date, FHIRDate("2017-01-18").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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.assertTrue(inst.experimental) @@ -172,7 +171,7 @@ def implTestScript2(self, inst): self.assertEqual(inst.contact[0].telecom[0].use, "work") self.assertEqual(inst.contact[0].telecom[0].value, "support@HL7.org") self.assertEqual(inst.copyright, "© HL7.org 2011+") - self.assertEqual(inst.date.date, FHIRDate("2017-01-18").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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) @@ -327,7 +326,7 @@ def implTestScript3(self, inst): self.assertEqual(inst.contact[0].telecom[0].use, "work") self.assertEqual(inst.contact[0].telecom[0].value, "support@HL7.org") self.assertEqual(inst.copyright, "© HL7.org 2011+") - self.assertEqual(inst.date.date, FHIRDate("2017-01-18").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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) @@ -436,7 +435,7 @@ def implTestScript4(self, inst): self.assertEqual(inst.contact[0].telecom[0].use, "work") self.assertEqual(inst.contact[0].telecom[0].value, "support@HL7.org") self.assertEqual(inst.copyright, "© HL7.org 2011+") - self.assertEqual(inst.date.date, FHIRDate("2017-01-18").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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") @@ -564,7 +563,7 @@ def implTestScript5(self, inst): self.assertEqual(inst.contact[0].telecom[0].use, "work") self.assertEqual(inst.contact[0].telecom[0].value, "support@HL7.org") self.assertEqual(inst.copyright, "© HL7.org 2011+") - self.assertEqual(inst.date.date, FHIRDate("2017-01-18").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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.assertTrue(inst.experimental) @@ -665,7 +664,7 @@ def implTestScript6(self, inst): self.assertEqual(inst.contact[0].telecom[0].use, "work") self.assertEqual(inst.contact[0].telecom[0].value, "support@HL7.org") self.assertEqual(inst.copyright, "© HL7.org 2011+") - self.assertEqual(inst.date.date, FHIRDate("2017-01-18").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2017-01-18").date) self.assertEqual(inst.date.as_json(), "2017-01-18") self.assertTrue(inst.experimental) self.assertFalse(inst.fixture[0].autocreate) diff --git a/tests/models/valueset_test.py b/tests/models/valueset_test.py index 736fea8ec..539025eed 100644 --- a/tests/models/valueset_test.py +++ b/tests/models/valueset_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import valueset -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, valueset class ValueSetTests(unittest.TestCase): @@ -82,7 +81,7 @@ def implValueSet1(self, inst): self.assertEqual(inst.contact[0].telecom[0].system, "url") self.assertEqual(inst.contact[0].telecom[0].value, "http://hl7.org/fhir") self.assertEqual(inst.contained[0].id, "hacked") - self.assertEqual(inst.date.date, FHIRDate("2018-07-20").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2018-07-20").date) self.assertEqual(inst.date.as_json(), "2018-07-20") self.assertEqual(inst.description, "Demonstration of extensions that build a hierarchical contains") self.assertTrue(inst.expansion.contains[0].abstract) @@ -141,7 +140,7 @@ def implValueSet1(self, inst): self.assertEqual(inst.expansion.identifier, "urn:uuid:42316ff8-2714-4680-9980-f37a6d1a71bc") self.assertEqual(inst.expansion.parameter[0].name, "excludeNotForUI") self.assertEqual(inst.expansion.parameter[0].valueUri, "false") - self.assertEqual(inst.expansion.timestamp.date, FHIRDate("2018-07-20T23:14:07+10:00").date) + self.assertEqual(inst.expansion.timestamp.date, fhirdate.FHIRDateTime("2018-07-20T23:14:07+10:00").date) self.assertEqual(inst.expansion.timestamp.as_json(), "2018-07-20T23:14:07+10:00") self.assertTrue(inst.experimental) self.assertEqual(inst.id, "example-hierarchical") @@ -171,7 +170,7 @@ def implValueSet2(self, inst): 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.date, fhirdate.FHIRDateTime("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.assertEqual(inst.expansion.contains[0].code, "14647-2") @@ -216,7 +215,7 @@ def implValueSet2(self, inst): self.assertEqual(inst.expansion.offset, 0) self.assertEqual(inst.expansion.parameter[0].name, "version") self.assertEqual(inst.expansion.parameter[0].valueString, "2.50") - self.assertEqual(inst.expansion.timestamp.date, FHIRDate("2015-06-22T13:56:07Z").date) + self.assertEqual(inst.expansion.timestamp.date, fhirdate.FHIRDateTime("2015-06-22T13:56:07Z").date) self.assertEqual(inst.expansion.timestamp.as_json(), "2015-06-22T13:56:07Z") self.assertEqual(inst.expansion.total, 8) self.assertTrue(inst.experimental) @@ -243,7 +242,7 @@ 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.date, fhirdate.FHIRDateTime("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) @@ -257,7 +256,7 @@ def implValueSet3(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.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.date, fhirdate.FHIRInstant("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") @@ -294,7 +293,7 @@ def implValueSet4(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -325,13 +324,13 @@ def implValueSet5(self, inst): 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.date, fhirdate.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.date, fhirdate.FHIRDateTime("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) @@ -374,7 +373,7 @@ def implValueSet6(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("2018-11-01").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("2018-11-01").date) self.assertEqual(inst.date.as_json(), "2018-11-01") self.assertEqual(inst.description, "ACME Codes for Cholesterol: Plasma only - demonstrating the use of a filter defined in a CodeSystem") self.assertTrue(inst.experimental) @@ -421,7 +420,7 @@ def implValueSet7(self, inst): 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.date, fhirdate.FHIRDateTime("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") @@ -447,7 +446,7 @@ def implValueSet8(self, inst): 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("2019-11-01T09:29:23+11:00").date) + self.assertEqual(inst.date.date, fhirdate.FHIRDateTime("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) @@ -461,7 +460,7 @@ def implValueSet8(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("2019-11-01T09:29:23.356+11:00").date) + self.assertEqual(inst.meta.lastUpdated.date, fhirdate.FHIRInstant("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") @@ -494,7 +493,7 @@ def implValueSet9(self, inst): 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.date, fhirdate.FHIRDateTime("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) diff --git a/tests/models/verificationresult_test.py b/tests/models/verificationresult_test.py index 7dcb1c278..4cbcbf5ff 100644 --- a/tests/models/verificationresult_test.py +++ b/tests/models/verificationresult_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import verificationresult -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, verificationresult class VerificationResultTests(unittest.TestCase): diff --git a/tests/models/visionprescription_test.py b/tests/models/visionprescription_test.py index 68f7473a5..3a40ad90a 100644 --- a/tests/models/visionprescription_test.py +++ b/tests/models/visionprescription_test.py @@ -4,8 +4,7 @@ import io import unittest import json -from fhirclient.models import visionprescription -from fhirclient.models.fhirdate import FHIRDate +from fhirclient.models import fhirdate, visionprescription class VisionPrescriptionTests(unittest.TestCase): @@ -27,9 +26,9 @@ def testVisionPrescription1(self): self.implVisionPrescription1(inst2) def implVisionPrescription1(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-06-15").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("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") @@ -67,9 +66,9 @@ def testVisionPrescription2(self): self.implVisionPrescription2(inst2) def implVisionPrescription2(self, inst): - self.assertEqual(inst.created.date, FHIRDate("2014-06-15").date) + self.assertEqual(inst.created.date, fhirdate.FHIRDateTime("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.date, fhirdate.FHIRDateTime("2014-06-15").date) self.assertEqual(inst.dateWritten.as_json(), "2014-06-15") self.assertEqual(inst.id, "33124") self.assertEqual(inst.identifier[0].system, "http://www.happysight.com/prescription")