Update Practitioner's Services

Updates a practitioner's services.

PATCH /directory/v1/practitioners/{id}/relationships/services

Path Parameters

id

string required

Id of the desired resource.

Request Body Parameters

Data

Array<Relationship>

Services to assign to this practitioner.

{
"data": [
{ "type": "services", "id": "7907886b-6a98-4992-8978-93cd173ed357" },
{ "type": "services", "id": "82c2deed-18b9-4a9d-8b0b-0374ddc02dd9" }
]
}
important

When assigning a service, one should make sure to assign all of the service's ancestors as well. This will allow users to get better results when searching for services in the same family as the ones assigned to the resource. Ancestors are returned with each service upon fetching.

It is also strongly suggested to add all specialities associated with top level services assigned to a practitioner. Again, this will allow users to get results more effectively when searching for a practitioner using both services and specialities.

Example of the optimal definition of a resource :

{
"data": {
"type": "practitioners",
"id": "1d6319c1-8510-4803-bbfc-52e5c1303845",
"relationships": {
"specialities": {
"data": [
{
"type": "specialities",
"id": "5c9f4bcb-554b-454d-ba07-1da2a49de7d2" // Acupuncturist speciality.
}
]
},
"services": {
"data": [
{ "type": "services", "id": "4ed05f0a-6ef0-47c4-8a96-b8e49c5fad5d" }, // Acupuncture top level service
{ "type": "services", "id": "bb80b982-7aea-4d55-a60a-d9435a3f1c1d" }, // Digestive system acupuncture sub-service
{ "type": "services", "id": "3cd175bf-d1b0-43c8-bcfa-a66d6995909e" } // Acupuncture treatment sub-service
]
},
"practices": {}
}
}
}
important

Services sent in an update request will overwrite any existing services, so make sure to send all services to associate on each update request.

Examples

Update Services

curl -X PATCH "https://api.clinia.ca/directory/v1/practitioners/${ID}/relationships/services" \
-H "Content-Type: application/vnd.api+json"
--data-binary '{
"data": [
{ "type": "services", "id": "4ed05f0a-6ef0-47c4-8a96-b8e49c5fad5d" },
{ "type": "services", "id": "3cd175bf-d1b0-43c8-bcfa-a66d6995909e" },
{ "type": "services", "id": "bb80b982-7aea-4d55-a60a-d9435a3f1c1d" }
]
}'
{
"data": {
"attributes": {
"created-at": "2020-10-29T15:50:39.2346984Z",
"updated-at": "2020-10-29T15:50:39.2346984Z",
"first-name": "Jacques",
"last-name": "Plantes",
"title": "DR",
"gender": "MALE",
"registrations": null,
"accept-new-patients": true,
"note": null,
"internal-note": null,
"modalities": null,
"cases-to-refer": null,
"communications": null,
"clientele": null,
"phones": [
{
"id": "phone-8e0a648b-5912-4449-adca-136ae6423cb4",
"number": "15141111234",
"type": "WORK"
}
],
"faxes": null,
"emails": [
{
"id": "email-fac4c926-84b4-499a-b4d0-96d90a5a5c2a",
"address": "john.doe@example.com"
}
]
},
"relationships": {
"specialities": {
"data": [
{
"type": "specialities",
"id": "5c9f4bcb-554b-454d-ba07-1da2a49de7d2"
}
]
},
"services": {
"data": [
{ "type": "services", "id": "4ed05f0a-6ef0-47c4-8a96-b8e49c5fad5d" },
{ "type": "services", "id": "bb80b982-7aea-4d55-a60a-d9435a3f1c1d" },
{ "type": "services", "id": "3cd175bf-d1b0-43c8-bcfa-a66d6995909e" }
]
},
"practices": {}
},
"type": "practitioners",
"id": "1d6319c1-8510-4803-bbfc-52e5c1303845"
},
"included": [
{
"attributes": {
"created-at": null,
"updated-at": null,
"names": { "en": "Acupuncturist", "fr": "Acupuncteur" }
},
"relationships": {
"service": {
"data": {
"type": "services",
"id": "4ed05f0a-6ef0-47c4-8a96-b8e49c5fad5d"
}
},
"parent": {},
"children": { "data": [] }
},
"type": "specialities",
"id": "5c9f4bcb-554b-454d-ba07-1da2a49de7d2"
},
{
"attributes": {
"created-at": null,
"updated-at": null,
"names": {
"en": "Acupuncture",
"fr": "Acuponcture"
}
},
"relationships": { "parent": {}, "children": { "data": [] } },
"type": "services",
"id": "4ed05f0a-6ef0-47c4-8a96-b8e49c5fad5d"
},
{
"attributes": {
"created-at": null,
"updated-at": null,
"names": {
"en": "Digestive system acupuncture",
"fr": "Acupuncture du système digestif"
}
},
"relationships": { "parent": {}, "children": { "data": [] } },
"type": "services",
"id": "bb80b982-7aea-4d55-a60a-d9435a3f1c1d"
},
{
"attributes": {
"created-at": null,
"updated-at": null,
"names": {
"en": "Acupuncture treatment",
"fr": "Traitement d'acupuncture"
}
},
"relationships": { "parent": {}, "children": { "data": [] } },
"type": "services",
"id": "3cd175bf-d1b0-43c8-bcfa-a66d6995909e"
}
]
}