Skip to content

Commit

Permalink
Merge pull request #106 from icanbwell/fix_generating_xhtml_properties
Browse files Browse the repository at this point in the history
add xhtml type
  • Loading branch information
imranq2 authored Dec 10, 2021
2 parents dd23b21 + 781269a commit 7cf1888
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 50 deletions.
2 changes: 1 addition & 1 deletion spark.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM imranq2/spark_python:0.1.25
FROM imranq2/spark_python:0.1.34
# https://github.com/imranq2/docker.spark_python
USER root

Expand Down
6 changes: 6 additions & 0 deletions spark_auto_mapper_fhir/complex_types/narrative.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
# status (NarrativeStatus)
from spark_auto_mapper_fhir.value_sets.narrative_status import NarrativeStatusCode

# div (xhtml)
from spark_auto_mapper_fhir.fhir_types.xhtml import FhirXHtml


# This file is auto-generated by generate_classes so do not edit manually
# noinspection PyPep8Naming
Expand All @@ -36,6 +39,7 @@ def __init__(
id_: Optional[FhirString] = None,
extension: Optional[FhirList[ExtensionBase]] = None,
status: NarrativeStatusCode,
div: FhirXHtml,
) -> None:
"""
A human-readable summary of the resource conveying the essential clinical and
Expand All @@ -52,11 +56,13 @@ def __init__(
:param status: The status of the narrative - whether it's entirely generated (from just the
defined data or the extensions too), or whether a human authored it and it may
contain additional data.
:param div: The actual narrative content, a stripped down version of XHTML.
"""
super().__init__(
id_=id_,
extension=extension,
status=status,
div=div,
)

def get_schema(
Expand Down
6 changes: 6 additions & 0 deletions spark_auto_mapper_fhir/fhir_types/xhtml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Union

from spark_auto_mapper.data_types.text_like_base import AutoMapperTextLikeBase
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType

FhirXHtml = Union[AutoMapperTextInputType, AutoMapperTextLikeBase]
3 changes: 2 additions & 1 deletion spark_auto_mapper_fhir/generator/fhir_xml_schema_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class FhirXmlSchemaParser:
"unsignedInt": "FhirUnsignedInt",
"uuid": "FhirUuid",
"oid": "FhirOid",
"xhtml": "FhirXHtml",
}

@staticmethod
Expand Down Expand Up @@ -694,7 +695,7 @@ def generate_properties_for_class(
fhir_properties: List[FhirProperty] = []
property_: ObjectifiedElement
for property_ in properties:
if hasattr(property_, "ref"):
if "ref" in property_.attrib:
ref_: str = str(property_.get("ref"))
property_name: str = ref_.split(":")[-1]
property_type: str = ref_.split(":")[0]
Expand Down
12 changes: 6 additions & 6 deletions spark_auto_mapper_fhir/value_sets/all_security_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ class AllSecurityLabelsCode(GenericTypeCode):
def __init__(self, value: AutoMapperTextInputType):
super().__init__(value=value)

"""
http://terminology.hl7.org/CodeSystem/v3-Confidentiality
"""
codeset_v3_Confidentiality: FhirUri = (
"http://terminology.hl7.org/CodeSystem/v3-Confidentiality"
)
"""
http://terminology.hl7.org/CodeSystem/v3-ObservationValue
"""
Expand All @@ -35,6 +29,12 @@ def __init__(self, value: AutoMapperTextInputType):
"""
codeset_v3_ActCode: FhirUri = "http://terminology.hl7.org/CodeSystem/v3-ActCode"
"""
http://terminology.hl7.org/CodeSystem/v3-Confidentiality
"""
codeset_v3_Confidentiality: FhirUri = (
"http://terminology.hl7.org/CodeSystem/v3-Confidentiality"
)
"""
http://terminology.hl7.org/CodeSystem/v3-ActUSPrivacyLaw
"""
codeset_v3_ActUSPrivacyLaw: FhirUri = (
Expand Down
12 changes: 6 additions & 6 deletions spark_auto_mapper_fhir/value_sets/context_of_use_value_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def __init__(self, value: AutoMapperTextInputType):
super().__init__(value=value)

"""
http://terminology.hl7.org/CodeSystem/v3-ActCode
http://snomed.info/sct
"""
codeset_v3_ActCode: FhirUri = "http://terminology.hl7.org/CodeSystem/v3-ActCode"
codeset_sct: FhirUri = "http://snomed.info/sct"
"""
http://nucc.org/provider-taxonomy
http://terminology.hl7.org/CodeSystem/v3-ActCode
"""
codeset_provider_taxonomy: FhirUri = "http://nucc.org/provider-taxonomy"
codeset_v3_ActCode: FhirUri = "http://terminology.hl7.org/CodeSystem/v3-ActCode"
"""
urn:iso:std:iso:3166
"""
Expand All @@ -37,9 +37,9 @@ def __init__(self, value: AutoMapperTextInputType):
"""
codeset_m49_htm: FhirUri = "http://unstats.un.org/unsd/methods/m49/m49.htm"
"""
http://snomed.info/sct
http://nucc.org/provider-taxonomy
"""
codeset_sct: FhirUri = "http://snomed.info/sct"
codeset_provider_taxonomy: FhirUri = "http://nucc.org/provider-taxonomy"


class ContextOfUseValueSetCodeValues:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ class DataElementSDCObjectClassCode(GenericTypeCode):
def __init__(self, value: AutoMapperTextInputType):
super().__init__(value=value)

"""
http://loinc.org
"""
codeset_loinc_org: FhirUri = "http://loinc.org"
"""
http://snomed.info/sct
"""
Expand All @@ -32,3 +28,7 @@ def __init__(self, value: AutoMapperTextInputType):
http://www.nlm.nih.gov/research/umls/rxnorm
"""
codeset_rxnorm: FhirUri = "http://www.nlm.nih.gov/research/umls/rxnorm"
"""
http://loinc.org
"""
codeset_loinc_org: FhirUri = "http://loinc.org"
8 changes: 4 additions & 4 deletions spark_auto_mapper_fhir/value_sets/focal_subject_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class FocalSubjectCodesCode(GenericTypeCode):
def __init__(self, value: AutoMapperTextInputType):
super().__init__(value=value)

"""
http://snomed.info/sct
"""
codeset_sct: FhirUri = "http://snomed.info/sct"
"""
http://terminology.hl7.org/CodeSystem/v3-RoleCode
"""
Expand All @@ -30,10 +34,6 @@ def __init__(self, value: AutoMapperTextInputType):
codeset_v3_ParticipationType: FhirUri = (
"http://terminology.hl7.org/CodeSystem/v3-ParticipationType"
)
"""
http://snomed.info/sct
"""
codeset_sct: FhirUri = "http://snomed.info/sct"


class FocalSubjectCodesCodeValues:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class ObservationReferenceRangeAppliesToCodesCode(GenericTypeCode):
def __init__(self, value: AutoMapperTextInputType):
super().__init__(value=value)

"""
http://terminology.hl7.org/CodeSystem/v3-Race
"""
codeset_v3_Race: FhirUri = "http://terminology.hl7.org/CodeSystem/v3-Race"
"""
http://snomed.info/sct
"""
codeset_sct: FhirUri = "http://snomed.info/sct"
"""
http://terminology.hl7.org/CodeSystem/v3-Race
"""
codeset_v3_Race: FhirUri = "http://terminology.hl7.org/CodeSystem/v3-Race"


class ObservationReferenceRangeAppliesToCodesCodeValues:
Expand Down
32 changes: 16 additions & 16 deletions spark_auto_mapper_fhir/value_sets/participation_role_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,42 @@ class ParticipationRoleTypeCode(GenericTypeCode):
def __init__(self, value: AutoMapperTextInputType):
super().__init__(value=value)

"""
http://dicom.nema.org/resources/ontology/DCM
"""
codeset_DCM: FhirUri = "http://dicom.nema.org/resources/ontology/DCM"
"""
http://terminology.hl7.org/CodeSystem/v3-ParticipationFunction
"""
codeset_v3_ParticipationFunction: FhirUri = (
"http://terminology.hl7.org/CodeSystem/v3-ParticipationFunction"
)
"""
http://terminology.hl7.org/CodeSystem/v3-ParticipationType
"""
codeset_v3_ParticipationType: FhirUri = (
"http://terminology.hl7.org/CodeSystem/v3-ParticipationType"
)
"""
http://terminology.hl7.org/CodeSystem/extra-security-role-type
"""
codeset_extra_security_role_type: FhirUri = (
"http://terminology.hl7.org/CodeSystem/extra-security-role-type"
)
"""
http://terminology.hl7.org/CodeSystem/contractsignertypecodes
"""
codeset_contractsignertypecodes: FhirUri = (
"http://terminology.hl7.org/CodeSystem/contractsignertypecodes"
)
"""
http://terminology.hl7.org/CodeSystem/v3-RoleCode
"""
codeset_v3_RoleCode: FhirUri = "http://terminology.hl7.org/CodeSystem/v3-RoleCode"
"""
http://terminology.hl7.org/CodeSystem/v3-RoleClass
"""
codeset_v3_RoleClass: FhirUri = "http://terminology.hl7.org/CodeSystem/v3-RoleClass"
"""
http://terminology.hl7.org/CodeSystem/extra-security-role-type
http://dicom.nema.org/resources/ontology/DCM
"""
codeset_extra_security_role_type: FhirUri = (
"http://terminology.hl7.org/CodeSystem/extra-security-role-type"
)
codeset_DCM: FhirUri = "http://dicom.nema.org/resources/ontology/DCM"
"""
http://terminology.hl7.org/CodeSystem/v3-ParticipationType
http://terminology.hl7.org/CodeSystem/v3-RoleCode
"""
codeset_v3_ParticipationType: FhirUri = (
"http://terminology.hl7.org/CodeSystem/v3-ParticipationType"
)
codeset_v3_RoleCode: FhirUri = "http://terminology.hl7.org/CodeSystem/v3-RoleCode"


class ParticipationRoleTypeCodeValues:
Expand Down
16 changes: 8 additions & 8 deletions spark_auto_mapper_fhir/value_sets/provenance_activity_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,28 @@ class ProvenanceActivityTypeCode(GenericTypeCode):
def __init__(self, value: AutoMapperTextInputType):
super().__init__(value=value)

"""
http://terminology.hl7.org/CodeSystem/v3-ParticipationType
"""
codeset_v3_ParticipationType: FhirUri = (
"http://terminology.hl7.org/CodeSystem/v3-ParticipationType"
)
"""
http://terminology.hl7.org/CodeSystem/v3-DataOperation
"""
codeset_v3_DataOperation: FhirUri = (
"http://terminology.hl7.org/CodeSystem/v3-DataOperation"
)
"""
http://terminology.hl7.org/CodeSystem/v3-ActCode
"""
codeset_v3_ActCode: FhirUri = "http://terminology.hl7.org/CodeSystem/v3-ActCode"
"""
http://terminology.hl7.org/CodeSystem/v3-DocumentCompletion
"""
codeset_v3_DocumentCompletion: FhirUri = (
"http://terminology.hl7.org/CodeSystem/v3-DocumentCompletion"
)
"""
http://terminology.hl7.org/CodeSystem/v3-ActCode
http://terminology.hl7.org/CodeSystem/v3-ParticipationType
"""
codeset_v3_ActCode: FhirUri = "http://terminology.hl7.org/CodeSystem/v3-ActCode"
codeset_v3_ParticipationType: FhirUri = (
"http://terminology.hl7.org/CodeSystem/v3-ParticipationType"
)


class ProvenanceActivityTypeCodeValues:
Expand Down

0 comments on commit 7cf1888

Please sign in to comment.