Entity API Reference
SDK method signatures for reading and writing entity data
The Entity API provides typed methods for reading and writing entity data. All methods are available on sdk.ehr.api organized by entity namespace.
Usage
The Entity API is by default scoped to the entity the provider currently has open in the EHR — the patient, encounter, referral, or order in context. Call a method with no id and it reads (or updates) the entity in context. Use these methods to pull the fuller record — data that is not on the EHR screen, because the page only renders what the EHR loaded into the current view.
// Read the fuller record for the patient in context — no id needed
const patient = await sdk.ehr.api.patient.getPatient();
const problems = await sdk.ehr.api.patient.getProblems();
const insurance = await sdk.ehr.api.patient.getInsurances();
// Update the encounter in context — pass only the data to write
await sdk.ehr.api.encounter.updateBillingCodes(
{ billingInformation: { procedureCodes: [{ code: '99213', description: 'Office visit' }] } },
);A read also takes an optional id: omit it to read the entity in context, or pass it to read one you hold an id for, such as provider.getById({ providerId: order.orderingProviderId }). This form is interim; reading related entities directly from the entity you hold is planned to replace it. Updates act only on the entity in context — the explicit-id form updateBillingCodes({ encounterId }, data) is deprecated, so omit the id.
List and search methods return one page at a time and take an optional input ({ cursor?, query?, filters? }) — see Paginated Methods. The table below marks which methods are paginated.
For writeback with permission handling, see Writeback guide.
Available Methods
Loading from CDN...