Patient Service
The Patient Service module adds methods for working with patient data.
- 1 Dependencies
- 2 Methods
- 2.1 getByOrbitaId
- 2.2 update
- 3 Intermediary Model
Dependencies
The Patient Service module is dependent on the following modules:
Methods
getByOrbitaId
Retrieves a patient record by its Orbita ID
Parameters:
id (string): The Orbita ID of the patient
formatted (boolean, default = true): Whether or not to return the data in the intermediary model. If false, the raw data will be returned.
Returns: A promise that will resolve with the patient record.
update
Updates a patient record with the provided data.
Parameters:
id (string): The Orbita ID of the patient
data (object): The data to update the patient record with. This data will be merged into (as opposed to entirely replacing) the existing data for the patient.
formatted (boolean, default = true): Whether or not to return the data in the intermediary model. If false, the raw data will be returned.
Returns: A promise that will resolve with the updated patient record.
Intermediary Model
Certain methods provide an option of returning data raw from Orbita or in the format of the intermediary model that serves as an interface for other modules using the Patient Service module. The intermediary patient model is:
id (string): The Orbita ID of the patient record
patientId (string): patientId from the Orbita record
firstName (string): givenName from the Orbita record
lastName (string): familyName from the Orbita record
fullName (string): fullName from the Orbita record
gender (string): gender from the Orbita record
dateOfBirth (string): dateOfBirth from the Orbita record
age (number): derived from dateOfBirth
address (object): demographics.address from the Orbita record
email (string): demographics.email from the Orbita record
phone (string): phone from the Orbita record,
customData (object): customData from the Orbita record