We are seeing an issue when updating patient nominations using the PDS FHIR API.
When we remove a Nominated Pharmacy and add a Medical Appliance Supplier in the same PATCH request, the request is rejected with the following error:
{
*"issue": \[*
*{*
*"code": "structure",*
*"details": {*
*"coding": \[*
*{*
*"code": "INVALID_UPDATE",*
*"display": "Update is invalid",*
*"system": "https://fhir.nhs.uk/R4/CodeSystem/Spine-ErrorOrWarningCode",*
*"version": "1"*
*}*
*\]*
*},*
*"diagnostics": "Invalid update with error - cannot replace a pharmacy type when it does not exist - add one instead for type 'https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-MedicalApplianceSupplier'",*
*"severity": "error"*
*}*
*\],*
*"resourceType": "OperationOutcome"*
}
Could you please confirm whether changing the nomination type (for example, removing a Nominated Pharmacy and adding a Medical Appliance Supplier) is supported within a single PATCH request, or whether this must be performed as two separate PATCH requests?
We are performing “remove and add” (i.e removed nominated pharmacy and added medical appliance) in the same patch request. Is it even allowed? Test is performed against INT sandpit
I’ve included a summary of the issue on the support ticket, and also had a call with Niru and Ian last week, but for visibility this is ultimately a bug/limitation of the PDS FHIR API for which I’ve opened a new Problem ticket (PRB0045743) for us in Core Demo to look at.
The workaround in the interim is to separate the remove and add operations into separate requests.