Skip to content

Commit

Permalink
fix: package in constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
krvital committed Oct 7, 2024
1 parent 9495b2f commit d6f53b9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/aidbox_sdk/converter.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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))))

Expand Down
15 changes: 13 additions & 2 deletions test/aidbox_sdk/converter_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d6f53b9

Please sign in to comment.