API Question: PID VS. PUUID

Hi!

Trying to understand the difference between the two patient Id’s: PID & PUUID - in the Standard OEMR API documentation.

I know that PID is created when I create a new patient, but the get patient and some other functions use PUUID & I’m not sure when/where that is created or how to access it.

Thanks!

Hi,

As you may know, UUID’s are used to uniquely identify records.

PID = Patient ID (by default it is an auto-increment field)
PUUID = Patient Universal Unique Identifier (Not autoincremental, alphanumeric)

check the topic (What is UUID?)

In OpenEMR, when a new patient is created, both PID and UUID’s are generated.
The UUID generated in OpenEMR is binary and is converted to PUUID which is a string representation. check openemr/src/FHIR/SMART/SmartLaunchController.php line 68 to see how the UUID is manipulated

There are different UUID’s in the system relating to different tables. PUUID is the UUID that uniquely identifies a patient in the patient table (patient_data).

There’s also another UUID which is generated when an encounter is created. That’s EUUID.

I hope this was helpful.

2 Likes