HL7 real-time feed · ClarityFlow pipeline
RIA · Flow-HL7-Processing-AutoSendLettersForFutureVisits
Daily processing job for HL7 AutoSendLettersForFutureVisits
trigger
How it's scheduled
The HL7 real-time feed arrives as a scheduled drop, so one overnight pass is enough: it ingests the day's file and works the whole batch to check eligibility, price the good-faith estimate, and send the patient letter. A tighter loop would just re-scan the same file.
| Scheduled task | Cadence | Server | State | Coordination |
|---|---|---|---|---|
\MDC\HL7 - Processing - RIA - Nightly | daily at 19:01 | prod-db-3 | enabled | standalone |
shape
Against the canonical Flow spine
Every Flow pipeline is a variation on one shape. Lit stages are the ones this pipeline runs; the labels match the capability lens.
computed concepts · from the SQL
What it computes
Business concepts mined from this pipeline's SQL text — the meaning behind the typed steps. Each links to the concept lens (who else computes it).
task tree
What the pipeline runs
Tasks in order, each with what it does — typed stepsfrom the MDClarity task docs (click to open the reference), sub-jobsyou can expand inline (▶) to reveal their own tasks, and SQL steps summarized by Gemini (✨). Every step shows the tables it writes/reads and which earlier step it feeds from(sqlglot lineage).
Flow-HL7-Processing-AutoSendLettersForFutureVisits
- Recreate Bundle mapping tablesql
flow_hl7_processing_autosendlettersforfuturevisits__recreate_bundle_mapping_table.sql✨ Builds a mapping table by extracting visit, insurance, and service code details from configuration data for use in calculations.writesTransformBundleMap· readsBundleTransformBundleMap ▶Flow-HL7-Transform-Nightlysub-job · 4↗HL7 Transformation Layer
- TruncateVisitDelta and OrderSourceIDDeltasql
flow_hl7_transform_nightly__truncatevisitdelta_and_ordersourceiddelta.sql✨ Clears the temporary tracking tables to prepare the pipeline for a fresh processing cycle.writesOrderSourceIDDeltaVisitDelta - Recalculate Changed Bundlessql
flow_hl7_transform_nightly__recalculate_changed_bundles.sql✨ Identifies and recalculates expected charges from service bundles for future visits to ensure accurate cost estimates.writesOrderSourceIDDeltaVisitDelta· readsBundleChargeTypeHL7OrderImportTransformVisitChargeTransformInsuranceMapServiceTypeTransformOrderSourceIDMapTransformVisitTransformVisitInsurance↳ feeds from ImportTransformVisitCharge, TruncateVisitDelta and OrderSourceIDDelta - ImportTransformVisitChargesql
flow_hl7_transform_nightly__importtransformvisitcharge.sql✨ Builds a staging table of visit charges by extracting and formatting procedure codes and units from HL7 order bundles.writesImportTransformVisitCharge· readsBundleChargeTypeHL7OrderImportTransformVisitChargeOrderSourceIDDeltaTransformInsuranceMapServiceTypeTransformOrderSourceIDMapTransformVisitInsurance↳ feeds from Recalculate Changed Bundles, TruncateVisitDelta and OrderSourceIDDelta - MergeTransformVisitChargesql
flow_hl7_transform_nightly__mergetransformvisitcharge.sql✨ Synchronizes the visit charge transformation table by inserting, updating, or deleting records based on the latest imported charge data.writesTransformVisitCharge· readsImportTransformVisitCharge↳ feeds from ImportTransformVisitCharge
▶Flow-HL7-Processing-LoadVisits-Nightlysub-job · 23↗
- Load TempBatchVisitsql
flow_hl7_processing_loadvisits_nightly__load_tempbatchvisit.sqldisabled✨ Identifies visits requiring insurance eligibility checks or re-checks based on service types and proximity to the scheduled appointment date.writesTempBatchVisitVisitEligServiceTypesVisitServiceTypes· readsDimensionMemberTempBatchVisitTransformVisitTransformVisitInsTransformVisitInsuranceTransformVisitInsuranceCoverageStatusVisitEligServiceTypesVisitServiceTypes - Augment Visit Deltasql
flow_hl7_processing_loadvisits_nightly__augment_visit_delta.sql✨ Updates the change tracking table with future visits when insurance mappings change to ensure updated coverage information is processed. - ReprocessChangedConfigurationsReprocessChangedConfigurationsIdentify and queue visits or accounts affected by configuration changes to ensure historical data reflects updated pricing or insurance rules.reprocess visits
- ReprocessChangedConfigs-AugmentVisitDeltasql
flow_hl7_processing_loadvisits_nightly__reprocesschangedconfigs_augmentvisitdelta.sql✨ Flags visits requiring reprocessing from the queue and adds them to the change tracking table for updated data loading.writesVisitDeltaVisitKeyLookup· readsVisitDeltaVisitKeyLookup - LoadVisitBatchLoadVisitBatchLoad scheduled visits and associated charges into the processing pipeline using custom SQL queries for pricing estimation and quote generation.writes
QuoteBatchVisitBatch· readsFacilityInsuranceMapPatientTransformVisitTransformVisitChargeTransformVisitInsuranceVisitVisitDelta↳ feeds from ReprocessChangedConfigs-AugmentVisitDelta, Sync Visits and Quotes, Update Patient Email for Commercial Insurancecustom visit querycustom charge queryauto service type querycustom coverage queryadd zero charge - Applies matching charge bundles to batch visits based on facility and insurance to ensure consistent pricing across service types.DISABLED
- CheckBenefitsflowVerifies insurance eligibility and retrieves detailed benefits information for visits by making real-time API calls to insurance providers.auto query
- Verifies insurance eligibility and retrieves detailed benefits information for visits by making real-time API calls to insurance providers.· reads
EligibilityStatusMapEligibilityTxnTempBatchVisitVisitBatchcustom queryDISABLED - AutoApplyBenefitsAutoApplyBenefitsPopulates insurance benefits like copays and deductibles on batch visits using data from eligibility verification transactions.
- CalculateVisitsflowCompute the good-faith estimate (CalculateVisits).· reads
DimensionMemberVisitBatch↳ feeds from LoadVisitBatchcustom querycalculate chargesbatch mode - LogVisitChangeEventsBatchLogVisitChangeEventsBatchCompare batch visits against production records to detect and log specific property changes for auditing and compliance tracking.
- Audits Good Faith Estimate compliance for batch visits and identifies records requiring resends based on federal timing regulations.DISABLED
- Update Patient Email for Commercial InsuranceUpdateEntitieswrites
Patient· readsVisitBatchpatient↳ feeds from LoadVisitBatchentity type=Patientauto query ▶Load-CustomProperty-CoverageStatussub-job · 3↗
- Load Primary Coverage StatusUpdateCustomPropertyFromQuery· reads
CustomPropertyMapEligibilityTxnVisitBatchVisitCoverageBatchentity=Visitcustom property key=PrimaryCoverageStatusauto querybatch mode - Load Secondary Coverage StatusUpdateCustomPropertyFromQuery· reads
CustomPropertyMapEligibilityTxnVisitBatchVisitCoverageBatchentity=Visitcustom property key=SecondaryCoverageStatusauto querybatch mode - Load Tertiary Coverage StatusUpdateCustomPropertyFromQuerydisabled· reads
CustomPropertyMapEligibilityTxnVisitBatchVisitCoverageBatchentity=Visitcustom property key=TertiaryCoverageStatusauto querybatch modeDISABLED
- AutoSendLettersAutoSendLettersGenerates and sends patient cost estimate letters for visits in the batch table based on configured qualification and communication rules.
- Generates and sends cost estimate letters for upcoming scheduled visits based on patient preferences and configured qualification criteria.DISABLED
- Load TransformVisitInsuranceCoverageStatussql
flow_hl7_processing_loadvisits_nightly__load_transformvisitinsurancecoveragestatus.sql✨ Updates insurance coverage statuses by analyzing recent eligibility transactions and mapping results to standardized active or inactive states.writesTempEligibilityStatsTransformVisitInsuranceCoverageStatus· readsTempEligibilityStatsTransformVisitInsuranceVisitBatch↳ feeds from LoadVisitBatch - Sync Visits and QuotesSyncBatchSynchronizes processed data from batch staging tables to production tables, updating visits, quotes, and custom property mappings.writes
CustomPropertyMapQuoteVisitVisitChangeEvent· readsCustomPropertyMapBatchQuoteBatchVisitBatchVisitChangeEventBatch↳ feeds from LoadVisitBatchsync quotesync visitsync custom property mapsync visit change event - ExportBatchVisitEligibilityflowdisabledPush the batch to the app / export results.· reads
EligibilityTxnVisitBatchcustom querytable name=BatchEligibility_Resultsarchive table name=BatchEligibility_ResultsArchiveDISABLED - SearchForInsuranceflowdisabledFind coverage for visits missing insurance.· reads
EligibilityTxnBatchcustom querytable name=InsuranceSearch_Resultbatch modeDISABLED ▶Flow-HL7-Processing-LoadVisitFactsub-job · 1↗
- Load VisitFactsql
flow_hl7_processing_loadvisitfact__load_visitfact.sql✨ Updates the visit fact table with current status, letter activity, eligibility results, and payment totals for recent appointments.writesVisitFactVisitFactDelta· readsEligibilityTxnPatientLetterPaymentTxnVisitVisitCoverageVisitFactDelta
- AutoSendLettersForFutureVisitsAutoSendLettersForFutureVisitsGenerates and sends cost estimate letters for upcoming scheduled visits based on patient preferences and configured qualification criteria.
markers
Why it classified as flow
Front-of-house actions found anywhere in the tree (including nested sub-jobs).