Skip to content

Commit

Permalink
Issue #1 DSTU2 fhir resoures added (generated using fhir-parser older…
Browse files Browse the repository at this point in the history
… version)
  • Loading branch information
nazrulworld committed May 14, 2019
1 parent 5fc41a9 commit 2340571
Show file tree
Hide file tree
Showing 223 changed files with 38,639 additions and 1 deletion.
4 changes: 3 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ History
5.0.0b3 (unreleased)
--------------------

- Nothing changed yet.
New features

- Isuue#1 `Add DSTU2 Support <https://github.com/nazrulworld/fhir.resources/issues/1>`_


5.0.0b2 (2019-05-13)
Expand Down
6 changes: 6 additions & 0 deletions fhir/resources/DSTU2/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""FHIR (version 1.0.2.7202) DSTU2 resources.
This whole package is generated using
https://github.com/smart-on-fhir/fhir-parser/tree/b9140c8a189b9cf7efe882760aa55ad88dc361ef
All credit: SMART Health IT.
"""
97 changes: 97 additions & 0 deletions fhir/resources/DSTU2/account.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 1.0.2.7202 (http://hl7.org/fhir/StructureDefinition/Account) on 2019-05-14.
# 2019, SMART Health IT.


from . import domainresource

class Account(domainresource.DomainResource):
""" None.
A financial tool for tracking value accrued for a particular purpose. In
the healthcare field, used to track charges for a patient, cost centres,
etc.
"""

resource_name = "Account"

def __init__(self, jsondict=None, strict=True):
""" Initialize all valid properties.
:raises: FHIRValidationError on validation errors, unless strict is False
:param dict jsondict: A JSON dictionary to use for initialization
:param bool strict: If True (the default), invalid variables will raise a TypeError
"""

self.activePeriod = None
""" Valid from..to.
Type `Period` (represented as `dict` in JSON). """

self.balance = None
""" How much is in account?.
Type `Quantity` referencing `Money` (represented as `dict` in JSON). """

self.coveragePeriod = None
""" Transaction window.
Type `Period` (represented as `dict` in JSON). """

self.currency = None
""" Base currency in which balance is tracked.
Type `Coding` (represented as `dict` in JSON). """

self.description = None
""" Explanation of purpose/use.
Type `str`. """

self.identifier = None
""" Account number.
List of `Identifier` items (represented as `dict` in JSON). """

self.name = None
""" Human-readable label.
Type `str`. """

self.owner = None
""" Who is responsible?.
Type `FHIRReference` referencing `Organization` (represented as `dict` in JSON). """

self.status = None
""" active | inactive.
Type `str`. """

self.subject = None
""" What is account tied to?.
Type `FHIRReference` referencing `Patient, Device, Practitioner, Location, HealthcareService, Organization` (represented as `dict` in JSON). """

self.type = None
""" E.g. patient, expense, depreciation.
Type `CodeableConcept` (represented as `dict` in JSON). """

super(Account, self).__init__(jsondict=jsondict, strict=strict)

def elementProperties(self):
js = super(Account, self).elementProperties()
js.extend([
("activePeriod", "activePeriod", period.Period, False, None, False),
("balance", "balance", quantity.Quantity, False, None, False),
("coveragePeriod", "coveragePeriod", period.Period, False, None, False),
("currency", "currency", coding.Coding, False, None, False),
("description", "description", str, False, None, False),
("identifier", "identifier", identifier.Identifier, True, None, False),
("name", "name", str, False, None, False),
("owner", "owner", fhirreference.FHIRReference, False, None, False),
("status", "status", str, False, None, False),
("subject", "subject", fhirreference.FHIRReference, False, None, False),
("type", "type", codeableconcept.CodeableConcept, False, None, False),
])
return js


from . import codeableconcept
from . import coding
from . import fhirreference
from . import identifier
from . import period
from . import quantity
87 changes: 87 additions & 0 deletions fhir/resources/DSTU2/address.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 1.0.2.7202 (http://hl7.org/fhir/StructureDefinition/Address) on 2019-05-14.
# 2019, SMART Health IT.


from . import element

class Address(element.Element):
""" A postal address.
There is a variety of postal address formats defined around the world. This
format defines a superset that is the basis for all addresses around the
world.
"""

resource_name = "Address"

def __init__(self, jsondict=None, strict=True):
""" Initialize all valid properties.
:raises: FHIRValidationError on validation errors, unless strict is False
:param dict jsondict: A JSON dictionary to use for initialization
:param bool strict: If True (the default), invalid variables will raise a TypeError
"""

self.city = None
""" Name of city, town etc..
Type `str`. """

self.country = None
""" Country (can be ISO 3166 3 letter code).
Type `str`. """

self.district = None
""" District name (aka county).
Type `str`. """

self.line = None
""" Street name, number, direction & P.O. Box etc..
List of `str` items. """

self.period = None
""" Time period when address was/is in use.
Type `Period` (represented as `dict` in JSON). """

self.postalCode = None
""" Postal code for area.
Type `str`. """

self.state = None
""" Sub-unit of country (abbreviations ok).
Type `str`. """

self.text = None
""" Text representation of the address.
Type `str`. """

self.type = None
""" postal | physical | both.
Type `str`. """

self.use = None
""" home | work | temp | old - purpose of this address.
Type `str`. """

super(Address, self).__init__(jsondict=jsondict, strict=strict)

def elementProperties(self):
js = super(Address, self).elementProperties()
js.extend([
("city", "city", str, False, None, False),
("country", "country", str, False, None, False),
("district", "district", str, False, None, False),
("line", "line", str, True, None, False),
("period", "period", period.Period, False, None, False),
("postalCode", "postalCode", str, False, None, False),
("state", "state", str, False, None, False),
("text", "text", str, False, None, False),
("type", "type", str, False, None, False),
("use", "use", str, False, None, False),
])
return js


from . import period
30 changes: 30 additions & 0 deletions fhir/resources/DSTU2/age.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 1.0.2.7202 (http://hl7.org/fhir/StructureDefinition/Age) on 2019-05-14.
# 2019, SMART Health IT.


from . import quantity

class Age(quantity.Quantity):
""" A duration (length of time) with a UCUM code.
There SHALL be a code if there is a value and it SHALL be an expression of
time. If system is present, it SHALL be UCUM. If value is present, it
SHALL be positive.
"""

resource_name = "Age"

def __init__(self, jsondict=None, strict=True):
""" Initialize all valid properties.
:raises: FHIRValidationError on validation errors, unless strict is False
:param dict jsondict: A JSON dictionary to use for initialization
:param bool strict: If True (the default), invalid variables will raise a TypeError
"""

super(Age, self).__init__(jsondict=jsondict, strict=strict)


Loading

0 comments on commit 2340571

Please sign in to comment.