How we helped a healthcare startup increase patient onboarding by 180%arrow_right_alt
Encounter grouping across sources

Two claims, two sources, one visit.

A single ED visit often produces two separate claims — an institutional (facility) claim and a professional (physician) claim — and today those might arrive as a claims flat file from one system and a FHIR feed from another. This runs claims from both source shapes through the same chaining rules for deciding which claims belong to one emergency-department encounter: an exact same-day/same-facility match, a next-day transfer, a general date overlap at the same facility, or — since professional claims don't carry facility or discharge fields — a looser overlap-or-adjacent-day rule when either claim is professional.

The four chaining rules are copied from an actual open-source healthcare-data dbt project's real emergency-department encounter-grouping model, applied here with a union-find over the same pairwise conditions instead of that model's original row-closure SQL — same rules, same resulting groups. The FHIR shape uses the standard public FHIR Encounter resource fields, not that project's own FHIR-ingestion connector code (which lives in separate repositories this build didn't have access to). Worth flagging directly: that project's real connectors cover claims flat files, FHIR feeds, EHR database extracts, and ADT feeds — no CCDA support was found anywhere in its actual code, so it's left out here rather than invented. Runs entirely in JavaScript — no model download.
Claims file (Source A)

Headers just need to resemble the sample below — exact wording isn't required.

FHIR Encounter feed (Source B)
RELATED WORK

More Real-World Impact.

Contact us

Have a problem worth getting right?

Send us the paragraph you'd normally write to a colleague. We'll get back to you within 24 hours.

mailhello@tathastha.com