diff --git a/src/aidbox_sdk/converter.clj b/src/aidbox_sdk/converter.clj index f5a5cf9..586456b 100644 --- a/src/aidbox_sdk/converter.clj +++ b/src/aidbox_sdk/converter.clj @@ -399,6 +399,7 @@ (update :deps set/union #{"Meta"}) ;; copy constraint common fields + (assoc :package (:package constraint)) (assoc :resource-name (url->resource-name (:url constraint))) (assoc :derivation (:derivation constraint)))) diff --git a/test/aidbox_sdk/converter_test.clj b/test/aidbox_sdk/converter_test.clj index ae81bb8..ea78fc8 100644 --- a/test/aidbox_sdk/converter_test.clj +++ b/test/aidbox_sdk/converter_test.clj @@ -68,11 +68,22 @@ (is (= [(fixt/get-data :organization-preferred-contact-ir-schema)] (sut/convert [(fixt/get-data :organization-preferred-contact-fhir-schema)]))))) -(deftest test-convert-constraints +(deftest test-apply-constraints (testing "constraints" (match (vals fixtures/observation-constraints-ir-schema) (sut/apply-constraints [fixtures/observation-ir-schema] - fixtures/observation-constraints)))) + fixtures/observation-constraints))) + + (testing "another package constraints" + ;; TODO + (is (= ["hl7.fhir.r5.core" "hl7.fhir.us.core" "hl7.fhir.us.core"] + (map :package (sut/apply-constraints + [fixtures/observation-ir-schema] + [(fixt/get-data :vitalsigns-fhir-schema) + (fixt/get-data :us-core-vital-signs-fhir-schema) + (fixt/get-data :us-core-bmi-fhir-schema)])))))) + +(fixt/get-data :vitalsigns-fhir-schema) (deftest test-sort-by-base (match