Zum Inhalt springen
Search the hub

← All suppliers

Healthcare

Epic

Healthcare EHR: encounter/appointment/code metadata aggregates — FHIR load; strict PHI skip/PII policy, no clinical notes/bodies.

Templates only — grain, filters, custom fields and ownership are firm-specific.

Copy formulas into the KPI Definition Card, then adapt grain and filters.

Example

Encounters count

How many encounters occurred in the period?

COUNT(*) FROM encounter WHERE admitDateTime IN period
Grain
Encounter
Fields
Encounter.id, Encounter.admitDateTime, Encounter.departmentId, Encounter.class
Dimensions
department, encounter_type

Only completed/valid encounters (status=finished) for reporting KPIs.

Adapt: Segment by encounter class (inpatient/outpatient/emergency).

Example

Appointments completed

How many appointments were attended in the period?

COUNT(*) FROM appointment WHERE status = 'arrived' AND start IN period
Grain
Attended appointment
Fields
Appointment.id, Appointment.status, Appointment.start, Appointment.departmentId
Dimensions
department, provider_specialty

Clarify arrived vs fulfilled status per Epic configuration.

Adapt: Report telehealth vs in-person separately when available.

No-show rate

What share of appointments ended as a no-show?

COUNT(*) FILTER (WHERE status = 'noshow') / COUNT(*) FROM appointment WHERE start IN period
Grain
Appointment (aggregated)
Fields
Appointment.status, Appointment.start, Appointment.departmentId
Dimensions
department, provider_specialty

Do not mix cancelled-before-appointment with no-show.

Adapt: Break down by weekday/time slot for scheduling optimization.

Average length of stay

What is the average length of stay for inpatient encounters?

AVG(dischargeDateTime - admitDateTime) FROM encounter WHERE class = 'inpatient' AND dischargeDateTime IN period
Grain
Inpatient encounter (aggregated)
Fields
Encounter.admitDateTime, Encounter.dischargeDateTime, Encounter.class, Encounter.departmentId
Dimensions
department

Only aggregated LOS values in marts — no individual encounter exports with patient link.

Adapt: Handle outliers (LOS > 30 days) separately to avoid skewing the average.

Diagnosis code frequency (aggregate)

How frequently did diagnosis codes occur in the period (aggregated)?

COUNT(*) FROM diagnosis_code dc JOIN encounter e ON e.id = dc.encounterId WHERE e.admitDateTime IN period GROUP BY dc.icdCode HAVING COUNT(*) >= :k_anonymity_threshold
Grain
Diagnosis code (aggregated, k-anonymous)
Fields
DiagnosisCode.icdCode, DiagnosisCode.encounterId, Encounter.admitDateTime
Dimensions
department, diagnosis_category

Only report categories with a minimum case count (k-anonymity) to avoid re-identification.

Adapt: Aggregate to ICD chapter level instead of full diagnosis when case counts are low.

Formula overview

Same formulas as a table — copy into KPI cards or SQL drafts.

Label Formula Grain Fields
Encounters count COUNT(*) FROM encounter WHERE admitDateTime IN period Encounter Encounter.id, Encounter.admitDateTime, Encounter.departmentId, Encounter.class
Appointments completed COUNT(*) FROM appointment WHERE status = 'arrived' AND start IN period Attended appointment Appointment.id, Appointment.status, Appointment.start, Appointment.departmentId
No-show rate COUNT(*) FILTER (WHERE status = 'noshow') / COUNT(*) FROM appointment WHERE start IN period Appointment (aggregated) Appointment.status, Appointment.start, Appointment.departmentId
Average length of stay AVG(dischargeDateTime - admitDateTime) FROM encounter WHERE class = 'inpatient' AND dischargeDateTime IN period Inpatient encounter (aggregated) Encounter.admitDateTime, Encounter.dischargeDateTime, Encounter.class, Encounter.departmentId
Diagnosis code frequency (aggregate) COUNT(*) FROM diagnosis_code dc JOIN encounter e ON e.id = dc.encounterId WHERE e.admitDateTime IN period GROUP BY dc.icdCode HAVING COUNT(*) >= :k_anonymity_threshold Diagnosis code (aggregated, k-anonymous) DiagnosisCode.icdCode, DiagnosisCode.encounterId, Encounter.admitDateTime

Tour