From 8339a1b9e7f1579fa95661fefab1a65120e5a89e Mon Sep 17 00:00:00 2001 From: Vitaly Kravtsov Date: Fri, 27 Sep 2024 01:32:50 +0600 Subject: [PATCH] test: update python and converter tests --- test/aidbox_sdk/converter_test.clj | 14 +- test/aidbox_sdk/fixtures/schemas.clj | 164 ++++++++++++---------- test/aidbox_sdk/generator/python_test.clj | 130 ++++++++++++----- 3 files changed, 193 insertions(+), 115 deletions(-) diff --git a/test/aidbox_sdk/converter_test.clj b/test/aidbox_sdk/converter_test.clj index 0eb7ddc..7767de7 100644 --- a/test/aidbox_sdk/converter_test.clj +++ b/test/aidbox_sdk/converter_test.clj @@ -61,8 +61,8 @@ (deftest test-convert (testing "convert resource" - (is (= [fixtures/patient-ir-schema] - (sut/convert [fixtures/patient-fhir-schema])))) + (match (sut/convert [fixtures/patient-fhir-schema]) + [fixtures/patient-ir-schema])) (testing "convert constraint" (is (= [(fixt/get-data :organization-preferred-contact-ir-schema)] @@ -70,10 +70,12 @@ (deftest test-convert-constraints (testing "constraints" - (is - (= fixtures/observation-constraints-ir-schema - (sut/convert-constraints fixtures/observation-constraints - [fixtures/observation-ir-schema]))))) + (match fixtures/observation-constraints-ir-schema + (sut/convert-constraints fixtures/observation-constraints + [fixtures/observation-ir-schema]) + + + ))) (deftest test-sort-by-base (match diff --git a/test/aidbox_sdk/fixtures/schemas.clj b/test/aidbox_sdk/fixtures/schemas.clj index 950da61..e763b90 100644 --- a/test/aidbox_sdk/fixtures/schemas.clj +++ b/test/aidbox_sdk/fixtures/schemas.clj @@ -796,6 +796,7 @@ {:package "hl7.fhir.r4.core", :derivation "specialization", :name "Patient", + :resource-name "Patient", :type "Patient", :elements [{:name "multipleBirthBoolean", @@ -963,7 +964,7 @@ :type "BackboneElement", :choice-option false}], :url "http://hl7.org/fhir/StructureDefinition/Patient", - :base-resource-name "DomainResource", + :base-resource-name "Domain-Resource", :backbone-elements [{:elements [{:name "type", @@ -980,8 +981,9 @@ :value "Base.ResourceReference", :type "Reference", :choice-option false}], - :base "BackboneElement" - :name "Patient_Link"} + :name "Patient_Link", + :resource-name "Patient_Link", + :base "BackboneElement"} {:elements [{:name "language", :base "Patient_Communication", @@ -997,8 +999,9 @@ :value "bool", :type "boolean", :choice-option false}], - :base "BackboneElement" - :name "Patient_Communication"} + :name "Patient_Communication", + :resource-name "Patient_Communication", + :base "BackboneElement"} {:elements [{:name "name", :base "Patient_Contact", @@ -1049,8 +1052,9 @@ :value "Base.CodeableConcept", :type "CodeableConcept", :choice-option false}], - :base "BackboneElement" - :name "Patient_Contact"}], + :name "Patient_Contact", + :resource-name "Patient_Contact", + :base "BackboneElement"}], :base "http://hl7.org/fhir/StructureDefinition/DomainResource", :deps #{"Address" @@ -1058,8 +1062,8 @@ "Period" "CodeableConcept" "ContactPoint" + "Domain-Resource" "HumanName" - "DomainResource" "Reference" "Identifier" "BackboneElement"}}) @@ -3511,63 +3515,62 @@ :base "http://hl7.org/fhir/StructureDefinition/DomainResource"}) (def observation-constraints-ir-schema - {"http://hl7.org/fhir/StructureDefinition/ldlcholesterol" - {:package "hl7.fhir.r4.core", - :derivation "constraint", - :patterns (), - :name "Observation", - :type "Observation", - :deps #{"Meta"} - :elements - [{:name "meta", - :required true, - :value "Meta", - :profile "http://hl7.org/fhir/StructureDefinition/ldlcholesterol", - :type "Meta", - :meta - " = new() { Profile = [\"http://hl7.org/fhir/StructureDefinition/ldlcholesterol\"] };"} - {:name "category", - :base "Observation", - :array true, - :required false, - :value "Base.CodeableConcept", - :type "CodeableConcept"} - {:name "referenceRange", - :base "Observation", - :array true, - :required true, - :value "Observation_ReferenceRange", - :type "BackboneElement"} - {:name "interpretation", - :base "Observation", - :array true, - :required false, - :value "Base.CodeableConcept", - :type "CodeableConcept"} - {:name "encounter", - :base "Observation", - :array false, - :required false, - :value "Base.ResourceReference", - :type "Reference"} - {:name "method", - :base "Observation", - :array false, - :required false, - :value "Base.CodeableConcept", - :type "CodeableConcept"} - {:name "valueTime", - :base "Observation", - :array false, - :required false, - :value "string", - :type "time"} - {:name "specimen", - :base "Observation", - :array false, - :required false, - :value "Base.ResourceReference", + {:package "hl7.fhir.r4.core", + :derivation "constraint", + :patterns [], + :name "Observation", + :resource-name "ldlcholesterol", + :type "Observation", + :elements + [{:name "meta", + :required true, + :value "Meta", + :profile "http://hl7.org/fhir/StructureDefinition/ldlcholesterol", + :type "Meta", + :meta + " = new() { Profile = [\"http://hl7.org/fhir/StructureDefinition/ldlcholesterol\"] };"} + {:name "category", + :base "Observation", + :array true, + :required false, + :value "Base.CodeableConcept", + :type "CodeableConcept"} + {:name "referenceRange", + :base "Observation", + :array true, + :required true, + :value "Observation_ReferenceRange", + :type "BackboneElement"} + {:name "interpretation", + :base "Observation", + :array true, + :required false, + :value "Base.CodeableConcept", + :type "CodeableConcept"} + {:name "encounter", + :base "Observation", + :array false, + :required false, + :value "Base.ResourceReference", + :type "Reference"} + {:name "method", + :base "Observation", + :array false, + :required false, + :value "Base.CodeableConcept", + :type "CodeableConcept"} + {:name "valueTime", + :base "Observation", + :array false, + :required false, + :value "string", + :type "time"} + {:name "specimen", + :base "Observation", + :array false, + :required false, + :value "Base.ResourceReference", :type "Reference"} {:name "valueQuantity", :base "Observation", @@ -4069,14 +4072,15 @@ :value "Base.CodeableConcept", :type "CodeableConcept"}], :name "Observation_Component"}], - :base "http://hl7.org/fhir/StructureDefinition/DomainResource"}, + :base "http://hl7.org/fhir/StructureDefinition/DomainResource", + :deps #{"Meta"}}, "http://hl7.org/fhir/StructureDefinition/cholesterol" {:package "hl7.fhir.r4.core", :derivation "constraint", :patterns [], :name "Observation", + :resource-name "cholesterol", :type "Observation", - :deps #{"Meta"} :elements [{:name "meta", :required true, @@ -4627,14 +4631,15 @@ :value "Base.CodeableConcept", :type "CodeableConcept"}], :name "Observation_Component"}], - :base "http://hl7.org/fhir/StructureDefinition/DomainResource"}, + :base "http://hl7.org/fhir/StructureDefinition/DomainResource", + :deps #{"Meta"}}, "http://hl7.org/fhir/StructureDefinition/observation-genetics" {:package "hl7.fhir.r4.core", :derivation "constraint", :patterns [], :name "Observation", + :resource-name "observation-genetics", :type "Observation", - :deps #{"Meta"} :elements [{:name "meta", :required true, @@ -5197,14 +5202,15 @@ :value "Base.CodeableConcept", :type "CodeableConcept"}], :name "Observation_Component"}], - :base "http://hl7.org/fhir/StructureDefinition/DomainResource"}, + :base "http://hl7.org/fhir/StructureDefinition/DomainResource", + :deps #{"Meta"}}, "http://hl7.org/fhir/StructureDefinition/devicemetricobservation" {:package "hl7.fhir.r4.core", :derivation "constraint", :patterns [], :name "Observation", + :resource-name "devicemetricobservation", :type "Observation", - :deps #{"Meta"} :elements [{:name "meta", :required true, @@ -5743,14 +5749,15 @@ :value "Base.CodeableConcept", :type "CodeableConcept"}], :name "Observation_Component"}], - :base "http://hl7.org/fhir/StructureDefinition/DomainResource"}, + :base "http://hl7.org/fhir/StructureDefinition/DomainResource", + :deps #{"Meta"}}, "http://hl7.org/fhir/StructureDefinition/triglyceride" {:package "hl7.fhir.r4.core", :derivation "constraint", :patterns [""], :name "Observation", + :resource-name "triglyceride", :type "Observation", - :deps #{"Meta"} :elements [{:name "meta", :required true, @@ -6301,14 +6308,15 @@ :value "Base.CodeableConcept", :type "CodeableConcept"}], :name "Observation_Component"}], - :base "http://hl7.org/fhir/StructureDefinition/DomainResource"}, + :base "http://hl7.org/fhir/StructureDefinition/DomainResource", + :deps #{"Meta"}}, "http://hl7.org/fhir/StructureDefinition/vitalsigns" {:package "hl7.fhir.r4.core", :derivation "constraint", :patterns [], :name "Observation", + :resource-name "vitalsigns", :type "Observation", - :deps #{"Meta"} :elements [{:name "meta", :required true, @@ -6872,14 +6880,15 @@ :value "Base.CodeableConcept", :type "CodeableConcept"}], :name "Observation_Component"}], - :base "http://hl7.org/fhir/StructureDefinition/DomainResource"}, + :base "http://hl7.org/fhir/StructureDefinition/DomainResource", + :deps #{"Meta"}}, "http://hl7.org/fhir/StructureDefinition/hdlcholesterol" {:package "hl7.fhir.r4.core", :derivation "constraint", :patterns [], :name "Observation", + :resource-name "hdlcholesterol", :type "Observation", - :deps #{"Meta"} :elements [{:name "meta", :required true, @@ -7430,4 +7439,5 @@ :value "Base.CodeableConcept", :type "CodeableConcept"}], :name "Observation_Component"}], - :base "http://hl7.org/fhir/StructureDefinition/DomainResource"}}) + :base "http://hl7.org/fhir/StructureDefinition/DomainResource", + :deps #{"Meta"}}}) diff --git a/test/aidbox_sdk/generator/python_test.clj b/test/aidbox_sdk/generator/python_test.clj index 2b85a22..7f7dfe6 100644 --- a/test/aidbox_sdk/generator/python_test.clj +++ b/test/aidbox_sdk/generator/python_test.clj @@ -4,7 +4,8 @@ [aidbox-sdk.generator :as sut] [aidbox-sdk.generator.python :refer [generator] :as gen.python] [clojure.java.io :as io] - [clojure.test :refer [deftest is testing]])) + [clojure.test :refer [deftest is testing]] + [clojure.string :as str])) (deftest test-generate-deps (testing "no members" @@ -28,7 +29,7 @@ :array false, :required false, :value "bool" - :type "boolean"})))) + :type "boolean"} false)))) (testing "required" (is (= "type: str" @@ -37,25 +38,25 @@ :array false, :required true, :value "string" - :type "string"})))) + :type "string"} false)))) (testing "array optional" - (is (= "address: Optional[List[Address]] = None" + (is (= "address: Optional[List[Address]] = field(default_factory=list)" (gen.python/generate-property {:name "address", :base "Patient", :array true, :required false, :value "Address" - :type "Address"})))) + :type "Address"} false)))) (testing "array required" - (is (= "extension: list[Extension] = []" + (is (= "extension: list[Extension] = field(default_factory=list)" (gen.python/generate-property {:name "extension", :base "Element", :array true, :required true, :value "Extension" - :type "Extension"})))) + :type "Extension"} false)))) (testing "element with literal" ;; TODO @@ -71,58 +72,123 @@ (deftest test-generate-class (testing "base" - (is (= "class Patient(DomainResource):\n multiple_birth_boolean: Optional[bool] = None\n address: Optional[List[Address]] = None\n deceased_date_time: Optional[str] = None\n managing_organization: Optional[Reference] = None\n deceased_boolean: Optional[bool] = None\n name: Optional[List[HumanName]] = None\n birth_date: Optional[str] = None\n multiple_birth_integer: Optional[int] = None\n photo: Optional[List[Attachment]] = None\n link: Optional[List[Patient_Link]] = None\n active: Optional[bool] = None\n communication: Optional[List[Patient_Communication]] = None\n identifier: Optional[List[Identifier]] = None\n telecom: Optional[List[ContactPoint]] = None\n general_practitioner: Optional[List[Reference]] = None\n gender: Optional[str] = None\n marital_status: Optional[CodeableConcept] = None\n contact: Optional[List[Patient_Contact]] = None" + (is (= "@dataclass(kw_only=True)\nclass Patient(DomainResource):\n multiple_birth_boolean: Optional[bool] = None\n address: Optional[List[Address]] = field(default_factory=list)\n deceased_date_time: Optional[str] = None\n managing_organization: Optional[Reference] = None\n deceased_boolean: Optional[bool] = None\n name: Optional[List[HumanName]] = field(default_factory=list)\n birth_date: Optional[str] = None\n multiple_birth_integer: Optional[int] = None\n photo: Optional[List[Attachment]] = field(default_factory=list)\n link: Optional[List[PatientLink]] = field(default_factory=list)\n active: Optional[bool] = None\n communication: Optional[List[PatientCommunication]] = field(default_factory=list)\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n telecom: Optional[List[ContactPoint]] = field(default_factory=list)\n general_practitioner: Optional[List[Reference]] = field(default_factory=list)\n gender: Optional[str] = None\n marital_status: Optional[CodeableConcept] = None\n contact: Optional[List[PatientContact]] = field(default_factory=list)" (gen.python/generate-class fixtures/patient-ir-schema)))) (testing "with inner classes" - (is (= "class Patient_Link(BackboneElement):\n other: Reference\n type: str\n\nclass Patient_Communication(BackboneElement):\n language: CodeableConcept\n preferred: Optional[bool] = None\n\nclass Patient_Contact(BackboneElement):\n address: Optional[Address] = None\n gender: Optional[str] = None\n name: Optional[HumanName] = None\n organization: Optional[Reference] = None\n period: Optional[Period] = None\n relationship: Optional[List[CodeableConcept]] = None\n telecom: Optional[List[ContactPoint]] = None\n\nclass Patient(DomainResource):\n multiple_birth_boolean: Optional[bool] = None\n address: Optional[List[Address]] = None\n deceased_date_time: Optional[str] = None\n managing_organization: Optional[Reference] = None\n deceased_boolean: Optional[bool] = None\n name: Optional[List[HumanName]] = None\n birth_date: Optional[str] = None\n multiple_birth_integer: Optional[int] = None\n photo: Optional[List[Attachment]] = None\n link: Optional[List[Patient_Link]] = None\n active: Optional[bool] = None\n communication: Optional[List[Patient_Communication]] = None\n identifier: Optional[List[Identifier]] = None\n telecom: Optional[List[ContactPoint]] = None\n general_practitioner: Optional[List[Reference]] = None\n gender: Optional[str] = None\n marital_status: Optional[CodeableConcept] = None\n contact: Optional[List[Patient_Contact]] = None" + (is (= "class PatientLink(BackboneElement):\n other: Reference\n type: str\n\nclass PatientCommunication(BackboneElement):\n language: CodeableConcept\n preferred: Optional[bool] = None\n\nclass PatientContact(BackboneElement):\n address: Optional[Address] = None\n gender: Optional[str] = None\n name: Optional[HumanName] = None\n organization: Optional[Reference] = None\n period: Optional[Period] = None\n relationship: Optional[List[CodeableConcept]] = None\n telecom: Optional[List[ContactPoint]] = None\n\n@dataclass(kw_only=True)\nclass Patient(DomainResource):\n multiple_birth_boolean: Optional[bool] = None\n address: Optional[List[Address]] = field(default_factory=list)\n deceased_date_time: Optional[str] = None\n managing_organization: Optional[Reference] = None\n deceased_boolean: Optional[bool] = None\n name: Optional[List[HumanName]] = field(default_factory=list)\n birth_date: Optional[str] = None\n multiple_birth_integer: Optional[int] = None\n photo: Optional[List[Attachment]] = field(default_factory=list)\n link: Optional[List[PatientLink]] = field(default_factory=list)\n active: Optional[bool] = None\n communication: Optional[List[PatientCommunication]] = field(default_factory=list)\n identifier: Optional[List[Identifier]] = field(default_factory=list)\n telecom: Optional[List[ContactPoint]] = field(default_factory=list)\n general_practitioner: Optional[List[Reference]] = field(default_factory=list)\n gender: Optional[str] = None\n marital_status: Optional[CodeableConcept] = None\n contact: Optional[List[PatientContact]] = field(default_factory=list)" (gen.python/generate-class fixtures/patient-ir-schema - ["class Patient_Link(BackboneElement):\n other: Reference\n type: str" - "class Patient_Communication(BackboneElement):\n language: CodeableConcept\n preferred: Optional[bool] = None" - "class Patient_Contact(BackboneElement):\n address: Optional[Address] = None\n gender: Optional[str] = None\n name: Optional[HumanName] = None\n organization: Optional[Reference] = None\n period: Optional[Period] = None\n relationship: Optional[List[CodeableConcept]] = None\n telecom: Optional[List[ContactPoint]] = None"]))))) + ["class PatientLink(BackboneElement):\n other: Reference\n type: str" + "class PatientCommunication(BackboneElement):\n language: CodeableConcept\n preferred: Optional[bool] = None" + "class PatientContact(BackboneElement):\n address: Optional[Address] = None\n gender: Optional[str] = None\n name: Optional[HumanName] = None\n organization: Optional[Reference] = None\n period: Optional[Period] = None\n relationship: Optional[List[CodeableConcept]] = None\n telecom: Optional[List[ContactPoint]] = None"]))))) (deftest test-generate-datatypes (is (= [{:path (io/file "base/__init__.py"), :content - "from pydantic import *\nfrom typing import Optional, List\n\nclass Coding(Element):\n code: Optional[str] = None\n system: Optional[str] = None\n display: Optional[str] = None\n version: Optional[str] = None\n user_selected: Optional[bool] = None"}] + (str/join "\n" ["from __future__ import annotations" + "from typing import Optional, List" + "from dataclasses import dataclass, field" + "" + "@dataclass(kw_only=True)" + "class Coding(Element):" + " code: Optional[str] = None" + " system: Optional[str] = None" + " display: Optional[str] = None" + " version: Optional[str] = None" + " user_selected: Optional[bool] = None"])}] + (sut/generate-datatypes generator [fixtures/coding-ir-schema])))) (deftest test-generate-resources (is - (= {:path (io/file "hl7-fhir-r4-core/Patient.py"), + (= {:path (io/file "hl7_fhir_r4_core/Patient.py"), :content - "from pydantic import *\nfrom typing import Optional, List\nfrom ..base import *\n\nclass Patient_Link(BackboneElement):\n type: str\n other: Reference\n\nclass Patient_Communication(BackboneElement):\n language: CodeableConcept\n preferred: Optional[bool] = None\n\nclass Patient_Contact(BackboneElement):\n name: Optional[HumanName] = None\n gender: Optional[str] = None\n period: Optional[Period] = None\n address: Optional[Address] = None\n telecom: Optional[List[ContactPoint]] = None\n organization: Optional[Reference] = None\n relationship: Optional[List[CodeableConcept]] = None\n\nclass Patient(DomainResource):\n multiple_birth_boolean: Optional[bool] = None\n address: Optional[List[Address]] = None\n deceased_date_time: Optional[str] = None\n managing_organization: Optional[Reference] = None\n deceased_boolean: Optional[bool] = None\n name: Optional[List[HumanName]] = None\n birth_date: Optional[str] = None\n multiple_birth_integer: Optional[int] = None\n photo: Optional[List[Attachment]] = None\n link: Optional[List[Patient_Link]] = None\n active: Optional[bool] = None\n communication: Optional[List[Patient_Communication]] = None\n identifier: Optional[List[Identifier]] = None\n telecom: Optional[List[ContactPoint]] = None\n general_practitioner: Optional[List[Reference]] = None\n gender: Optional[str] = None\n marital_status: Optional[CodeableConcept] = None\n contact: Optional[List[Patient_Contact]] = None"} + (str/join "\n" ["from typing import Optional, List" + "from dataclasses import dataclass, field" + "from base import Address" + "from base import Attachment" + "from base import Period" + "from base import CodeableConcept" + "from base import ContactPoint" + "from base import DomainResource" + "from base import HumanName" + "from base import Reference" + "from base import Identifier" + "from base import BackboneElement" + "" + "@dataclass(kw_only=True)" + "class PatientLink(BackboneElement):" + " type: str" + " other: Reference" + "" + "@dataclass(kw_only=True)" + "class PatientCommunication(BackboneElement):" + " language: CodeableConcept" + " preferred: Optional[bool] = None" + "" + "@dataclass(kw_only=True)" + "class PatientContact(BackboneElement):" + " name: Optional[HumanName] = None" + " gender: Optional[str] = None" + " period: Optional[Period] = None" + " address: Optional[Address] = None" + " telecom: Optional[List[ContactPoint]] = field(default_factory=list)" + " organization: Optional[Reference] = None" + " relationship: Optional[List[CodeableConcept]] = field(default_factory=list)" + "" + "@dataclass(kw_only=True)" + "class Patient(DomainResource):" + " multiple_birth_boolean: Optional[bool] = None" + " address: Optional[List[Address]] = field(default_factory=list)" + " deceased_date_time: Optional[str] = None" + " managing_organization: Optional[Reference] = None" + " deceased_boolean: Optional[bool] = None" + " name: Optional[List[HumanName]] = field(default_factory=list)" + " birth_date: Optional[str] = None" + " multiple_birth_integer: Optional[int] = None" + " photo: Optional[List[Attachment]] = field(default_factory=list)" + " link: Optional[List[PatientLink]] = field(default_factory=list)" + " active: Optional[bool] = None" + " communication: Optional[List[PatientCommunication]] = field(default_factory=list)" + " identifier: Optional[List[Identifier]] = field(default_factory=list)" + " telecom: Optional[List[ContactPoint]] = field(default_factory=list)" + " general_practitioner: Optional[List[Reference]] = field(default_factory=list)" + " gender: Optional[str] = None" + " marital_status: Optional[CodeableConcept] = None" + " contact: Optional[List[PatientContact]] = field(default_factory=list)"])} (sut/generate-resource-module generator fixtures/patient-ir-schema)))) (deftest test-generate-search-params (is - (= [{:path (io/file "search/PatientSearchParameters.py"), + (= (sut/generate-search-params generator fixtures/patient-search-params-ir-schemas) + [{:path (io/file "search/PatientSearchParameters.py"), :content - "from typing import Optional\n\nclass PatientSearchParameters(DomainResourceSearchParameters):\n id: Optional[str] = None\n active: Optional[str] = None\n address: Optional[str] = None\n address_city: Optional[str] = None\n address_country: Optional[str] = None\n address_postalcode: Optional[str] = None\n address_state: Optional[str] = None\n address_use: Optional[str] = None\n age: Optional[str] = None\n birth_order_boolean: Optional[str] = None\n birthdate: Optional[str] = None\n death_date: Optional[str] = None\n deceased: Optional[str] = None\n email: Optional[str] = None\n ethnicity: Optional[str] = None\n family: Optional[str] = None\n gender: Optional[str] = None\n general_practitioner: Optional[str] = None\n given: Optional[str] = None\n identifier: Optional[str] = None\n language: Optional[str] = None\n link: Optional[str] = None\n mothers_maiden_name: Optional[str] = None\n name: Optional[str] = None\n organization: Optional[str] = None\n part_agree: Optional[str] = None\n phone: Optional[str] = None\n phonetic: Optional[str] = None\n race: Optional[str] = None\n telecom: Optional[str] = None"}] - (sut/generate-search-params generator fixtures/patient-search-params-ir-schemas)))) + "from typing import Optional\nfrom dataclasses import dataclass, field\nfrom .DomainResourceSearchParameters import DomainResourceSearchParameters\n\n@dataclass(kw_only=True)\nclass PatientSearchParameters(DomainResourceSearchParameters):\n id: Optional[str] = None\n active: Optional[str] = None\n address: Optional[str] = None\n address_city: Optional[str] = None\n address_country: Optional[str] = None\n address_postalcode: Optional[str] = None\n address_state: Optional[str] = None\n address_use: Optional[str] = None\n age: Optional[str] = None\n birth_order_boolean: Optional[str] = None\n birthdate: Optional[str] = None\n death_date: Optional[str] = None\n deceased: Optional[str] = None\n email: Optional[str] = None\n ethnicity: Optional[str] = None\n family: Optional[str] = None\n gender: Optional[str] = None\n general_practitioner: Optional[str] = None\n given: Optional[str] = None\n identifier: Optional[str] = None\n language: Optional[str] = None\n link: Optional[str] = None\n mothers_maiden_name: Optional[str] = None\n name: Optional[str] = None\n organization: Optional[str] = None\n part_agree: Optional[str] = None\n phone: Optional[str] = None\n phonetic: Optional[str] = None\n race: Optional[str] = None\n telecom: Optional[str] = None"}]))) (deftest generate-constraints (is - (= [{:path (io/file "hl7-fhir-r4-core/Ldlcholesterol.py"), + (= [{:path (io/file "hl7_fhir_r4_core/Ldlcholesterol.py"), :content - "from pydantic import *\nfrom typing import Optional, List\nfrom ..base import *\n\nclass Observation_ReferenceRange(BackboneElement):\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]] = None\n\nclass Observation_Component_ReferenceRange(BackboneElement):\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]] = None\n\nclass Observation_Component(BackboneElement):\n reference_range: Optional[List[Observation_Component_ReferenceRange]] = None\n interpretation: Optional[List[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 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\nclass Ldlcholesterol(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/ldlcholesterol\"])\n category: Optional[List[CodeableConcept]] = None\n reference_range: list[Observation_ReferenceRange] = []\n interpretation: Optional[List[CodeableConcept]] = None\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[Observation_Component]] = None\n note: Optional[List[Annotation]] = None\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]] = None\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = None\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]] = None\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = None\n value_integer: Optional[int] = None\n subject: Optional[Reference] = None\n performer: Optional[List[Reference]] = None\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"} - {:path (io/file "hl7-fhir-r4-core/Cholesterol.py"), + "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 pydantic import *\nfrom typing import Optional, List\nfrom ..base import *\n\nclass Observation_ReferenceRange(BackboneElement):\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]] = None\n\nclass Observation_Component_ReferenceRange(BackboneElement):\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]] = None\n\nclass Observation_Component(BackboneElement):\n reference_range: Optional[List[Observation_Component_ReferenceRange]] = None\n interpretation: Optional[List[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 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\nclass Cholesterol(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/cholesterol\"])\n category: Optional[List[CodeableConcept]] = None\n reference_range: list[Observation_ReferenceRange] = []\n interpretation: Optional[List[CodeableConcept]] = None\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[Observation_Component]] = None\n note: Optional[List[Annotation]] = None\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]] = None\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = None\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]] = None\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = None\n value_integer: Optional[int] = None\n subject: Optional[Reference] = None\n performer: Optional[List[Reference]] = None\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"} - {:path (io/file "hl7-fhir-r4-core/ObservationGenetics.py"), + "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 pydantic import *\nfrom typing import Optional, List\nfrom ..base import *\n\nclass Observation_ReferenceRange(BackboneElement):\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]] = None\n\nclass Observation_Component_ReferenceRange(BackboneElement):\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]] = None\n\nclass Observation_Component(BackboneElement):\n reference_range: Optional[List[Observation_Component_ReferenceRange]] = None\n interpretation: Optional[List[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 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\nclass Observation-genetics(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/observation-genetics\"])\n category: Optional[List[CodeableConcept]] = None\n reference_range: Optional[List[Observation_ReferenceRange]] = None\n has_member: Optional[List[Reference]] = None\n derived_from: Optional[List[Reference]] = None\n interpretation: Optional[List[CodeableConcept]] = None\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[Observation_Component]] = None\n note: Optional[List[Annotation]] = None\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]] = None\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = None\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]] = None\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = None\n value_integer: Optional[int] = None\n subject: Optional[Reference] = None\n performer: Optional[List[Reference]] = None\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"} - {:path (io/file "hl7-fhir-r4-core/Devicemetricobservation.py"), + "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 pydantic import *\nfrom typing import Optional, List\nfrom ..base import *\n\nclass Observation_ReferenceRange(BackboneElement):\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]] = None\n\nclass Observation_Component_ReferenceRange(BackboneElement):\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]] = None\n\nclass Observation_Component(BackboneElement):\n reference_range: Optional[List[Observation_Component_ReferenceRange]] = None\n interpretation: Optional[List[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 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\nclass Devicemetricobservation(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/devicemetricobservation\"])\n category: Optional[List[CodeableConcept]] = None\n reference_range: Optional[List[Observation_ReferenceRange]] = None\n has_member: Optional[List[Reference]] = None\n derived_from: Optional[List[Reference]] = None\n interpretation: Optional[List[CodeableConcept]] = None\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[Observation_Component]] = None\n note: Optional[List[Annotation]] = None\n value_sampled_data: Optional[SampledData] = None\n effective_date_time: str\n status: str\n code: CodeableConcept\n identifier: Optional[List[Identifier]] = None\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = None\n value_period: Optional[Period] = None\n device: Reference\n effective_instant: Optional[str] = None\n based_on: Optional[List[Reference]] = None\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = None\n value_integer: Optional[int] = None\n subject: Reference\n performer: Optional[List[Reference]] = None\n effective_period: Optional[Period] = None"} - {:path (io/file "hl7-fhir-r4-core/Triglyceride.py"), + "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 pydantic import *\nfrom typing import Optional, List\nfrom ..base import *\n\nclass Observation_ReferenceRange(BackboneElement):\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]] = None\n\nclass Observation_Component_ReferenceRange(BackboneElement):\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]] = None\n\nclass Observation_Component(BackboneElement):\n reference_range: Optional[List[Observation_Component_ReferenceRange]] = None\n interpretation: Optional[List[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 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\nclass Triglyceride(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/triglyceride\"])\n category: Optional[List[CodeableConcept]] = None\n reference_range: list[Observation_ReferenceRange] = []\n interpretation: Optional[List[CodeableConcept]] = None\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[Observation_Component]] = None\n note: Optional[List[Annotation]] = None\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]] = None\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = None\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]] = None\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = None\n value_integer: Optional[int] = None\n subject: Optional[Reference] = None\n performer: Optional[List[Reference]] = None\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"} - {:path (io/file "hl7-fhir-r4-core/Vitalsigns.py"), + "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 pydantic import *\nfrom typing import Optional, List\nfrom ..base import *\n\nclass Observation_ReferenceRange(BackboneElement):\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]] = None\n\nclass Observation_Component_ReferenceRange(BackboneElement):\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]] = None\n\nclass Observation_Component(BackboneElement):\n reference_range: Optional[List[Observation_Component_ReferenceRange]] = None\n interpretation: Optional[List[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 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\nclass Vitalsigns(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/vitalsigns\"])\n category: list[CodeableConcept] = []\n reference_range: Optional[List[Observation_ReferenceRange]] = None\n has_member: Optional[List[Reference]] = None\n derived_from: Optional[List[Reference]] = None\n interpretation: Optional[List[CodeableConcept]] = None\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[Observation_Component]] = None\n note: Optional[List[Annotation]] = None\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]] = None\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = None\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]] = None\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = None\n value_integer: Optional[int] = None\n subject: Reference\n performer: Optional[List[Reference]] = None\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"} - {:path (io/file "hl7-fhir-r4-core/Hdlcholesterol.py"), + "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 pydantic import *\nfrom typing import Optional, List\nfrom ..base import *\n\nclass Observation_ReferenceRange(BackboneElement):\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]] = None\n\nclass Observation_Component_ReferenceRange(BackboneElement):\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]] = None\n\nclass Observation_Component(BackboneElement):\n reference_range: Optional[List[Observation_Component_ReferenceRange]] = None\n interpretation: Optional[List[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 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\nclass Hdlcholesterol(DomainResource):\n meta: Meta = Meta(profile=[\"http://hl7.org/fhir/StructureDefinition/hdlcholesterol\"])\n category: Optional[List[CodeableConcept]] = None\n reference_range: list[Observation_ReferenceRange] = []\n interpretation: Optional[List[CodeableConcept]] = None\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[Observation_Component]] = None\n note: Optional[List[Annotation]] = None\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]] = None\n effective_timing: Optional[Timing] = None\n value_codeable_concept: Optional[CodeableConcept] = None\n body_site: Optional[CodeableConcept] = None\n focus: Optional[List[Reference]] = None\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]] = None\n value_range: Optional[Range] = None\n part_of: Optional[List[Reference]] = None\n value_integer: Optional[int] = None\n subject: Optional[Reference] = None\n performer: Optional[List[Reference]] = None\n data_absent_reason: Optional[CodeableConcept] = None\n effective_period: Optional[Period] = None"}] + "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"}] (sut/generate-constraints generator fixtures/observation-constraints-ir-schema))))