It's possible to filter the records being returned in a list.
Common filters are:
Filter |
Use |
---|---|
sync |
To limit those records returned to those changed since the last time a process synchronised data - see Syncing Data with the API |
external_id |
Return the record matching an external id. This is used in the case where you have your own identifier for a patient - e.g. "P123". You can pass that identifier to the call to get the list of patients to return just that patient. You can extract the PainChek id for the patient and use that, for example, to identify the assessments for that patient |
This call:
curl https: //ua.ap.painchek.com/api/patients/
...returns all your patients.
Supposing you have a patient you identify as "P123", you can fetch the details for that patient using this command:
curl https: //ua.ap.painchek.com/api/patients/?external_id=P123
would return only the patient(s) matching that criteria:
{ "count": 1, "next": null, "previous": null, "results": [{ "uuid": "16a8b675-61e2-49a5-b1aa-9a6fef94bfc9", "license": "a89e0cc1-fd90-4721-b09b-7f527f5ff626", "license_name": "A89E0CC1-FD90/PainChek Ltd/2018-08-25", "first_name": "Chuck", "last_name": "Yager", "nickname": "", "gender": "m", "birth_date": "1949-10-05", "death_date": null, "created_at": "2017-09-26T02:16:28.830000Z", "modified_at": "2017-09-26T02:16:28.995000Z", "deleted_at": null, "deleted_reason": "null", "update_stamp": 505, "image": "https://ua.ap.painchek.com/media/patients/16a8b675-61e2-49a5-b1aa-9a6fef94bfc9.jpg", "external_id": "P123" }] }
You can then extract the PainChek id for the patient ("16a8b675-61e2-49a5-b1aa-9a6fef94bfc9") in this case and use that to identify that patients of assessments.