Coverage for /home/martinb/workspace/client-py/fhirclient/models/address.py : 33%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Address) on 2021-05-18.
5# 2021, SMART Health IT.
8from . import element
10class Address(element.Element):
11 """ An address expressed using postal conventions (as opposed to GPS or other
12 location definition formats).
14 An address expressed using postal conventions (as opposed to GPS or other
15 location definition formats). This data type may be used to convey
16 addresses for use in delivering mail as well as for visiting locations
17 which might not be valid for mail delivery. There are a variety of postal
18 address formats defined around the world.
19 """
21 resource_type = "Address"
23 def __init__(self, jsondict=None, strict=True):
24 """ Initialize all valid properties.
26 :raises: FHIRValidationError on validation errors, unless strict is False
27 :param dict jsondict: A JSON dictionary to use for initialization
28 :param bool strict: If True (the default), invalid variables will raise a TypeError
29 """
31 self.city = None
32 """ Name of city, town etc..
33 Type `str`. """
35 self.country = None
36 """ Country (e.g. can be ISO 3166 2 or 3 letter code).
37 Type `str`. """
39 self.district = None
40 """ District name (aka county).
41 Type `str`. """
43 self.line = None
44 """ Street name, number, direction & P.O. Box etc..
45 List of `str` items. """
47 self.period = None
48 """ Time period when address was/is in use.
49 Type `Period` (represented as `dict` in JSON). """
51 self.postalCode = None
52 """ Postal code for area.
53 Type `str`. """
55 self.state = None
56 """ Sub-unit of country (abbreviations ok).
57 Type `str`. """
59 self.text = None
60 """ Text representation of the address.
61 Type `str`. """
63 self.type = None
64 """ postal | physical | both.
65 Type `str`. """
67 self.use = None
68 """ home | work | temp | old | billing - purpose of this address.
69 Type `str`. """
71 super(Address, self).__init__(jsondict=jsondict, strict=strict)
73 def elementProperties(self):
74 js = super(Address, self).elementProperties()
75 js.extend([
76 ("city", "city", str, False, None, False),
77 ("country", "country", str, False, None, False),
78 ("district", "district", str, False, None, False),
79 ("line", "line", str, True, None, False),
80 ("period", "period", period.Period, False, None, False),
81 ("postalCode", "postalCode", str, False, None, False),
82 ("state", "state", str, False, None, False),
83 ("text", "text", str, False, None, False),
84 ("type", "type", str, False, None, False),
85 ("use", "use", str, False, None, False),
86 ])
87 return js
90import sys
91try:
92 from . import period
93except ImportError:
94 period = sys.modules[__package__ + '.period']