Without knowing the specifics of your server implementation, it's hard to say exactly what might be causing the issue. However, here are a few things you could maybe look at:
1. Verify that the FHIR server supports the "add" operation, it's possible that your server implementation doesn't but I am guessing you already confirmed it does support it.
2. Verify that the "
hospitalization" element already exists within the
Encounter resource. If the element does not exist, it's safe to say you won't be able to add anything to it.
3. Verify that the "
dischargeDisposition" element does not already exist within the "
hospitalization" element. If the element already exists, you may need to use a different operation (e.g., "replace" or "delete" followed by "add") to modify its value, see
https://fhirblog.com/2019/08/13/updating-a-resource-using-patch/Lastly, check the response body of your API call for any error messages or additional information about why the patch operation may have failed.
Hope that helps.