Patient DB
medent FHIR
Epic Sandbox
Nutrition Care Program
🏥 3 clinics
Patient pipeline
Routing: Clinic assigned at DB pull · EHR determined per patient
Step ①
Patient DB
Pull records
Step ②
medent FHIR
Name+DOB+Ins/MRN
Step ③
Nutrition Care Program
Enroll patient
Step ④
Notes writeback
PDF → Program EMR + EHR
In DB
0
Matched
0
No match
0
Enrolled
0
Notes back
0
DB IDNameClinic → EHRDOBIns. IDConditions EHR matchConfidenceProgramNotes
PDF notes written back to Program EMR + EHR DocumentReference
No notes yet — run the pipeline first
Clinic directory — EHR routing
Field mapping — both EHR targets
① Patient DB → middleware
db.first_name + last_namematch.namekey 1
db.date_of_birthmatch.dobkey 2
db.insurance_id (optional)match.insuranceIdkey 3 if present
db.mrn (optional)match.mrndeterministic key
medent ② FHIR patient search + confidence scoring
GET /Patient?family={ln}&given={fn}&birthdate={dob}candidatesbase +25 pts
Patient.identifier[mrn] == db.mrn+40 ptsdeterministic
Patient.identifier[insurance] == db.insId+35 pts (if present)confirmatory
score ≥70 → matched · 50–69 → review · <50 → unmatchedmatchStatusthreshold
Auth: RS384 JWT → POST /token/index.php?medent_practice_id=…Bearer token (300s)per MEDENT docs
POST {medentBase}/DocumentReferencemedent patient chartwriteback
Epic ② Sandbox FHIR patient search + confidence scoring
GET /Patient?family={ln}&given={fn}&birthdate={dob}candidatesbase +25 pts
Patient.identifier[MR] == db.mrn+40 ptsMR identifier type
Patient.identifier[MB/SN] == db.insId+35 pts (if present)MB=Medicare/SN=subscriber
score ≥70 → matched · 50–69 → review · <50 → unmatchedmatchStatussame threshold
Auth: JWT assertion → POST /oauth2/token (Backend Services)Bearer tokenRS384 JWT
Sandbox base: fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4all FHIR callssandbox
POST {epicBase}/DocumentReferenceEpic patient chartwriteback
③ Middleware → Nutrition Care Program (same regardless of EHR)
patient.fhirIdsylvan.externalEhrIdcross-ref key
patient.ehrSystem ('medent' | 'epic')sylvan.externalEhrSystemrouting metadata
patient.name · dob · mrn · conditions · payersylvan enrollment payloadintake context
④ Notes writeback — PDF as FHIR DocumentReference (same FHIR resource, different base URL)
sylvan PDF bytes (base64)content[0].attachment.datainline PDF
LOINC 11488-4type.coding[0].codeConsult note
LOINC LP29684-5category[0].coding[0].codeNutrition & dietetics
patient.fhirIdsubject = "Patient/{id}"patient link
medent: POST medentfhir.com/…/DocumentReferencemedent chartmedent FHIR
Epic: POST fhir.epic.com/…/api/FHIR/R4/DocumentReferenceEpic chartEpic sandbox
API trace
live