Aidbox / Issues

Issue tracker for Aidbox FHIR backend by Health Samurai
7 stars 0 forks source link

Support for overwriting fields when extending schema #551

Closed Nitive closed 8 months ago

Nitive commented 1 year ago

I need the following improvement

I need to be able to overwrite some of the fields in FHIR resources schemas in my custom resources.

Let's say I need to extend Communication resource to allow have references to Person in sender field.

I'm extending the schema like this

 Communication
 {:zen/tags #{zen/schema zen.fhir/base-schema}
  :type zen/map
  :zen.fhir/type "Communication"
  :zen.fhir/version "0.5.3"
  :confirms #{hl7-fhir-r4-core.Communication/schema}
  :keys {:sender
         {:confirms #{zenbox/Reference}
          :zen.fhir/reference
          {:refers
           #{hl7-fhir-r4-core.Person/schema
             hl7-fhir-r4-core.Patient/schema
             hl7-fhir-r4-core.PractitionerRole/schema
             hl7-fhir-r4-core.HealthcareService/schema
             hl7-fhir-r4-core.Organization/schema
             hl7-fhir-r4-core.Device/schema
             hl7-fhir-r4-core.Practitioner/schema
             hl7-fhir-r4-core.RelatedPerson/schema}}}
         :zen/desc "Message sender"}}}

But instead of validating the fields using the new schema the field is validated against both schemas

resourceType: "Person" (no validation messages expected)

image

resourceType: "BadInput" (only 1 validation message expected)

image
Nesmeshnoy commented 8 months ago

This will be resolved with FHIR Schema engine