Newer Version Available
Create Patient
Use this single Apex API to create a patient record rather than making separate calls
to the Account and Contact objects. The Person Account object and the Individual record type
(for Account and Contact objects) are both supported.
A single API call creates a patient record and populates all fields. If you’ve defined custom fields, it manages those as well.
If something goes wrong while inserting data, the API rolls back to prevent leaving orphan records behind.
Usage
Instantiate a patient using the relevant record type:
Set standard fields:
Set custom fields:
Usage of PatientService: