diff --git a/src/aidbox_sdk/converter.clj b/src/aidbox_sdk/converter.clj index 5db1720..f5a5cf9 100644 --- a/src/aidbox_sdk/converter.clj +++ b/src/aidbox_sdk/converter.clj @@ -8,6 +8,43 @@ [clojure.string :as str] [clojure.walk :as walk])) +;; +;; Topological Sorting of IR Schemas +;; + +(defn build-dependency-graph [schemas] + (let [name->map (reduce (fn [acc v] (assoc acc (:url v) v)) schemas)] + (reduce (fn [graph {:keys [url base]}] + (if (and base (contains? name->map base)) + (update graph url conj base) + graph)) + (zipmap (map :url schemas) (repeat #{})) + schemas))) + +(defn topological-sort + "https://en.wikipedia.org/wiki/Topological_sorting" + [graph] + (when (seq graph) + (when-let [depless (keep (fn [[k v]] (when (empty? v) k)) graph)] + (concat depless + (topological-sort + (into {} + (map (fn [[k v]] [k (apply disj v depless)])) + (apply dissoc graph depless))))))) + +(defn sort-by-base + "Sorts IR schemas by base class in topological order. + This ensures that base classes are generated before their inheriting classes." + [ir-schemas] + (->> ir-schemas + build-dependency-graph + topological-sort + (map (fn [url] (fhir/find-by-url url ir-schemas))))) + +;; +;; +;; + (def primitives #{"dateTime" "xhtml" "Distance" "time" "date" "string" "uuid" "oid" "id" "Dosage" "Duration" "instant" "Count" "decimal" "code" "base64Binary" "unsignedInt" "url" "markdown" "uri" "positiveInt" "canonical" "Age" "Timing"}) (defn url->resource-name @@ -263,144 +300,117 @@ ;; Constraints ;; -(defn apply-excluded [excluded schema] - (filter (fn [field-schema] - (not (some #(= % (:name field-schema)) excluded))) - schema)) - -(defn apply-required [required elements] - (->> elements - (map (fn [element] - (if (contains? (set required) (:name element)) - (assoc element :required true) - element))))) - -(defn apply-choices [choices schema] - (->> choices - (map (fn [[key item]] (set/difference - (set (:choices (first (filter #(= (:name %) (name key)) schema)))) - (set (:choices item))))) - (reduce set/union #{}) - ((fn [choices-to-exclude] - (filter #(not (contains? choices-to-exclude (:name %))) schema))))) - -(defn pattern-codeable-concept [name schema] - (->> (str "}") - (str "\tpublic new " (str/join ", " (map #(str "Coding" (str/join (str/split (:code %) #"-"))) (get-in schema [:pattern :coding] []))) "[] Coding { get; } = [new()];\n") #_(str/join ", " (map #(str "Coding" (str/join (str/split (:code %) #"-")) "()") (get-in schema [:pattern :coding] []))) - (str "\nclass " (str/join (map uppercase-first-letter (str/split name #"-"))) " : CodeableConcept\n{\n") - (str (when-let [coding (:coding (:pattern schema))] - (str/join (map (fn [code] - (->> (str "}") - (str (when (contains? code :code) (str "\tpublic new string Code { get; } = \"" (:code code) "\";\n"))) - (str (when (contains? code :system) (str "\tpublic new string System { get; } = \"" (:system code) "\";\n"))) - (str (when (contains? code :display) (str "\tpublic new string Display { get; } = \"" (:display code) "\";\n"))) - (str "\n\nclass Coding" (str/join (str/split (:code code) #"-")) " : Coding\n{\n"))) coding))) "\n"))) - -(defn create-single-pattern [constraint-name [key schema] elements] - (case (url->resource-name (some #(when (= (name key) (:name %)) (:value %)) elements)) - "CodeableConcept" (pattern-codeable-concept (str (uppercase-first-letter (url->resource-name constraint-name)) (uppercase-first-letter (subs (str key) 1))) schema) "")) - -(defn apply-patterns [constraint-name patterns schema] - (->> (map (fn [item] - (if-let [pattern (some #(when (= (name (first %)) (:name item)) (last %)) patterns)] - (case (:value item) - "str" (assoc item :value (:pattern pattern) :literal true) - "CodeableConcept" (conj item (hash-map :value (str - (str/join - (map uppercase-first-letter - (str/split (url->resource-name constraint-name) #"-"))) - (str/join (map uppercase-first-letter - (str/split (:name item) #"-")))) - :codeable-concept-pattern true)) - "Quantity" item item) item)) (:elements schema)) - (hash-map :elements) (conj schema (hash-map :patterns (concat (get schema :patterns []) (map (fn [item] (create-single-pattern constraint-name item (:elements schema))) patterns)))))) - -(defn add-meta [constraint-name elements] - (->> (filter #(not (= (:name %) "meta")) elements) - (concat [{:name "meta" - :required true - :value "Meta" - :profile constraint-name - :type "Meta" - :meta (str " = new() { Profile = [\"" constraint-name "\"] };")}]))) - -(defn copy-from-constraint [properties new-schema] - (merge new-schema properties)) - -(defn convert-constraint [constraint parent-schema] - (->> (:elements parent-schema) - (apply-required (:required constraint)) - (apply-excluded (:excluded constraint)) - (apply-choices (filter #(contains? (last %) :choices) - (:elements constraint))) - (add-meta (:url constraint)) - (hash-map :elements) - (conj parent-schema) - (copy-from-constraint {:package (:package constraint) - :derivation (:derivation constraint)}) - (apply-patterns (:url constraint) - (filter #(contains? (last %) :pattern) - (:elements constraint))) - ((fn [schema] (update schema :deps set/union #{"Meta"}))) - ((fn [schema] (assoc schema :resource-name (url->resource-name (:url constraint)) ))))) - -(defn convert-constraints [constraint-schemas base-schemas] - (let [base-schemas (vector->map base-schemas)] - (loop [result {}] - (if (= (count constraint-schemas) (count result)) - result - (recur - (reduce (fn [acc constraint-schema] - (cond - (contains? result (:url constraint-schema)) - acc - - (contains? result (:base constraint-schema)) - (assoc acc - (:url constraint-schema) - (convert-constraint constraint-schema - (get result (:base constraint-schema)))) +#_(defn apply-choices [choices schema] + (->> choices + (map (fn [[key item]] (set/difference + (set (:choices (first (filter #(= (:name %) (name key)) schema)))) + (set (:choices item))))) + (reduce set/union #{}) + ((fn [choices-to-exclude] + (filter #(not (contains? choices-to-exclude (:name %))) schema))))) + +#_(defn pattern-codeable-concept [name schema] + (->> (str "}") + (str "\tpublic new " (str/join ", " (map #(str "Coding" (str/join (str/split (:code %) #"-"))) (get-in schema [:pattern :coding] []))) "[] Coding { get; } = [new()];\n") #_(str/join ", " (map #(str "Coding" (str/join (str/split (:code %) #"-")) "()") (get-in schema [:pattern :coding] []))) + (str "\nclass " (str/join (map uppercase-first-letter (str/split name #"-"))) " : CodeableConcept\n{\n") + (str (when-let [coding (:coding (:pattern schema))] + (str/join (map (fn [code] + (->> (str "}") + (str (when (contains? code :code) (str "\tpublic new string Code { get; } = \"" (:code code) "\";\n"))) + (str (when (contains? code :system) (str "\tpublic new string System { get; } = \"" (:system code) "\";\n"))) + (str (when (contains? code :display) (str "\tpublic new string Display { get; } = \"" (:display code) "\";\n"))) + (str "\n\nclass Coding" (str/join (str/split (:code code) #"-")) " : Coding\n{\n"))) coding))) "\n"))) + +#_(defn create-single-pattern [constraint-name [key schema] elements] + (case (url->resource-name (some #(when (= (name key) (:name %)) (:value %)) elements)) + "CodeableConcept" (pattern-codeable-concept (str (uppercase-first-letter (url->resource-name constraint-name)) (uppercase-first-letter (subs (str key) 1))) schema) "")) + +#_(defn apply-patterns [constraint-name patterns schema] + (->> (map (fn [item] + (if-let [pattern (some #(when (= (name (first %)) (:name item)) + (last %)) + patterns)] + (case (:value item) + "str" (assoc item :value (:pattern pattern) :literal true) + "CodeableConcept" (conj item (hash-map :value (str + (str/join + (map uppercase-first-letter + (str/split (url->resource-name constraint-name) #"-"))) + (str/join (map uppercase-first-letter + (str/split (:name item) #"-")))) + :codeable-concept-pattern true)) + "Quantity" item item) item))) + (hash-map :elements) (conj schema (hash-map :patterns (concat (get schema :patterns []) (map (fn [item] (create-single-pattern constraint-name item (:elements schema))) patterns)))))) + +#_(defn copy-from-constraint [properties new-schema] + (merge new-schema properties)) + +#_(defn convert-constraint [constraint base-schema] + (->> (:elements base-schema) + (apply-required (:required constraint)) + (apply-excluded (:excluded constraint)) + (apply-choices (filter #(contains? (last %) :choices) + (:elements constraint))) + (add-meta (:url constraint)) + (hash-map :elements) + (conj base-schema) + (copy-from-constraint {:package (:package constraint) + :derivation (:derivation constraint)}) + (apply-patterns (:url constraint) + (filter #(contains? (last %) :pattern) + (:elements constraint))) + ((fn [schema] (update schema :deps set/union #{"Meta"}))) + ((fn [schema] (assoc schema :resource-name (url->resource-name (:url constraint))))))) + + +(defn apply-constraint [base-schema constraint] + (-> base-schema + ;; apply required + (update :elements + (fn [elements] + (map (fn [element] + (if (contains? (set (:required constraint)) (:name element)) + (assoc element :required true) + element)) + elements))) + + ;; apply excluded + ;; TODO update choices too + (update :elements + (fn [elements] + (remove (fn [element] + (contains? (set (:excluded constraint)) (:name element))) + elements))) - (contains? base-schemas (:base constraint-schema)) + ;; add or update meta element + (update :elements + (fn [elements] + (conj (remove #(= (:name %) "meta") elements) + {:name "meta" + :required true + :value "Meta" + :profile (:url constraint) + :type "Meta" + ;; TODO remove this when dotnet generator will be using + ;; profile field instead + :meta (str " = new() { Profile = [\"" (:url constraint) "\"] };")}))) + + ;; add Meta to deps + (update :deps set/union #{"Meta"}) + + ;; copy constraint common fields + (assoc :resource-name (url->resource-name (:url constraint))) + (assoc :derivation (:derivation constraint)))) + +(defn apply-constraints [base-schemas constraints] + (let [base-schemas (vector->map base-schemas)] + (->> constraints + sort-by-base + (reduce (fn [acc constraint] + (let [base-schema (or (get base-schemas (:base constraint)) + (get acc (:base constraint)))] (assoc acc - (:url constraint-schema) - (convert-constraint constraint-schema - (get base-schemas (:base constraint-schema)))) - - :else acc)) - - result - constraint-schemas)))))) - -;; -;; Topological Sorting of IR Schemas -;; - -(defn- build-dependency-graph [schemas] - (let [name->map (reduce (fn [acc v] (assoc acc (:url v) v)) schemas)] - (reduce (fn [graph {:keys [url base]}] - (if (and base (contains? name->map base)) - (update graph url conj base) - graph)) - (zipmap (map :url schemas) (repeat #{})) - schemas))) - -(defn- topological-sort - "https://en.wikipedia.org/wiki/Topological_sorting" - [graph] - (when (seq graph) - (when-let [depless (keep (fn [[k v]] (when (empty? v) k)) graph)] - (concat depless - (topological-sort - (into {} - (map (fn [[k v]] [k (apply disj v depless)])) - (apply dissoc graph depless))))))) - -(defn sort-by-base - "Sorts IR schemas by base class in topological order. - This ensures that base classes are generated before their inheriting classes." - [ir-schemas] - (->> ir-schemas - build-dependency-graph - topological-sort - (map (fn [url] (fhir/find-by-url url ir-schemas))))) + (:url constraint) + (apply-constraint base-schema constraint)))) + {}) + (vals)))) diff --git a/src/aidbox_sdk/core.clj b/src/aidbox_sdk/core.clj index 723f4e8..54c01ee 100644 --- a/src/aidbox_sdk/core.clj +++ b/src/aidbox_sdk/core.clj @@ -53,7 +53,6 @@ :typescript typescript/generator :java java/generator)) - (defn generate! [target-language input options] (let [output-dir (io/file (:output-dir options)) save-files! #(save-files! output-dir %) @@ -82,8 +81,9 @@ resource-ir-schemas (converter/convert resource-schemas) search-param-ir-schemas (converter/convert-search-params search-param-schemas fhir-schemas) - constraint-ir-schemas (converter/convert-constraints constraint-schemas - (remove fhir/constraint? ir-schemas)) + constraint-ir-schemas (converter/apply-constraints + (filter fhir/specialization? ir-schemas) + constraint-schemas) generator' (lang->generator target-language) diff --git a/src/aidbox_sdk/generator/dotnet.clj b/src/aidbox_sdk/generator/dotnet.clj index 528731a..1ad702c 100644 --- a/src/aidbox_sdk/generator/dotnet.clj +++ b/src/aidbox_sdk/generator/dotnet.clj @@ -280,12 +280,12 @@ (:elements ir-schema))}))}) ir-schemas)) - (generate-constraints [_ constraint-ir-schemas] - (mapv (fn [[name' schema]] - {:path (constraint-file-path schema name') - :content (generate-constraint-module - (assoc schema :url name'))}) - constraint-ir-schemas)) + (generate-constraints [_ constrained-ir-schemas] + (map (fn [ir-schema] + {:path (resource-file-path ir-schema) + :content (generate-constraint-module + (assoc ir-schema :url (:url ir-schema)))}) + constrained-ir-schemas)) (generate-sdk-files [_] (generator/prepare-sdk-files :dotnet))) diff --git a/src/aidbox_sdk/generator/helpers.clj b/src/aidbox_sdk/generator/helpers.clj index 612be1f..327ffac 100644 --- a/src/aidbox_sdk/generator/helpers.clj +++ b/src/aidbox_sdk/generator/helpers.clj @@ -26,8 +26,8 @@ (defn uppercase-first-letter "NOTE: Do not confuse with `capitalize` and `->pascal-case` functions. - Capitalize function lowercasing all letters after first. - Pascal case removes all _ and - characters" + `capitalize` function lowercasing all letters after first. + `->pascal-case` removes all _ and - characters" [s] (str (str/upper-case (get s 0 "")) (str/join (rest s)))) diff --git a/src/aidbox_sdk/generator/python.clj b/src/aidbox_sdk/generator/python.clj index ed9b463..9b29446 100644 --- a/src/aidbox_sdk/generator/python.clj +++ b/src/aidbox_sdk/generator/python.clj @@ -52,12 +52,9 @@ (get {"List" "FhirList"} class-name class-name)) (defn class-name - "Generate class name from schema url." - [url] - (-> url - url->resource-name - ->pascal-case - class-alias)) + "Generates class name for resource name." + [resource-name] + (-> resource-name ->pascal-case class-alias)) (defn generate-deps [deps] (->> deps @@ -80,11 +77,7 @@ (defn resource-file-path [ir-schema] (io/file (package->directory (:package ir-schema)) - (str (->pascal-case (:name ir-schema)) ".py"))) - -(defn constraint-file-path [ir-schema name] - (io/file (package->directory (:package ir-schema)) - (str (->pascal-case (url->resource-name name)) ".py"))) + (str (->pascal-case (:resource-name ir-schema)) ".py"))) (defn search-param-filepath [ir-schema] (io/file "search" (str (:name ir-schema) "SearchParameters.py"))) @@ -97,9 +90,9 @@ (def restricted-python-words #{"False" "None" "True" "and" "as" "assert" "async" "await" "break" "class" - "continue" "def" "del" "elif" "else" "except" "finally" "for" "from" "global" - "if" "import" "in" "is" "lambda" "nonlocal" "not" "or" "pass" "raise" - "return" "try" "while" "with" "yield"}) + "continue" "def" "del" "elif" "else" "except" "finally" "for" "from" "global" + "if" "import" "in" "is" "lambda" "nonlocal" "not" "or" "pass" "raise" + "return" "try" "while" "with" "yield"}) (defn guard-python-property-name [prop] (if (restricted-python-words prop) @@ -173,9 +166,14 @@ (defn generate-class "Generates Python class from IR (intermediate representation) schema." [ir-schema & [inner-classes]] - (let [base-class (url->resource-name (:base ir-schema)) - schema-name (or (:url ir-schema) (:name ir-schema)) - class-name' (class-name schema-name) + (let [base-class (class-name (or (:base-resource-name ir-schema) + ;; need for BackboneElement + (:base ir-schema) + "")) + class-name' (class-name (or (:resource-name ir-schema) + ;; need for BackboneElement + (:name ir-schema) + "")) special-class? (special-classes class-name') elements (->> (:elements ir-schema) (map #(if (and (= (:base %) "Bundle_Entry") @@ -187,26 +185,24 @@ (remove nil?) (map u/add-indent) (str/join "\n")) - base-class-name (some-> (when-not (str/blank? base-class) - (uppercase-first-letter base-class))) - base-class-name (when base-class-name - (str "(" base-class-name ")"))] + base-class-literal (when-not (str/blank? base-class) + (format "(%s)" base-class))] (str - (when (seq inner-classes) - (str (str/join "\n\n" inner-classes) "\n\n")) + (when (seq inner-classes) + (str (str/join "\n\n" inner-classes) "\n\n")) ;; kw_only restrict to create object like this: Address("a", "b") ;; and you have to use Address(use="a", type="b") ;; this is so dumb. ;; no matter how you sort fields, there's warning ;; https://stackoverflow.com/questions/72472220/dataclass-inheritance-fields-without-default-values-cannot-appear-after-fields - "@dataclass(kw_only=True)" - "\n" - "class " class-name' base-class-name ":" - "\n" - properties - (when-not (seq properties) - (u/add-indent "pass"))))) + "@dataclass(kw_only=True)" + "\n" + "class " class-name' base-class-literal ":" + "\n" + properties + (when-not (seq properties) + (u/add-indent "pass"))))) (defn generate-module [& {:keys [deps classes] @@ -264,18 +260,17 @@ ir-schemas)) (generate-constraints [_ constraint-ir-schemas] - (mapv (fn [[constraint-name schema]] - {:path (constraint-file-path schema constraint-name) - :content (generate-module - :deps (concat [{:module "typing" :members ["Optional" "List"]} - {:module "dataclasses" :members ["dataclass", "field"]} - #_{:module "pydantic" :members ["*"]}] - (->> (:deps schema) - (map ->pascal-case) - (map (fn [d] {:module "base" :members [d]})))) - :classes (generate-class (assoc schema :url constraint-name) - (map generate-class (:backbone-elements schema))))}) - constraint-ir-schemas)) + (map (fn [ir-schema] + {:path (resource-file-path ir-schema) + :content (generate-module + :deps (into [{:module "typing" :members ["Optional" "List"]} + {:module "dataclasses" :members ["dataclass", "field"]}] + (->> (:deps ir-schema) + (map ->pascal-case) + (map (fn [d] {:module "base" :members [d]})))) + :classes [(generate-class ir-schema + (map generate-class (:backbone-elements ir-schema)))])}) + constraint-ir-schemas)) (generate-sdk-files [_] (generator/prepare-sdk-files :python))) diff --git a/src/aidbox_sdk/generator/typescript.clj b/src/aidbox_sdk/generator/typescript.clj index 3233efc..2175580 100644 --- a/src/aidbox_sdk/generator/typescript.clj +++ b/src/aidbox_sdk/generator/typescript.clj @@ -17,12 +17,6 @@ [x] (str/replace x #"[\.#]" "-")) -(defn url->resource-name [reference] - (last (str/split (str reference) #"/"))) - -(defn resource-name->class-name [rn] - (->pascal-case rn)) - (defn datatypes-file-path [] (io/file "datatypes.ts")) @@ -207,13 +201,13 @@ ir-schemas)) (generate-constraints [_ ir-schemas] - (mapv (fn [[constraint-name schema]] - {:path (constraint-file-path schema constraint-name) - :content (generate-module - :deps (:deps schema) - :classes (generate-class (assoc schema :url constraint-name) - (map generate-class (:backbone-elements schema))))}) - ir-schemas)) + (map (fn [ir-schema] + {:path (resource-file-path ir-schema) + :content (generate-module + {:deps (:deps ir-schema) + :classes [(generate-class ir-schema + (map generate-class (:backbone-elements ir-schema)))]})}) + ir-schemas)) (generate-sdk-files [_] (generator/prepare-sdk-files :typescript))) diff --git a/test/aidbox_sdk/converter_test.clj b/test/aidbox_sdk/converter_test.clj index 7767de7..ae81bb8 100644 --- a/test/aidbox_sdk/converter_test.clj +++ b/test/aidbox_sdk/converter_test.clj @@ -70,12 +70,9 @@ (deftest test-convert-constraints (testing "constraints" - (match fixtures/observation-constraints-ir-schema - (sut/convert-constraints fixtures/observation-constraints - [fixtures/observation-ir-schema]) - - - ))) + (match (vals fixtures/observation-constraints-ir-schema) + (sut/apply-constraints [fixtures/observation-ir-schema] + fixtures/observation-constraints)))) (deftest test-sort-by-base (match diff --git a/test/aidbox_sdk/fixtures/schemas.clj b/test/aidbox_sdk/fixtures/schemas.clj index e763b90..039e39e 100644 --- a/test/aidbox_sdk/fixtures/schemas.clj +++ b/test/aidbox_sdk/fixtures/schemas.clj @@ -1477,7 +1477,8 @@ :value "bool"}], :url "http://hl7.org/fhir/StructureDefinition/Coding", :backbone-elements (), - :base "http://hl7.org/fhir/StructureDefinition/Element"}) + :base "http://hl7.org/fhir/StructureDefinition/Element" + :base-resource-name "Element"}) (def patient-search-params-schemas [{:description @@ -3521,6 +3522,7 @@ :patterns [], :name "Observation", :resource-name "ldlcholesterol", + :base-resource-name "DomainResource" :type "Observation", :elements [{:name "meta", @@ -3571,62 +3573,62 @@ :array false, :required false, :value "Base.ResourceReference", - :type "Reference"} - {:name "valueQuantity", - :base "Observation", - :array false, - :required false, - :value "Base.Quantity", - :type "Quantity"} - {:name "value", - :choices - [{:name "valueTime", - :base "Observation", - :array false, - :required false, - :value "string", - :type "time"} + :type "Reference"} {:name "valueQuantity", :base "Observation", :array false, :required false, :value "Base.Quantity", :type "Quantity"} - {:name "valueString", - :base "Observation", - :array false, - :required false, - :value "string", - :type "string"} - {:name "valueRatio", - :base "Observation", - :array false, - :required false, - :value "Base.Ratio", - :type "Ratio"} - {:name "valueBoolean", - :base "Observation", - :array false, - :required false, - :value "bool", - :type "boolean"} - {:name "valueDateTime", - :base "Observation", - :array false, - :required false, - :value "string", - :type "dateTime"} - {:name "valueSampledData", - :base "Observation", - :array false, - :required false, - :value "Base.SampledData", - :type "SampledData"} - {:name "valueCodeableConcept", - :base "Observation", - :array false, - :required false, - :value "Base.CodeableConcept", + {:name "value", + :choices + [{:name "valueTime", + :base "Observation", + :array false, + :required false, + :value "string", + :type "time"} + {:name "valueQuantity", + :base "Observation", + :array false, + :required false, + :value "Base.Quantity", + :type "Quantity"} + {:name "valueString", + :base "Observation", + :array false, + :required false, + :value "string", + :type "string"} + {:name "valueRatio", + :base "Observation", + :array false, + :required false, + :value "Base.Ratio", + :type "Ratio"} + {:name "valueBoolean", + :base "Observation", + :array false, + :required false, + :value "bool", + :type "boolean"} + {:name "valueDateTime", + :base "Observation", + :array false, + :required false, + :value "string", + :type "dateTime"} + {:name "valueSampledData", + :base "Observation", + :array false, + :required false, + :value "Base.SampledData", + :type "SampledData"} + {:name "valueCodeableConcept", + :base "Observation", + :array false, + :required false, + :value "Base.CodeableConcept", :type "CodeableConcept"} {:name "valuePeriod", :base "Observation", @@ -4080,6 +4082,7 @@ :patterns [], :name "Observation", :resource-name "cholesterol", + :base-resource-name "DomainResource" :type "Observation", :elements [{:name "meta", @@ -4639,6 +4642,7 @@ :patterns [], :name "Observation", :resource-name "observation-genetics", + :base-resource-name "DomainResource" :type "Observation", :elements [{:name "meta", @@ -5210,6 +5214,7 @@ :patterns [], :name "Observation", :resource-name "devicemetricobservation", + :base-resource-name "DomainResource" :type "Observation", :elements [{:name "meta", @@ -5757,6 +5762,7 @@ :patterns [""], :name "Observation", :resource-name "triglyceride", + :base-resource-name "DomainResource" :type "Observation", :elements [{:name "meta", @@ -6316,6 +6322,7 @@ :patterns [], :name "Observation", :resource-name "vitalsigns", + :base-resource-name "DomainResource" :type "Observation", :elements [{:name "meta", @@ -6888,6 +6895,7 @@ :patterns [], :name "Observation", :resource-name "hdlcholesterol", + :base-resource-name "DomainResource" :type "Observation", :elements [{:name "meta", diff --git a/test/aidbox_sdk/generator/python_test.clj b/test/aidbox_sdk/generator/python_test.clj index 7f7dfe6..0a28d66 100644 --- a/test/aidbox_sdk/generator/python_test.clj +++ b/test/aidbox_sdk/generator/python_test.clj @@ -168,27 +168,27 @@ (deftest generate-constraints (is - (= [{: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"}] - (sut/generate-constraints generator fixtures/observation-constraints-ir-schema)))) + (= (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"}]) + (first (sut/generate-constraints generator (vals fixtures/observation-constraints-ir-schema))))))