DEFAULT_PATIENT_ACCESS_POLICY
The AccessPolicy Ovok gives to new patients, how to set it, which routes read it, and what happens when it is missing.
The AccessPolicy that a new patient receives when Ovok creates their account: through self-registration or a care invitation.
| Type | Text setting, stored as the project's defaultPatientAccessPolicy field |
| Change with | PUT /v1/project/settings/values/DEFAULT_PATIENT_ACCESS_POLICY |
| Value | AccessPolicy/<id> of an AccessPolicy in this project, or null to remove it |
| Who can change it | Project admin |
| When unset | Patient registration and patient invitations are refused |
| Set on new projects | Not set by any project-creation route |
| Inherited | No. A child project reads only its own value. |
Why it exists
A project membership with no AccessPolicy is not limited by one. For that reason Ovok will not create a patient without a policy: registration and the care invitation refuse until this setting is set. Set it once, to a policy that holds only what a brand-new patient should be able to do, such as reading and writing their own records.
Set it
curl --request PUT \
--url 'https://api.sandbox.ovok.com/v1/project/settings/values/DEFAULT_PATIENT_ACCESS_POLICY' \
--header "Authorization: Bearer ${OVOK_TOKEN}" \
--header 'Content-Type: application/json' \
--data '{"value":"AccessPolicy/patient-policy-id"}'The response is the full settings record; the value appears under values. Send {"value":null} to remove it.
| Response | Meaning |
|---|---|
422 with code INVALID_SETTING_VALUE | The value is not AccessPolicy/<id>, no such policy exists, or the policy belongs to another project. |
400 with code UNKNOWN_SETTING | The key is misspelled. The body lists acceptedKeys. |
403 | The caller is not a project admin. |
409 | The project changed during the write. Read the settings again and retry. |
To write the policy itself, see access policies and the policy model.
Where Ovok reads it
| Route | What it does with the policy | When it is missing |
|---|---|---|
POST /v1/auth/tenant/Patient/register | Gives it to the new patient. | 403 Registration is not enabled for this project., the same answer as when the switch is off |
POST /v1/invites/care (formerly /v1/invites/patient) | Gives it to a patient account it creates for a new email address. | 409, error invitation_not_configured |
GET /v1/project/settings also reads it: while it is missing or names a policy that cannot be read, PATIENT_REGISTRATION_ENABLED reports false, and while it is missing, PATIENT_INVITATION_ENABLED reports false, whatever was saved.
Gotchas
- A parent's policy id does not work in a child project. Creating a child with
POST /v1/slim/project/childcopies the parent's AccessPolicies under new ids. Read the child's own policies and use those ids. - Changing it does not touch patients who already have an account. It applies to patients created afterwards.
- Off and "not configured" look the same on registration. Both answer
403with the same message. If you did not turn registration off, check this setting first.
Related
Last updated on
PRACTITIONER_REGISTRATION_ENABLED
Let practitioners create their own account in a project, which access policy they get, and why this is off by default.
DEFAULT_PRACTITIONER_ACCESS_POLICY
The AccessPolicy Ovok gives to new practitioners, which routes read it, and what happens when it is missing or invalid.