diff --git a/src/aidbox_sdk/generator/dotnet.clj b/src/aidbox_sdk/generator/dotnet.clj index 1ad702c..7d3bdf6 100644 --- a/src/aidbox_sdk/generator/dotnet.clj +++ b/src/aidbox_sdk/generator/dotnet.clj @@ -121,8 +121,9 @@ [{:keys [name array required value type choices] :as element}] (let [name' (->pascal-case name) lang-type (str/replace (or value type "") #"[_-]" "") + required' (if required "required " "") type (str - (when required "required ") + required' lang-type (:generic element) (when array "[]") @@ -134,7 +135,7 @@ (= (:type element) "Meta") (if (:profile element) (format "public new Meta Meta { get; } = new() { Profile = [\"%s\"] };" (:profile element)) - (format "public %s Meta { get; set; }" name')) + (format "public %s%s Meta { get; set; }" required' name')) :else (str "public " type " " name' " { get; set; }" diff --git a/src/aidbox_sdk/generator/python.clj b/src/aidbox_sdk/generator/python.clj index 9b29446..b8be141 100644 --- a/src/aidbox_sdk/generator/python.clj +++ b/src/aidbox_sdk/generator/python.clj @@ -115,35 +115,35 @@ lang-type (if (= "BackboneElement" (:type element)) (->backbone-type element) (->lang-type (:type element))) - lang-type - (cond->> lang-type - :always - remove-guard-from-class-name + lang-type (cond->> lang-type - (and forward-reference? (starts-with-capital? lang-type)) - (format "'%s'")) + :always + remove-guard-from-class-name - type (cond - ;; required and array - (and (:required element) - (:array element)) - (format "list[%s]" lang-type) + (and forward-reference? (starts-with-capital? lang-type)) + (format "'%s'")) - ;; not required and array - (and (not (:required element)) - (:array element)) - (format "Optional[List[%s]]" lang-type) + type (cond + ;; required and array + (and (:required element) + (:array element)) + (format "list[%s]" lang-type) - ;; required and not array - (and (:required element) - (not (:array element))) - lang-type + ;; not required and array + (and (not (:required element)) + (:array element)) + (format "Optional[List[%s]]" lang-type) - ;; not required and not array - (and (not (:required element)) - (not (:array element))) - (format "Optional[%s]" lang-type)) + ;; required and not array + (and (:required element) + (not (:array element))) + lang-type + + ;; not required and not array + (and (not (:required element)) + (not (:array element))) + (format "Optional[%s]" lang-type)) default-value (cond (:meta element) @@ -186,7 +186,7 @@ (map u/add-indent) (str/join "\n")) base-class-literal (when-not (str/blank? base-class) - (format "(%s)" base-class))] + (format "(%s)" base-class))] (str (when (seq inner-classes) (str (str/join "\n\n" inner-classes) "\n\n")) diff --git a/src/aidbox_sdk/generator/typescript.clj b/src/aidbox_sdk/generator/typescript.clj index 2175580..c8c2fee 100644 --- a/src/aidbox_sdk/generator/typescript.clj +++ b/src/aidbox_sdk/generator/typescript.clj @@ -82,19 +82,20 @@ (str/replace (str (:base element) (uppercase-first-letter (:name element))) #"[_-]" "")) (defn generate-property [{:keys [name array required type choices profile] :as element}] - (cond choices - (generate-polymorphic-property element) - - (= type "Meta") - (if profile - (format "%s: Meta & { profile: [\"%s\"] };" name profile) - (format "%s: Meta;" name)) - - :else - (let [type' (if (= "BackboneElement" type) - (->backbone-type element) - (->lang-type (:type element)))] - (str (->camel-case name) (when-not required "?") ": " type' (when array "[]") ";")))) + (let [optional (if required "" "?")] + (cond choices + (generate-polymorphic-property element) + + (= type "Meta") + (if profile + (format "%s%s: Meta & { profile: [\"%s\"] };" name optional profile) + (format "%s%s: Meta;" name optional)) + + :else + (let [type' (if (= "BackboneElement" type) + (->backbone-type element) + (->lang-type (:type element)))] + (str (->camel-case name) optional ": " type' (when array "[]") ";"))))) (defn generate-class "Generates TypeScript type from IR (intermediate representation) schema." diff --git a/test/aidbox_sdk/generator/dotnet_test.clj b/test/aidbox_sdk/generator/dotnet_test.clj index 7d25e5b..39312ca 100644 --- a/test/aidbox_sdk/generator/dotnet_test.clj +++ b/test/aidbox_sdk/generator/dotnet_test.clj @@ -51,9 +51,21 @@ (testing "element with meta" (is (= "public new Meta Meta { get; } = new() { Profile = [\"http://hl7.org/fhir/StructureDefinition/vitalsigns\"] };" (gen.dotnet/generate-property {:name "meta", - :required true, + :required false, :value "Meta", :profile "http://hl7.org/fhir/StructureDefinition/vitalsigns", + :type "Meta"}))) + + (is (= "public required Meta Meta { get; set; }" + (gen.dotnet/generate-property {:name "meta", + :required true, + :value "Meta", + :type "Meta"}))) + + (is (= "public Meta Meta { get; set; }" + (gen.dotnet/generate-property {:name "meta" + :required false + :value "Meta" :type "Meta"})))) (testing "element with choices" diff --git a/test/aidbox_sdk/generator/python_test.clj b/test/aidbox_sdk/generator/python_test.clj index 0a28d66..529cba8 100644 --- a/test/aidbox_sdk/generator/python_test.clj +++ b/test/aidbox_sdk/generator/python_test.clj @@ -63,8 +63,27 @@ ) (testing "element with meta" - ;; TODO - ) + (is (= "meta: Meta" + (gen.python/generate-property {:name "meta" + :required true + :value "Meta" + :profile "http://hl7.org/fhir/StructureDefinition/vitalsigns" + :type "Meta"} + false))) + + (is (= "meta: Meta" + (gen.python/generate-property {:name "meta" + :required true + :value "Meta" + :type "Meta"} + false))) + + (is (= "meta: Optional[Meta] = None" + (gen.python/generate-property {:name "meta" + :required false + :value "Meta" + :type "Meta"} + false)))) (testing "element with choices" ;; TODO @@ -169,26 +188,26 @@ (deftest generate-constraints (is (= (first [{:path (io/file "hl7_fhir_r4_core/Ldlcholesterol.py"), - :content - "from typing import Optional, List\nfrom dataclasses import dataclass, field\nfrom base import Meta\n\n@dataclass(kw_only=True)\nclass ObservationReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponentReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponent:\n reference_range: Optional[List[ObservationComponentReferenceRange]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n value_sampled_data: Optional[SampledData] = None\n code: CodeableConcept\n value_codeable_concept: Optional[CodeableConcept] = None\n value_period: Optional[Period] = None\n value_range: Optional[Range] = None\n value_integer: Optional[int] = None\n data_absent_reason: Optional[CodeableConcept] = None\n\n@dataclass(kw_only=True)\nclass Ldlcholesterol(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/ldlcholesterol\"])\n category: Optional[List[CodeableConcept]] = field(default_factory=list)\n reference_range: list[ObservationReferenceRange] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n encounter: Optional[Reference] = None\n method: Optional[CodeableConcept] = None\n value_time: Optional[str] = None\n specimen: Optional[Reference] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n component: Optional[List[ObservationComponent]] = field(default_factory=list)\n note: Optional[List[Annotation]] = field(default_factory=list)\n value_sampled_data: Optional[SampledData] = None\n effective_date_time: Optional[str] = None\n status: str\n code: CodeableConcept\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = field(default_factory=list)\n issued: Optional[str] = None\n value_period: Optional[Period] = None\n device: Optional[Reference] = None\n effective_instant: Optional[str] = None\n based_on: Optional[List[Reference]] = field(default_factory=list)\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = field(default_factory=list)\n value_integer: Optional[int] = None\n subject: Optional[Reference] = None\n performer: Optional[List[Reference]] = field(default_factory=list)\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"} - {:path (io/file "hl7_fhir_r4_core/Cholesterol.py"), - :content - "from typing import Optional, List\nfrom dataclasses import dataclass, field\nfrom base import Meta\n\n@dataclass(kw_only=True)\nclass ObservationReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponentReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponent:\n reference_range: Optional[List[ObservationComponentReferenceRange]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n value_sampled_data: Optional[SampledData] = None\n code: CodeableConcept\n value_codeable_concept: Optional[CodeableConcept] = None\n value_period: Optional[Period] = None\n value_range: Optional[Range] = None\n value_integer: Optional[int] = None\n data_absent_reason: Optional[CodeableConcept] = None\n\n@dataclass(kw_only=True)\nclass Cholesterol(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/cholesterol\"])\n category: Optional[List[CodeableConcept]] = field(default_factory=list)\n reference_range: list[ObservationReferenceRange] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n encounter: Optional[Reference] = None\n method: Optional[CodeableConcept] = None\n value_time: Optional[str] = None\n specimen: Optional[Reference] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n component: Optional[List[ObservationComponent]] = field(default_factory=list)\n note: Optional[List[Annotation]] = field(default_factory=list)\n value_sampled_data: Optional[SampledData] = None\n effective_date_time: Optional[str] = None\n status: str\n code: CodeableConcept\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = field(default_factory=list)\n issued: Optional[str] = None\n value_period: Optional[Period] = None\n device: Optional[Reference] = None\n effective_instant: Optional[str] = None\n based_on: Optional[List[Reference]] = field(default_factory=list)\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = field(default_factory=list)\n value_integer: Optional[int] = None\n subject: Optional[Reference] = None\n performer: Optional[List[Reference]] = field(default_factory=list)\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"} - {:path - (io/file "hl7_fhir_r4_core/ObservationGenetics.py"), - :content - "from typing import Optional, List\nfrom dataclasses import dataclass, field\nfrom base import Meta\n\n@dataclass(kw_only=True)\nclass ObservationReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponentReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponent:\n reference_range: Optional[List[ObservationComponentReferenceRange]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n value_sampled_data: Optional[SampledData] = None\n code: CodeableConcept\n value_codeable_concept: Optional[CodeableConcept] = None\n value_period: Optional[Period] = None\n value_range: Optional[Range] = None\n value_integer: Optional[int] = None\n data_absent_reason: Optional[CodeableConcept] = None\n\n@dataclass(kw_only=True)\nclass ObservationGenetics(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/observation-genetics\"])\n category: Optional[List[CodeableConcept]] = field(default_factory=list)\n reference_range: Optional[List[ObservationReferenceRange]] = field(default_factory=list)\n has_member: Optional[List[Reference]] = field(default_factory=list)\n derived_from: Optional[List[Reference]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n encounter: Optional[Reference] = None\n method: Optional[CodeableConcept] = None\n value_time: Optional[str] = None\n specimen: Optional[Reference] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n component: Optional[List[ObservationComponent]] = field(default_factory=list)\n note: Optional[List[Annotation]] = field(default_factory=list)\n value_sampled_data: Optional[SampledData] = None\n effective_date_time: Optional[str] = None\n status: str\n code: CodeableConcept\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = field(default_factory=list)\n issued: Optional[str] = None\n value_period: Optional[Period] = None\n device: Optional[Reference] = None\n effective_instant: Optional[str] = None\n based_on: Optional[List[Reference]] = field(default_factory=list)\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = field(default_factory=list)\n value_integer: Optional[int] = None\n subject: Optional[Reference] = None\n performer: Optional[List[Reference]] = field(default_factory=list)\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"} - {:path - (io/file "hl7_fhir_r4_core/Devicemetricobservation.py"), - :content - "from typing import Optional, List\nfrom dataclasses import dataclass, field\nfrom base import Meta\n\n@dataclass(kw_only=True)\nclass ObservationReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponentReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponent:\n reference_range: Optional[List[ObservationComponentReferenceRange]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n value_sampled_data: Optional[SampledData] = None\n code: CodeableConcept\n value_codeable_concept: Optional[CodeableConcept] = None\n value_period: Optional[Period] = None\n value_range: Optional[Range] = None\n value_integer: Optional[int] = None\n data_absent_reason: Optional[CodeableConcept] = None\n\n@dataclass(kw_only=True)\nclass Devicemetricobservation(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/devicemetricobservation\"])\n category: Optional[List[CodeableConcept]] = field(default_factory=list)\n reference_range: Optional[List[ObservationReferenceRange]] = field(default_factory=list)\n has_member: Optional[List[Reference]] = field(default_factory=list)\n derived_from: Optional[List[Reference]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n method: Optional[CodeableConcept] = None\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n component: Optional[List[ObservationComponent]] = field(default_factory=list)\n note: Optional[List[Annotation]] = field(default_factory=list)\n value_sampled_data: Optional[SampledData] = None\n effective_date_time: str\n status: str\n code: CodeableConcept\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = field(default_factory=list)\n value_period: Optional[Period] = None\n device: Reference\n effective_instant: Optional[str] = None\n based_on: Optional[List[Reference]] = field(default_factory=list)\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = field(default_factory=list)\n value_integer: Optional[int] = None\n subject: Reference\n performer: Optional[List[Reference]] = field(default_factory=list)\n effective_period: Optional[Period] = None"} - {:path (io/file "hl7_fhir_r4_core/Triglyceride.py"), - :content - "from typing import Optional, List\nfrom dataclasses import dataclass, field\nfrom base import Meta\n\n@dataclass(kw_only=True)\nclass ObservationReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponentReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponent:\n reference_range: Optional[List[ObservationComponentReferenceRange]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n value_sampled_data: Optional[SampledData] = None\n code: CodeableConcept\n value_codeable_concept: Optional[CodeableConcept] = None\n value_period: Optional[Period] = None\n value_range: Optional[Range] = None\n value_integer: Optional[int] = None\n data_absent_reason: Optional[CodeableConcept] = None\n\n@dataclass(kw_only=True)\nclass Triglyceride(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/triglyceride\"])\n category: Optional[List[CodeableConcept]] = field(default_factory=list)\n reference_range: list[ObservationReferenceRange] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n encounter: Optional[Reference] = None\n method: Optional[CodeableConcept] = None\n value_time: Optional[str] = None\n specimen: Optional[Reference] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n component: Optional[List[ObservationComponent]] = field(default_factory=list)\n note: Optional[List[Annotation]] = field(default_factory=list)\n value_sampled_data: Optional[SampledData] = None\n effective_date_time: Optional[str] = None\n status: str\n code: CodeableConcept\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = field(default_factory=list)\n issued: Optional[str] = None\n value_period: Optional[Period] = None\n device: Optional[Reference] = None\n effective_instant: Optional[str] = None\n based_on: Optional[List[Reference]] = field(default_factory=list)\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = field(default_factory=list)\n value_integer: Optional[int] = None\n subject: Optional[Reference] = None\n performer: Optional[List[Reference]] = field(default_factory=list)\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"} - {:path (io/file "hl7_fhir_r4_core/Vitalsigns.py"), - :content - "from typing import Optional, List\nfrom dataclasses import dataclass, field\nfrom base import Meta\n\n@dataclass(kw_only=True)\nclass ObservationReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponentReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponent:\n reference_range: Optional[List[ObservationComponentReferenceRange]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n value_sampled_data: Optional[SampledData] = None\n code: CodeableConcept\n value_codeable_concept: Optional[CodeableConcept] = None\n value_period: Optional[Period] = None\n value_range: Optional[Range] = None\n value_integer: Optional[int] = None\n data_absent_reason: Optional[CodeableConcept] = None\n\n@dataclass(kw_only=True)\nclass Vitalsigns(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/vitalsigns\"])\n category: list[CodeableConcept] = field(default_factory=list)\n reference_range: Optional[List[ObservationReferenceRange]] = field(default_factory=list)\n has_member: Optional[List[Reference]] = field(default_factory=list)\n derived_from: Optional[List[Reference]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n encounter: Optional[Reference] = None\n method: Optional[CodeableConcept] = None\n value_time: Optional[str] = None\n specimen: Optional[Reference] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n component: Optional[List[ObservationComponent]] = field(default_factory=list)\n note: Optional[List[Annotation]] = field(default_factory=list)\n value_sampled_data: Optional[SampledData] = None\n effective_date_time: Optional[str] = None\n status: str\n code: CodeableConcept\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = field(default_factory=list)\n issued: Optional[str] = None\n value_period: Optional[Period] = None\n device: Optional[Reference] = None\n effective_instant: Optional[str] = None\n based_on: Optional[List[Reference]] = field(default_factory=list)\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = field(default_factory=list)\n value_integer: Optional[int] = None\n subject: Reference\n performer: Optional[List[Reference]] = field(default_factory=list)\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"} - {:path (io/file "hl7_fhir_r4_core/Hdlcholesterol.py"), - :content - "from typing import Optional, List\nfrom dataclasses import dataclass, field\nfrom base import Meta\n\n@dataclass(kw_only=True)\nclass ObservationReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponentReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponent:\n reference_range: Optional[List[ObservationComponentReferenceRange]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n value_sampled_data: Optional[SampledData] = None\n code: CodeableConcept\n value_codeable_concept: Optional[CodeableConcept] = None\n value_period: Optional[Period] = None\n value_range: Optional[Range] = None\n value_integer: Optional[int] = None\n data_absent_reason: Optional[CodeableConcept] = None\n\n@dataclass(kw_only=True)\nclass Hdlcholesterol(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/hdlcholesterol\"])\n category: Optional[List[CodeableConcept]] = field(default_factory=list)\n reference_range: list[ObservationReferenceRange] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n encounter: Optional[Reference] = None\n method: Optional[CodeableConcept] = None\n value_time: Optional[str] = None\n specimen: Optional[Reference] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n component: Optional[List[ObservationComponent]] = field(default_factory=list)\n note: Optional[List[Annotation]] = field(default_factory=list)\n value_sampled_data: Optional[SampledData] = None\n effective_date_time: Optional[str] = None\n status: str\n code: CodeableConcept\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = field(default_factory=list)\n issued: Optional[str] = None\n value_period: Optional[Period] = None\n device: Optional[Reference] = None\n effective_instant: Optional[str] = None\n based_on: Optional[List[Reference]] = field(default_factory=list)\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = field(default_factory=list)\n value_integer: Optional[int] = None\n subject: Optional[Reference] = None\n performer: Optional[List[Reference]] = field(default_factory=list)\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"}]) + :content + "from typing import Optional, List\nfrom dataclasses import dataclass, field\nfrom base import Meta\n\n@dataclass(kw_only=True)\nclass ObservationReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponentReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponent:\n reference_range: Optional[List[ObservationComponentReferenceRange]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n value_sampled_data: Optional[SampledData] = None\n code: CodeableConcept\n value_codeable_concept: Optional[CodeableConcept] = None\n value_period: Optional[Period] = None\n value_range: Optional[Range] = None\n value_integer: Optional[int] = None\n data_absent_reason: Optional[CodeableConcept] = None\n\n@dataclass(kw_only=True)\nclass Ldlcholesterol(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/ldlcholesterol\"])\n category: Optional[List[CodeableConcept]] = field(default_factory=list)\n reference_range: list[ObservationReferenceRange] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n encounter: Optional[Reference] = None\n method: Optional[CodeableConcept] = None\n value_time: Optional[str] = None\n specimen: Optional[Reference] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n component: Optional[List[ObservationComponent]] = field(default_factory=list)\n note: Optional[List[Annotation]] = field(default_factory=list)\n value_sampled_data: Optional[SampledData] = None\n effective_date_time: Optional[str] = None\n status: str\n code: CodeableConcept\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = field(default_factory=list)\n issued: Optional[str] = None\n value_period: Optional[Period] = None\n device: Optional[Reference] = None\n effective_instant: Optional[str] = None\n based_on: Optional[List[Reference]] = field(default_factory=list)\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = field(default_factory=list)\n value_integer: Optional[int] = None\n subject: Optional[Reference] = None\n performer: Optional[List[Reference]] = field(default_factory=list)\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"} + {:path (io/file "hl7_fhir_r4_core/Cholesterol.py"), + :content + "from typing import Optional, List\nfrom dataclasses import dataclass, field\nfrom base import Meta\n\n@dataclass(kw_only=True)\nclass ObservationReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponentReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponent:\n reference_range: Optional[List[ObservationComponentReferenceRange]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n value_sampled_data: Optional[SampledData] = None\n code: CodeableConcept\n value_codeable_concept: Optional[CodeableConcept] = None\n value_period: Optional[Period] = None\n value_range: Optional[Range] = None\n value_integer: Optional[int] = None\n data_absent_reason: Optional[CodeableConcept] = None\n\n@dataclass(kw_only=True)\nclass Cholesterol(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/cholesterol\"])\n category: Optional[List[CodeableConcept]] = field(default_factory=list)\n reference_range: list[ObservationReferenceRange] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n encounter: Optional[Reference] = None\n method: Optional[CodeableConcept] = None\n value_time: Optional[str] = None\n specimen: Optional[Reference] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n component: Optional[List[ObservationComponent]] = field(default_factory=list)\n note: Optional[List[Annotation]] = field(default_factory=list)\n value_sampled_data: Optional[SampledData] = None\n effective_date_time: Optional[str] = None\n status: str\n code: CodeableConcept\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = field(default_factory=list)\n issued: Optional[str] = None\n value_period: Optional[Period] = None\n device: Optional[Reference] = None\n effective_instant: Optional[str] = None\n based_on: Optional[List[Reference]] = field(default_factory=list)\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = field(default_factory=list)\n value_integer: Optional[int] = None\n subject: Optional[Reference] = None\n performer: Optional[List[Reference]] = field(default_factory=list)\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"} + {:path + (io/file "hl7_fhir_r4_core/ObservationGenetics.py"), + :content + "from typing import Optional, List\nfrom dataclasses import dataclass, field\nfrom base import Meta\n\n@dataclass(kw_only=True)\nclass ObservationReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponentReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponent:\n reference_range: Optional[List[ObservationComponentReferenceRange]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n value_sampled_data: Optional[SampledData] = None\n code: CodeableConcept\n value_codeable_concept: Optional[CodeableConcept] = None\n value_period: Optional[Period] = None\n value_range: Optional[Range] = None\n value_integer: Optional[int] = None\n data_absent_reason: Optional[CodeableConcept] = None\n\n@dataclass(kw_only=True)\nclass ObservationGenetics(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/observation-genetics\"])\n category: Optional[List[CodeableConcept]] = field(default_factory=list)\n reference_range: Optional[List[ObservationReferenceRange]] = field(default_factory=list)\n has_member: Optional[List[Reference]] = field(default_factory=list)\n derived_from: Optional[List[Reference]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n encounter: Optional[Reference] = None\n method: Optional[CodeableConcept] = None\n value_time: Optional[str] = None\n specimen: Optional[Reference] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n component: Optional[List[ObservationComponent]] = field(default_factory=list)\n note: Optional[List[Annotation]] = field(default_factory=list)\n value_sampled_data: Optional[SampledData] = None\n effective_date_time: Optional[str] = None\n status: str\n code: CodeableConcept\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = field(default_factory=list)\n issued: Optional[str] = None\n value_period: Optional[Period] = None\n device: Optional[Reference] = None\n effective_instant: Optional[str] = None\n based_on: Optional[List[Reference]] = field(default_factory=list)\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = field(default_factory=list)\n value_integer: Optional[int] = None\n subject: Optional[Reference] = None\n performer: Optional[List[Reference]] = field(default_factory=list)\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"} + {:path + (io/file "hl7_fhir_r4_core/Devicemetricobservation.py"), + :content + "from typing import Optional, List\nfrom dataclasses import dataclass, field\nfrom base import Meta\n\n@dataclass(kw_only=True)\nclass ObservationReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponentReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponent:\n reference_range: Optional[List[ObservationComponentReferenceRange]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n value_sampled_data: Optional[SampledData] = None\n code: CodeableConcept\n value_codeable_concept: Optional[CodeableConcept] = None\n value_period: Optional[Period] = None\n value_range: Optional[Range] = None\n value_integer: Optional[int] = None\n data_absent_reason: Optional[CodeableConcept] = None\n\n@dataclass(kw_only=True)\nclass Devicemetricobservation(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/devicemetricobservation\"])\n category: Optional[List[CodeableConcept]] = field(default_factory=list)\n reference_range: Optional[List[ObservationReferenceRange]] = field(default_factory=list)\n has_member: Optional[List[Reference]] = field(default_factory=list)\n derived_from: Optional[List[Reference]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n method: Optional[CodeableConcept] = None\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n component: Optional[List[ObservationComponent]] = field(default_factory=list)\n note: Optional[List[Annotation]] = field(default_factory=list)\n value_sampled_data: Optional[SampledData] = None\n effective_date_time: str\n status: str\n code: CodeableConcept\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = field(default_factory=list)\n value_period: Optional[Period] = None\n device: Reference\n effective_instant: Optional[str] = None\n based_on: Optional[List[Reference]] = field(default_factory=list)\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = field(default_factory=list)\n value_integer: Optional[int] = None\n subject: Reference\n performer: Optional[List[Reference]] = field(default_factory=list)\n effective_period: Optional[Period] = None"} + {:path (io/file "hl7_fhir_r4_core/Triglyceride.py"), + :content + "from typing import Optional, List\nfrom dataclasses import dataclass, field\nfrom base import Meta\n\n@dataclass(kw_only=True)\nclass ObservationReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponentReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponent:\n reference_range: Optional[List[ObservationComponentReferenceRange]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n value_sampled_data: Optional[SampledData] = None\n code: CodeableConcept\n value_codeable_concept: Optional[CodeableConcept] = None\n value_period: Optional[Period] = None\n value_range: Optional[Range] = None\n value_integer: Optional[int] = None\n data_absent_reason: Optional[CodeableConcept] = None\n\n@dataclass(kw_only=True)\nclass Triglyceride(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/triglyceride\"])\n category: Optional[List[CodeableConcept]] = field(default_factory=list)\n reference_range: list[ObservationReferenceRange] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n encounter: Optional[Reference] = None\n method: Optional[CodeableConcept] = None\n value_time: Optional[str] = None\n specimen: Optional[Reference] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n component: Optional[List[ObservationComponent]] = field(default_factory=list)\n note: Optional[List[Annotation]] = field(default_factory=list)\n value_sampled_data: Optional[SampledData] = None\n effective_date_time: Optional[str] = None\n status: str\n code: CodeableConcept\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = field(default_factory=list)\n issued: Optional[str] = None\n value_period: Optional[Period] = None\n device: Optional[Reference] = None\n effective_instant: Optional[str] = None\n based_on: Optional[List[Reference]] = field(default_factory=list)\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = field(default_factory=list)\n value_integer: Optional[int] = None\n subject: Optional[Reference] = None\n performer: Optional[List[Reference]] = field(default_factory=list)\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"} + {:path (io/file "hl7_fhir_r4_core/Vitalsigns.py"), + :content + "from typing import Optional, List\nfrom dataclasses import dataclass, field\nfrom base import Meta\n\n@dataclass(kw_only=True)\nclass ObservationReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponentReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponent:\n reference_range: Optional[List[ObservationComponentReferenceRange]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n value_sampled_data: Optional[SampledData] = None\n code: CodeableConcept\n value_codeable_concept: Optional[CodeableConcept] = None\n value_period: Optional[Period] = None\n value_range: Optional[Range] = None\n value_integer: Optional[int] = None\n data_absent_reason: Optional[CodeableConcept] = None\n\n@dataclass(kw_only=True)\nclass Vitalsigns(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/vitalsigns\"])\n category: list[CodeableConcept] = field(default_factory=list)\n reference_range: Optional[List[ObservationReferenceRange]] = field(default_factory=list)\n has_member: Optional[List[Reference]] = field(default_factory=list)\n derived_from: Optional[List[Reference]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n encounter: Optional[Reference] = None\n method: Optional[CodeableConcept] = None\n value_time: Optional[str] = None\n specimen: Optional[Reference] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n component: Optional[List[ObservationComponent]] = field(default_factory=list)\n note: Optional[List[Annotation]] = field(default_factory=list)\n value_sampled_data: Optional[SampledData] = None\n effective_date_time: Optional[str] = None\n status: str\n code: CodeableConcept\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = field(default_factory=list)\n issued: Optional[str] = None\n value_period: Optional[Period] = None\n device: Optional[Reference] = None\n effective_instant: Optional[str] = None\n based_on: Optional[List[Reference]] = field(default_factory=list)\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = field(default_factory=list)\n value_integer: Optional[int] = None\n subject: Reference\n performer: Optional[List[Reference]] = field(default_factory=list)\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"} + {:path (io/file "hl7_fhir_r4_core/Hdlcholesterol.py"), + :content + "from typing import Optional, List\nfrom dataclasses import dataclass, field\nfrom base import Meta\n\n@dataclass(kw_only=True)\nclass ObservationReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponentReferenceRange:\n age: Optional[Range] = None\n low: Optional[Quantity] = None\n high: Optional[Quantity] = None\n text: Optional[str] = None\n type: Optional[CodeableConcept] = None\n applies_to: Optional[List[CodeableConcept]] = field(default_factory=list)\n\n@dataclass(kw_only=True)\nclass ObservationComponent:\n reference_range: Optional[List[ObservationComponentReferenceRange]] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n value_time: Optional[str] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n value_sampled_data: Optional[SampledData] = None\n code: CodeableConcept\n value_codeable_concept: Optional[CodeableConcept] = None\n value_period: Optional[Period] = None\n value_range: Optional[Range] = None\n value_integer: Optional[int] = None\n data_absent_reason: Optional[CodeableConcept] = None\n\n@dataclass(kw_only=True)\nclass Hdlcholesterol(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/hdlcholesterol\"])\n category: Optional[List[CodeableConcept]] = field(default_factory=list)\n reference_range: list[ObservationReferenceRange] = field(default_factory=list)\n interpretation: Optional[List[CodeableConcept]] = field(default_factory=list)\n encounter: Optional[Reference] = None\n method: Optional[CodeableConcept] = None\n value_time: Optional[str] = None\n specimen: Optional[Reference] = None\n value_quantity: Optional[Quantity] = None\n value_string: Optional[str] = None\n value_ratio: Optional[Ratio] = None\n value_boolean: Optional[bool] = None\n value_date_time: Optional[str] = None\n component: Optional[List[ObservationComponent]] = field(default_factory=list)\n note: Optional[List[Annotation]] = field(default_factory=list)\n value_sampled_data: Optional[SampledData] = None\n effective_date_time: Optional[str] = None\n status: str\n code: CodeableConcept\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = field(default_factory=list)\n issued: Optional[str] = None\n value_period: Optional[Period] = None\n device: Optional[Reference] = None\n effective_instant: Optional[str] = None\n based_on: Optional[List[Reference]] = field(default_factory=list)\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = field(default_factory=list)\n value_integer: Optional[int] = None\n subject: Optional[Reference] = None\n performer: Optional[List[Reference]] = field(default_factory=list)\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"}]) (first (sut/generate-constraints generator (vals fixtures/observation-constraints-ir-schema)))))) diff --git a/test/aidbox_sdk/generator/typescript_test.clj b/test/aidbox_sdk/generator/typescript_test.clj index 5810c6a..903dbdd 100644 --- a/test/aidbox_sdk/generator/typescript_test.clj +++ b/test/aidbox_sdk/generator/typescript_test.clj @@ -76,6 +76,12 @@ (gen.typescript/generate-property {:name "meta" :required true :value "Meta" + :type "Meta"}))) + + (is (= "meta?: Meta;" + (gen.typescript/generate-property {:name "meta" + :required false + :value "Meta" :type "Meta"})))) (testing "element with choices"