fhir-py
fhir-py copied to clipboard
Impossible to save resource with update_fields with empty list values
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"])
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.