How to Read a Patient's Procedure and Surgical History with Unified.to's Healthcare API
·
Your product can read the procedures a patient has had (surgeries, endoscopies, biopsies, in-office procedures) from AdvancedMD, athenahealth, CharmHealth, Epic, MEDITECH, NextGen Healthcare, Oracle Health, Orion Health, PointClickCare, SMART on FHIR, TruBridge, Veradigm and other healthcare integrations, including payers and FHIR servers (as of 26 October 2026).
sdk.healthcare.listHealthcareProcedures returns the same Procedure object on each of them, linked to the visit, the clinicians who performed it and the conditions that justified it. Every request is executed directly against the customer's EHR.
Why does procedure history matter?
Surgical history shapes almost every downstream decision: pre-operative risk scoring, quality measures (has this patient had a colonoscopy in the last ten years?), care gap outreach, prior authorization, and the patient summary an AI assistant reads before a visit.
The EHR holds procedure history as procedure records, coded in CPT or SNOMED CT. Unified.to's Healthcare API returns them as a single Procedure object.
What are the steps to build a procedure history?
A surgical and procedure history section, plus the queries that power care-gap logic.
- Authorize the customer's EHR and store one connection ID
- List a patient's procedures
- Show them on a timeline with who performed them and why
- Match codes for quality measures and care gaps
List a patient's procedures
import { UnifiedTo } from '@unified-api/typescript-sdk';
const sdk = new UnifiedTo({
security: { jwt: process.env.UNIFIED_API_KEY },
});
const procedures = await sdk.healthcare.listHealthcareProcedures({
connectionId,
patientId,
limit: 100,
});
What does each Procedure field mean?
name is the procedure as the EHR displays it; codes carries the codings (such as CPT and SNOMED CT) with their system, so you can match a procedure without parsing its name.
status is PREPARATION, IN_PROGRESS, NOT_DONE, ON_HOLD, STOPPED, COMPLETED, ENTERED_IN_ERROR, UNKNOWN or OTHER. For history, count COMPLETED; NOT_DONE is a procedure that was planned and didn't happen, which matters for care-gap logic too.
start_at and end_at are when it was performed. Many EHRs record only a start.
practitioner_ids are the clinicians who performed it, location_id where, and encounter_id the visit. All reference objects in the same API.
condition_ids and reasons explain why: condition_ids point at Condition records in the patient's problem list, and reasons hold codings when the reason wasn't recorded as a condition.
body_sites holds the anatomical location, for example which knee.
Use codes for quality measures
const CPT = 'http://www.ama-assn.org/go/cpt';
const COLONOSCOPY = ['45378', '45380', '45385'];
const lastColonoscopy = procedures
.filter((p) => p.status === 'COMPLETED')
.filter((p) => p.codes?.some((c) => c.system === CPT && COLONOSCOPY.includes(c.code ?? '')))
.map((p) => p.start_at)
.sort()
.at(-1);
Match on system and code together; the same number can mean different things in different code systems.
What if an EHR doesn't return procedures?
Check support before you scope on the Supported Integrations page. On Orion Health, procedures can be listed but not fetched one by one (as of 24 October 2026).
Handle 501 separately from an empty list. An empty list means no procedures are recorded; a 501 means the EHR doesn't make them available through its API.
Procedures are read-only through the unified object.
How do I pick up new and changed procedures?
On 1upHealth, Aidbox, AWS HealthLake, Azure Health Data Services, Elevance Health, Health Gorilla, Humana, Medplum, Oracle Health, Particle Health, SMART on FHIR, TruBridge, UnitedHealthcare and Veradigm (as of 26 October 2026), updatedGte returns only procedures changed since a timestamp, and Unified.to's [virtual webhooks](/blog/what_are_virtual_webhooks_how_they_differ_from_sync_based_webhooks) for healthcare_procedure detect changes and deliver events. On the others, read on a schedule or before each visit.
→ Start your 30-day free trial → Book a demo
Frequently asked questions
Does this include procedures done at other organizations?
It includes what the customer's EHR has recorded, which often includes outside procedures entered as history. Their practitioner_ids may be empty because the performer isn't in that EHR.
Where are the operative notes?
Operative and procedure notes are clinical documents. Where the integration supports documents, list them with listHealthcareDocuments and type: 'PROCEDURE_NOTE', and join on encounter_id.