Some entities in the PainChek data model allow you to record an "External Id", that an identifier from a third party system.
Currently, this applies to the user, patient and site objects.
You can this field to store an identifier from an external system in PainChek to assist with data synchronisation.
The external ID is treated as a string field by PainChek and we do not validate the format or content (or mandate that you supply an External Id - it is optional).
Ensure that you use a consistent format for your External Ids when using them with PainChek (External id "1" is not the same as External id "001").
External Ids must be unique (for a particular type of object).
You can not assign two patients an External Id of "123", but it is acceptable for a patient and a user to have the same External Id.
The fact that two objects have the same External Id does not mean that they are in any way related to each other - it's just coincidental as far as PainChek is concerned (e.g. if a patient and a user happen to share External ID "123").
How to record an External Id
Simply include the "external_id" element when POSTing a new entity to PainChek - e.g.: when POSTing a new patient:
How to Access a Record using the External Id
You can fetch an object by using the "external_id" object on the GET request - e.g."
How to Update a Record using the External Id
You cannot directly do this. However, by fetching the PainChek UUID (e.g. 40cd7ebf-7863-4440-9a96-16316e96fd1d) as described in the previous section, you are then able to update the records using the PainChek identifier.