Пример #1
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field("authorString", {
             "mini": 0,
             "maxi": 1
         }, primitives.StringField, None),
         # Individual responsible for the annotation.
         Field("text", {
             "mini": 1,
             "maxi": 1
         }, primitives.StringField, None),
         # The annotation  - text content.
         Field("time", {
             "mini": 0,
             "maxi": 1
         }, primitives.DateTimeField, None),
         # When the annotation was made.
         Field(
             "authorReference",
             {
                 "mini": 0,
                 "maxi": 1
             },
             ReferenceField(),
             ["Practitioner", "Patient", "RelatedPerson"],
         ),
         # Individual responsible for the annotation.
     ])
     return elm
Пример #2
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field("daysOfWeek", {
             "mini": 0,
             "maxi": -1
         }, primitives.CodeField, None),
         # mon | tue | wed | thu | fri | sat | sun.
         Field("allDay", {
             "mini": 0,
             "maxi": 1
         }, primitives.BooleanField, None),
         # Always available? e.g. 24 hour service.
         Field(
             "availableStartTime",
             {
                 "mini": 0,
                 "maxi": 1
             },
             primitives.TimeField,
             None,
         ),
         # Opening time of day (ignored if allDay = true).
         Field(
             "availableEndTime",
             {
                 "mini": 0,
                 "maxi": 1
             },
             primitives.TimeField,
             None,
         )
         # Closing time of day (ignored if allDay = true).
     ])
     return elm
Пример #3
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field(
             "breed",
             {
                 "mini": 0,
                 "maxi": 1
             },
             complex.CodeableConceptField(),
             None,
         ),
         # E.g. Poodle, Angus
         Field(
             "genderStatus",
             {
                 "mini": 0,
                 "maxi": 1
             },
             complex.CodeableConceptField(),
             None,
         ),
         # E.g. Neutered, Intact
         Field(
             "species",
             {
                 "mini": 1,
                 "maxi": 1
             },
             complex.CodeableConceptField(),
             None,
         ),
         # E.g. Dog, Cow
     ])
     return elm
Пример #4
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field("code", {
             "mini": 0,
             "maxi": 1
         }, primitives.CodeField, None),
         # Symbol in syntax defined by the system.
         Field("display", {
             "mini": 0,
             "maxi": 1
         }, primitives.StringField, None),
         # Representation defined by the system.
         Field("system", {
             "mini": 0,
             "maxi": 1
         }, primitives.URIField, None),
         # Identity of the terminology system.
         Field(
             "userSelected",
             {
                 "mini": 0,
                 "maxi": 1
             },
             primitives.BooleanField,
             None,
         ),
         # If this coding was chosen directly by the user.
         Field("version", {
             "mini": 0,
             "maxi": 1
         }, primitives.StringField, None),
         # Version of the system - if relevant.
     ])
     return elm
Пример #5
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field(
             "purpose",
             {
                 "mini": 0,
                 "maxi": 1
             },
             complex.CodeableConceptField(),
             None,
         ),
         # The type of contact.
         Field("name", {
             "mini": 0,
             "maxi": 1
         }, complex.HumanNameField(), None),
         # A name associated with the contact.
         Field("address", {
             "mini": 0,
             "maxi": 1
         }, complex.AddressField(), None),
         # Visiting or postal addresses for the contact.
         Field(
             "telecom",
             {
                 "mini": 0,
                 "maxi": -1
             },
             complex.ContactPointField(),
             None,
         )
         # Contact details (telephone, email, etc.)  for a contact.
     ])
     return elm
Пример #6
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field("versionId", {
             "mini": 0,
             "maxi": 1
         }, primitives.IdField, None),
         # Version specific identifier.
         Field("lastUpdated", {
             "mini": 0,
             "maxi": 1
         }, primitives.InstantField, None),
         # When the resource version last changed.
         Field("profile", {
             "mini": 0,
             "maxi": -1
         }, primitives.URIField, None),
         # Profiles this resource claims to conform to.
         Field("security", {
             "mini": 0,
             "maxi": -1
         }, CodingField(), None),
         # Security Labels applied to this resource.
         Field("tag", {
             "mini": 0,
             "maxi": -1
         }, CodingField(), None)
         # Tags applied to this resource.
     ])
     return elm
Пример #7
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field(
             "identifier",
             {
                 "mini": 0,
                 "maxi": -1
             },
             complex.IdentifierField(),
             None,
         ),
         # An identifier for this qualification for the practitioner.
         Field("code", {
             "mini": 1,
             "maxi": 1
         }, complex.CodeableConceptField(), None),
         # Coded representation of the qualification.
         Field("period", {
             "mini": 0,
             "maxi": 1
         }, complex.PeriodField(), None),
         # Period during which the qualification is valid.
         Field(
             "issuer",
             {
                 "mini": 0,
                 "maxi": 1
             },
             complex.ReferenceField(),
             "Organization",
         )
         # Organization that regulates and issues the qualification.
     ])
     return elm
Пример #8
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field("rank", {
             "mini": 0,
             "maxi": 1
         }, primitives.PositiveIntField, None),
         # Specify preferred order of use (1 = highest).
         Field("system", {
             "mini": 0,
             "maxi": 1
         }, primitives.CodeField, None),
         # phone | fax | email | pager | other.
         Field("use", {
             "mini": 0,
             "maxi": 1
         }, primitives.CodeField, None),
         # home | work | temp | old | mobile-purpose of this contact point.
         Field("value", {
             "mini": 0,
             "maxi": 1
         }, primitives.StringField, None),
         # The actual contact point details.
         Field("period", {
             "mini": 0,
             "maxi": 1
         }, PeriodField(), None)
         # Time period when the contact point was/is in use.
     ])
     return elm
Пример #9
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field("city", {
             "mini": 0,
             "maxi": 1
         }, primitives.StringField, None),
         # Name of city, town etc..
         Field("country", {
             "mini": 0,
             "maxi": 1
         }, primitives.StringField, None),
         # Country (can be ISO 3166 3 letter code).
         Field("district", {
             "mini": 0,
             "maxi": 1
         }, primitives.StringField, None),
         # District name (aka county)
         Field("line", {
             "mini": 0,
             "maxi": -1
         }, primitives.StringField, None),
         # Street name, number, direction & P.O. Box etc..
         Field("postalCode", {
             "mini": 0,
             "maxi": 1
         }, primitives.StringField, None),
         # Postal code for area.
         Field("state", {
             "mini": 0,
             "maxi": 1
         }, primitives.StringField, None),
         # Sub-unit of country (abbreviations ok).
         Field("type", {
             "mini": 0,
             "maxi": 1
         }, primitives.CodeField, None),
         # postal | physical | both.
         Field("text", {
             "mini": 0,
             "maxi": 1
         }, primitives.StringField, None),
         # Text representation of the address.
         Field("use", {
             "mini": 0,
             "maxi": 1
         }, primitives.CodeField, None),
         # home | work | temp | old - purpose of this address.
         Field("period", {
             "mini": 0,
             "maxi": 1
         }, PeriodField(), None)
         # Time period when address was/is in use.
     ])
     return elm
Пример #10
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend(
         [
             Field("text", {"mini": 0, "maxi": 1}, primitives.StringField, None),
             # Plain text representation of the concept.
             Field("coding", {"mini": 0, "maxi": -1}, CodingField(), None),
             # Code defined by a terminology system.
         ]
     )
     return elm
Пример #11
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend(
         [
             Field("display", {"mini": 0, "maxi": 1}, primitives.StringField, None),
             # Text alternative for the resource.
             Field("reference", {"mini": 0, "maxi": 1}, primitives.StringField, None)
             # Relative, internal or absolute URL reference.
         ]
     )
     return elm
Пример #12
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend(
         [
             Field("div", {"mini": 1, "maxi": 1}, primitives.StringField, None),
             # Limited xhtml content.
             # TODO xhtml field
             Field("status", {"mini": 1, "maxi": 1}, primitives.CodeField, None)
             # generated | extensions | additional | empty.
         ]
     )
     return elm
Пример #13
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field("denominator", {
             "mini": 0,
             "maxi": 1
         }, QuantityField(), None),
         # Denominator value.
         Field("numerator", {
             "mini": 0,
             "maxi": 1
         }, QuantityField(), None)
         # Numerator value.
     ])
     return elm
Пример #14
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field("high", {
             "mini": 0,
             "maxi": 1
         }, SimpleQuantityField(), None),
         # High limit.
         Field("low", {
             "mini": 0,
             "maxi": 1
         }, SimpleQuantityField(), None)
         # Low limit.
     ])
     return elm
Пример #15
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field("end", {
             "mini": 0,
             "maxi": 1
         }, primitives.DateTimeField, None),
         # End time with inclusive boundary, if not ongoing.
         Field("start", {
             "mini": 0,
             "maxi": 1
         }, primitives.DateTimeField, None)
         # Starting time with inclusive boundary.
     ])
     return elm
Пример #16
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend(
         [
             Field("code", {"mini": 0, "maxi": 1}, primitives.CodeField, None),
             # Coded form of the unit.
             Field("system", {"mini": 0, "maxi": 1}, primitives.URIField, None),
             # System that defines coded unit form.
             Field("unit", {"mini": 0, "maxi": 1}, primitives.StringField, None),
             # Unit representation.
             Field("value", {"mini": 0, "maxi": 1}, primitives.DecimalField, None)
             # Numerical value (with implicit precision).
         ]
     )
     return elm
Пример #17
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field("description", {
             "mini": 1,
             "maxi": 1
         }, primitives.StringField, None),
         # Reason presented to the user explaining why time not available.
         Field("during", {
             "mini": 0,
             "maxi": 1
         }, complex.PeriodField(), None)
         # Service not available from this date.
     ])
     return elm
Пример #18
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field("other", {
             "mini": 1,
             "maxi": 1
         }, complex.ReferenceField(), "Patient"),
         # The other patient resource that the link refers to
         Field("type", {
             "mini": 1,
             "maxi": 1
         }, primitives.CodeField, None),
         # replace | refer | seealso - type of link
     ])
     return elm
Пример #19
0
def test_extending_element_properties():
    arr = ComplexElement().element_properties()
    test_fields = [
        Field("end_time", {
            "mini": 0,
            "maxi": 1
        }, primitives.DateTimeField, None),
        Field("start_time", {
            "mini": 0,
            "maxi": 1
        }, primitives.DateTimeField, None),
    ]
    arr.extend(test_fields)

    assert arr == test_fields
Пример #20
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend(
         [
             Field("data", {"mini": 1, "maxi": 1}, primitives.StringField, None),
             # Decimal values with spaces, or "E" | "U" | "L".
             Field(
                 "dimensions",
                 {"mini": 1, "maxi": 1},
                 primitives.PositiveIntField,
                 None,
             ),
             # Number of sample points at each time point.
             Field("factor", {"mini": 0, "maxi": 1}, primitives.DecimalField, None),
             # Multiply data by this before adding to origin.
             Field(
                 "lowerLimit", {"mini": 0, "maxi": 1}, primitives.DecimalField, None
             ),
             # Lower limit of detection.
             Field("period", {"mini": 1, "maxi": 1}, primitives.DecimalField, None),
             # Number of milliseconds between samples.
             Field(
                 "upperLimit", {"mini": 0, "maxi": 1}, primitives.DecimalField, None
             ),
             # Upper limit of detection.
             Field("origin", {"mini": 1, "maxi": 1}, SimpleQuantityField(), None),
             # zero values and units
         ]
     )
     return elm
Пример #21
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend(
         [
             Field("comparator", {"mini": 0, "maxi": 1}, primitives.CodeField, None)
             # < | <= | >= | > - how to understand the value.
         ]
     )
     return elm
Пример #22
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field("event", {
             "mini": 0,
             "maxi": -1
         }, primitives.DateTimeField, None),
         # When the event occurs.
         Field("code", {
             "mini": 0,
             "maxi": 1
         }, CodeableConceptField(), None),
         # QD | QOD | Q4H | Q6H | BID | TID | QID | AM | PM +.
         Field("repeat", {
             "mini": 0,
             "maxi": 1
         }, TimingRepeatField(), None)
         # When the event is to occur
     ])
     return elm
Пример #23
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field("longitude", {
             "mini": 1,
             "maxi": 1
         }, primitives.DecimalField, None),
         # Longitude with WGS84 datum.
         Field("latitude", {
             "mini": 1,
             "maxi": 1
         }, primitives.DecimalField, None),
         # Latitude with WGS84 datum.
         Field("altitude", {
             "mini": 0,
             "maxi": 1
         }, primitives.DecimalField, None)
         # Altitude with WGS84 datum.
     ])
     return elm
Пример #24
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field(
             "relationship",
             {
                 "mini": 0,
                 "maxi": -1
             },
             complex.CodeableConceptField(),
             None,
         ),
         # The kind of relationship
         Field("name", {
             "mini": 0,
             "maxi": 1
         }, complex.HumanNameField(), None),
         # A name associated with the contact person
         Field(
             "telecom",
             {
                 "mini": 0,
                 "maxi": -1
             },
             complex.ContactPointField(),
             None,
         ),
         # A contact detail for the person
         Field("address", {
             "mini": 0,
             "maxi": 1
         }, complex.AddressField(), None),
         # Address for the contact person
         Field("gender", {
             "mini": 0,
             "maxi": 1
         }, primitives.CodeField, None),
         # male | female | other | unknown
         Field(
             "organization",
             {
                 "mini": 0,
                 "maxi": 1
             },
             complex.ReferenceField(),
             "Organization",
         ),
         # Organization that is associated with the contact
         Field("period", {
             "mini": 0,
             "maxi": 1
         }, complex.PeriodField(), None),
         # The period during which this contact person or organization
         # is valid to be contacted relating to this patient
     ])
     return elm
Пример #25
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field(
             "language",
             {
                 "mini": 1,
                 "maxi": 1
             },
             complex.CodeableConceptField(),
             None,
         ),
         # The language which can be used to communicate with the
         # patient about his or her health
         Field("preferred", {
             "mini": 0,
             "maxi": 1
         }, primitives.BooleanField, None),
         # Language preference indicator
     ])
     return elm
Пример #26
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend(
         [
             Field("blob", {"mini": 1, "maxi": 1}, primitives.Base64Field, None),
             # The actual signature content (XML DigSig. JWT, picture, etc.).
             Field(
                 "contentType", {"mini": 1, "maxi": 1}, primitives.CodeField, None
             ),
             # The technical format of the signature.
             Field("when", {"mini": 1, "maxi": 1}, primitives.InstantField, None),
             # When the signature was created.
             Field("whoUri", {"mini": 1, "maxi": 1}, primitives.URIField, None),
             # Who signed the signature.
             Field(
                 "whoReference",
                 {"mini": 1, "maxi": 1},
                 ReferenceField(),
                 [
                     "Practitioner",
                     "RelatedPerson",
                     "Patient",
                     "Device",
                     "Organization",
                 ],
             ),
             # Who signed the signature.
             Field("type", {"mini": 1, "maxi": -1}, CodingField(), None)
             # Indication of the reason the entity signed the object(s).
         ]
     )
     return elm
Пример #27
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field(
             "end_time",
             {
                 "mini": 1,
                 "maxi": -1
             },
             primitives.DateTimeField,
             None,
         )
     ])
     return elm
Пример #28
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field("contentType", {
             "mini": 0,
             "maxi": 1
         }, primitives.CodeField, None),
         # Mime type of the content, with charset etc.self.
         Field("creation", {
             "mini": 0,
             "maxi": 1
         }, primitives.DateTimeField, None),
         # Date attachment was first created.
         Field("data", {
             "mini": 0,
             "maxi": 1
         }, primitives.Base64Field, None),
         # Data inline, base64ed.
         Field("language", {
             "mini": 0,
             "maxi": 1
         }, primitives.CodeField, None),
         # Human language of the content (BCP-47).
         Field("hash", {
             "mini": 0,
             "maxi": 1
         }, primitives.Base64Field, None),
         # Hash of the data (sha-1, base64ed).
         Field("size", {
             "mini": 0,
             "maxi": 1
         }, primitives.UnsignedIntField, None),
         # Number of bytes of content (if url provided).
         Field("title", {
             "mini": 0,
             "maxi": 1
         }, primitives.StringField, None),
         # Label to display in place of the data.
         Field("url", {
             "mini": 0,
             "maxi": 1
         }, primitives.URIField, None)
         # Uri where the data can be found.
     ])
     return elm
Пример #29
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend(
         [
             Field("system", {"mini": 0, "maxi": 1}, primitives.URIField, None),
             # The namespace for the identifier.
             Field("use", {"mini": 0, "maxi": 1}, primitives.CodeField, None),
             # usual | official | temp | secondary (If known).
             Field("value", {"mini": 0, "maxi": 1}, primitives.StringField, None),
             # The value that is unique.
             Field(
                 "assigner",
                 {"mini": 0, "maxi": 1},
                 ReferenceField(),
                 ["Organization"],
             ),
             # Organization that issued id (may be just text).
             Field("period", {"mini": 0, "maxi": 1}, PeriodField(), None),
             # Time period when id is/was valid for use.
             Field("type", {"mini": 0, "maxi": 1}, CodeableConceptField(), None),
             # Description of identifier.
         ]
     )
     return elm
Пример #30
0
 def element_properties(self):
     elm = super().element_properties()
     elm.extend([
         Field("count", {
             "mini": 0,
             "maxi": 1
         }, primitives.IntegerField, None),
         # Number of times to repeat.
         Field("duration", {
             "mini": 0,
             "maxi": 1
         }, primitives.DecimalField, None),
         # How long when it happens.
         Field("durationMax", {
             "mini": 0,
             "maxi": 1
         }, primitives.DecimalField, None),
         # How long when it happens (Max).
         Field("durationUnits", {
             "mini": 0,
             "maxi": 1
         }, primitives.CodeField, None),
         # s | min | h | d | wk | mo | a - unit of time (UCUM).
         Field("frequency", {
             "mini": 0,
             "maxi": 1
         }, primitives.IntegerField, None),
         # Event occurs frequency times per period.
         Field(
             "frequencyMax",
             {
                 "mini": 0,
                 "maxi": 1
             },
             primitives.IntegerField,
             None,
         ),
         # Event occurs up to frequencyMax times per period.
         Field("period", {
             "mini": 0,
             "maxi": 1
         }, primitives.DecimalField, None),
         # Event occurs frequency times per period.
         Field("periodMax", {
             "mini": 0,
             "maxi": 1
         }, primitives.DecimalField, None),
         # Upper limit of period (3-4 hours).
         Field("periodUnits", {
             "mini": 0,
             "maxi": 1
         }, primitives.CodeField, None),
         # s | min | h | d | wk | mo | a - unit of time (UCUM).
         Field("when", {
             "mini": 0,
             "maxi": 1
         }, primitives.CodeField, None),
         # Regular life events the event is tied to.
         Field("boundsPeriod", {
             "mini": 0,
             "maxi": 1
         }, PeriodField(), None),
         # Length/Range of lengths, or (Start and/or end) limits.
         Field("boundsQuantity", {
             "mini": 0,
             "maxi": 1
         }, DurationField(), None),
         # Length/Range of lengths, or (Start and/or end) limits.
         Field("boundsRange", {
             "mini": 0,
             "maxi": 1
         }, RangeField(), None)
         # Length/Range of lengths, or (Start and/or end) limits.
     ])
     return elm