fhir-py icon indicating copy to clipboard operation
fhir-py copied to clipboard

Impossible to save resource with update_fields with empty list values

Open ruscoder opened this issue 3 months ago • 1 comments

Currently it fails if I explicitly want to set some attributes to empty list using patch It's regression in 2.0.6, because it started to remove null and empty values

resource = client.resource("Patient", generalPractitioner=[practitioner1])
await resource.save()

resource["generalPractitioner"] = []
await resource.save(update_fields=["generalPractitioner"])

ruscoder avatar Sep 29 '25 13:09 ruscoder

Personally, I think patching with nulls is a bad idea, because it contradicts FHIR spec although Aidbox support it. Maybe it should be available only for aidbox-python-sdk AidboxClient, and not for FHIRClient.

ruscoder avatar Sep 29 '25 13:09 ruscoder