Skip to main content

Set accounts for a Patient

Set the accounts associated with a Patient. With propagate=true, Ovok also applies account changes to resources in the Patient compartment. This operation is restricted to project administrators.

MethodPath
POST/fhir/R4/Patient/:id/$set-accounts

Request​

The body is a FHIR Parameters resource. Include one accounts parameter per Account reference. propagate is optional.

curl --request POST \
--url "https://api.sandbox.ovok.com/fhir/R4/Patient/${PATIENT_ID}/\$set-accounts" \
--header "Authorization: Bearer ${OVOK_TOKEN}" \
--header 'Content-Type: application/fhir+json' \
--data "{\"resourceType\":\"Parameters\",\"parameter\":[{\"name\":\"accounts\",\"valueReference\":{\"reference\":\"Account/${ACCOUNT_ID}\"}},{\"name\":\"propagate\",\"valueBoolean\":true}]}"
ParameterTypeDescription
accountsReference, repeatedAccount references to set on the Patient. An empty list clears the account association.
propagatebooleanWhen true, propagate account differences to resources in the Patient compartment.

Propagation is capped by the server's compartment update limit. For an asynchronous propagation request, send Prefer: respond-async and follow the returned job location.

Successful response​

The synchronous response is a FHIR Parameters resource containing resourcesUpdated.

Response parameterTypeDescription
resourcesUpdatedintegerNumber of resources updated, including the Patient.

The server may return 202 Accepted for an asynchronous propagation request. A caller without administrative access receives an authorization error.