bulk-data-server icon indicating copy to clipboard operation
bulk-data-server copied to clipboard

metadata: fix profile to be string, not dict

Open mikix opened this issue 2 years ago • 1 comments

Per the FHIR spec, it is defined as a canonical URL (string, right?): https://www.hl7.org/fhir/capabilitystatement.html

And in fhirclient, it is validated as a string: https://github.com/smart-on-fhir/client-py/blob/b4da2bdc3bf024b6d0a78c85d80bf513302c1b13/fhirclient/models/capabilitystatement.py#L516

And remove non-spec parameter acceptUnknown.

The current dictionary definition makes it impossible to use fhirclient to inspect server metadata because you'll get an error like:

models.fhirabstractbase.FHIRValidationError: {root}:
  rest.0:
    resource.2:
      profile:
        Wrong type <class 'dict'> for property "profile" on <class 'models.capabilitystatement.CapabilityStatementRestResource'>, expecting <class 'str'>
  Superfluous entry "acceptUnknown" in data for <models.capabilitystatement.CapabilityStatement object at 0x7f93f0226350>

mikix avatar Nov 10 '22 17:11 mikix

Noting for posterity that this behavior :may: be acceptable in the 4.0.1 compatible version of fhirclient, though that may be in error.

dogversioning avatar Aug 12 '24 14:08 dogversioning