trigger
How it's scheduled
The Batch / file feed arrives as a scheduled drop, so one overnight pass is enough: it ingests the day's file and works the whole batch to price and send the good-faith estimate letter. A tighter loop would just re-scan the same file.
| Scheduled task | Cadence | Server | State | Coordination |
|---|---|---|---|---|
\MDC\Daily - Processing - SunLife | daily at 10:30 | 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).
Daily-Visits-Processing
▶Load-ECW-Filessub-job · 12↗
▶Download-ECW-Filessub-job · 1↗
- Download ECW Files from SFTPDownloadDownloads files from remote FTP or SFTP servers to local directories with support for archiving and parallel transfers.server=SunLife_ProdMirror-mdcssh-sftpremote directory=/local directory=D:\ClientData\SunLife
- Process ExportEncounterProcessFilewrites
ImportEncounterSourceEncounterarchive directory=D:\ClientData\SunLife\Archivebase table name=Encounterrow terminator=Newline - Process ExportPatientInsuranceProcessFilewrites
ImportPatientInsuranceSourcePatientInsurancearchive directory=D:\ClientData\SunLife\Archivebase table name=PatientInsurancerow terminator=Newline - Process ExportChargeItemsProcessFilewrites
ImportChargeItemsSourceChargeItemsarchive directory=D:\ClientData\SunLife\Archivebase table name=ChargeItemsrow terminator=Newline - Process ExportDoctorsProcessFilewrites
ImportDoctorsSourceDoctorsfile path=D:\ClientData\SunLife\ExportDoctors.txtarchive directory=D:\ClientData\SunLife\Archivebase table name=Doctorsrow terminator=Newline - Process ExportFacilitiesProcessFilewrites
ImportFacilitiesSourceFacilitiesarchive directory=D:\ClientData\SunLife\Archivebase table name=Facilitiesrow terminator=Newline - Process ExportFeeScheduleProcessFilewrites
ImportFeeScheduleSourceFeeSchedulearchive directory=D:\ClientData\SunLife\Archivebase table name=FeeSchedulerow terminator=Newline - Process ExportChargeMasterProcessFilearchive directory=D:\ClientData\SunLife\Archiverow terminator=Newline
- Process ExportInsuranceProcessFilewrites
ImportInsuranceSourceInsurancearchive directory=D:\ClientData\SunLife\Archivebase table name=Insurancerow terminator=Newline - Process ExportPatientsProcessFilewrites
ImportPatientsSourcePatientsarchive directory=D:\ClientData\SunLife\Archivebase table name=Patientsrow terminator=Newline - Process ExportVisitCodesProcessFilewrites
ImportVisitCodesSourceVisitCodesarchive directory=D:\ClientData\SunLife\Archivebase table name=VisitCodesrow terminator=Newline - Process Export VisitStatusProcessFilewrites
ImportVisitStatusSourceVisitStatusarchive directory=D:\ClientData\SunLife\Archivebase table name=VisitStatusrow terminator=Newline
▶Load-Chargessub-job · 1↗Loads ChargeType and Chargemaster
- Load ChargeTypesql
load_charges__load_chargetype.sql✨ Populates the charge type table with procedure codes and descriptions from the chargemaster to support accurate billing and claim reporting.writesChargeType· readsChargeTypeChargemasterSourceChargeItems
▶Load-InsuranceMapsub-job · 1↗
- Load InsuranceMapLoadEntitieswrites
InsuranceMap· readsInsuranceMapSourceInsuranceentity type=InsuranceMapcustom querykey prefix=IM
▶Load-Visit-Transform-Tablessub-job · 8↗Update [date]: removed the where clause limiting TransformPatientInsurance load to just null or future EndDates. This was deleting and preventing re-insertion of past EndDate records, which then would cause a loop where they always ended up in the patient insurance and visit delt
- Load PatientInsuranceDeltasql
load_visit_transform_tables__load_patientinsurancedelta.sql✨ Flags patients with recent insurance or mapping changes to ensure their coverage information is updated in the pipeline.writesPatientInsuranceDelta· readsPatientInsuranceDelta - Load VisitDeltasql
load_visit_transform_tables__load_visitdelta.sql✨ Flags specific encounters for reprocessing based on recent source updates or changes to the patient's insurance profile.writesVisitDelta· readsPatientInsuranceDeltaSourceEncounterTransformVisitVisitDelta↳ feeds from Load PatientInsuranceDelta, Load TransformVisit - Load TransformPatientInsurancesql
load_visit_transform_tables__load_transformpatientinsurance.sql✨ Updates transformed patient insurance records, including coverage order and mapping, for patients with identified changes.writesTransformPatientInsurance· readsInsuranceMapPatientInsuranceDeltaSourcePatientInsurance↳ feeds from Load PatientInsuranceDelta - Load TransformPatientssql
load_visit_transform_tables__load_transformpatients.sql✨ Loads and updates patient demographic, contact, and guarantor information into the transformed patient table.writesTransformPatient· readssourcepatients - Load TransformVisitsql
load_visit_transform_tables__load_transformvisit.sql✨ Builds and updates visit records by merging encounter details, patient identifiers, and appointment metadata into the transformation layer.writesTransformVisit· readsSourceEncountertransformpatientvisitdelta↳ feeds from Load TransformPatients, Load VisitDelta - Load TransformVisitInsurancesql
load_visit_transform_tables__load_transformvisitinsurance.sql✨ Loads visit-specific insurance details by filtering patient coverage based on dental or non-dental visit types and coordination of benefits.writestransformvisitinsurance· readsDimensionMemberTransformPatientInsuranceTransformVisitVisitDelta↳ feeds from Load TransformPatientInsurance, Load TransformVisit, Load VisitDelta - Load TransformVisitChargesql
load_visit_transform_tables__load_transformvisitcharge.sql✨ Generates visit charges by mapping diagnosis codes and patient demographics to specific service bundles and clinical item IDs.writesTransformVisitCharge· readsChargeTypeImportSunlifeBundlesSourceEncounterTransformPatientTransformVisitVisitDelta↳ feeds from Load TransformPatients, Load TransformVisit, Load VisitDelta - Load TransformUpdatedVisitChargesql
load_visit_transform_tables__load_transformupdatedvisitcharge.sql✨ Refines visit charges by deduplicating evaluation and management codes based on price rankings from the self-pay fee schedule.writesTransformUpdatedVisitCharge· readsImportSunlifeBundlesSourceEncounterTransformSelfPayFeeScheduleTransformVisitChargeVisitDelta↳ feeds from Load TransformVisitCharge, Load VisitDelta
▶Load-Relationssub-job · 1↗Loads relational tables like Provider
- Load Provider Relationsql
load_relations__load_provider_relation.sql✨ Loads and updates provider details, including NPI and taxonomy codes, for active practitioners linked to visits.writesProvider· readsSourceDoctorsTransformVisit
▶Load-Entitiessub-job · 3↗
- Load FacilityLoadEntitieswrites
Facility· readsSourceEncounterSourceFacilitiesentity type=Facilitycustom query - Load PatientsLoadPatientsUpsert patient records into the patient dimension.· reads
PatientTransformPatientcustom patient query - Load BillTypeLoadEntitiesdisabled· reads
ChargeTypeauto queryDISABLED
▶Load-Dimension-Memberssub-job · 16↗Loads Dimension Members
- Load Insurance Categorysql
load_dimension_members__load_insurance_category.sqldisabled✨ Loads insurance categories into the dimension member table to support reporting by commercial and non-commercial insurance types.writesDimensionMember· readsInsuranceCategory - Load Insurancesql
load_dimension_members__load_insurance.sql✨ Loads insurance dimension members and categorizes them as medical or dental based on their display names.writesDimensionMember· readsInsurance - Load EligibilityInsurancesql
load_dimension_members__load_eligibilityinsurance.sqldisabled✨ Updates the eligibility insurance dimension by filtering insurance records for those containing valid electronic benefit API references.writesDimensionMember· readsInsurance - Load Facilitysql
load_dimension_members__load_facility.sql✨ Loads facility dimension members from source facility data to maintain a consistent list of healthcare locations.writesDimensionMember· readsFacilitySourceFacilities - Load VisitStatussql
load_dimension_members__load_visitstatus.sql✨ Loads visit status dimension members to track and report on the current state of patient encounters.writesDimensionMember· readsSourceVisitStatus - Load Provider Dimensionsql
load_dimension_members__load_provider_dimension.sql✨ Loads provider dimension members and maps them to their respective medical specialties for organizational reporting.writesDimensionMember· readsProviderSourceDoctors - Load ProviderType Dimensionsql
load_dimension_members__load_providertype_dimension.sql✨ Builds provider type dimension members by extracting unique specialty categories from the existing provider dimension.writesDimensionMember· readsDimensionMember↳ feeds from Load ChargeType, Load Facility, Load Insurance, Load Modifier, Load Procedure SubCategory, Load ProcedureCode, Load Provider Dimension, Load State DimensionMember, Load Time, Load VisitStatus, Load VisitType DimensionMember - Load ChargeTypesql
load_dimension_members__load_chargetype.sql✨ Loads charge type dimension members and assigns parent categories based on procedure code suffixes.writesDimensionMember· readsChargeType - Load Procedure SubCategorysql
load_dimension_members__load_procedure_subcategory.sql✨ Builds the procedure subcategory dimension by extracting parent categories from existing charge type records.writesDimensionMember· readsDimensionMember↳ feeds from Load ChargeType, Load Facility, Load Insurance, Load Modifier, Load ProcedureCode, Load Provider Dimension, Load ProviderType Dimension, Load State DimensionMember, Load Time, Load VisitStatus, Load VisitType DimensionMember - Load ProcedureCodesql
load_dimension_members__load_procedurecode.sql✨ Loads unique procedure code dimension members extracted from charge type records for billing and clinical tracking.writesDimensionMember· readsChargeType - Load Modifiersql
load_dimension_members__load_modifier.sql✨ Updates the modifier dimension with codes and descriptions sourced from common procedure modifier reference data.writesDimensionMember· readsProcedureModifier - Load Timesql
load_dimension_members__load_time.sql✨ Builds time dimension members for days, months, and years to support temporal analysis of encounter data.writesDimensionMember· readsSourceEncounter - Load EligibilityServiceTypesql
load_dimension_members__load_eligibilityservicetype.sqldisabled✨ Loads the EligibilityServiceType dimension with standardized medical service categories used for insurance benefit verification.writesDimensionMember - Load PayerType Dimensionsql
load_dimension_members__load_payertype_dimension.sqldisabled✨ Updates the PayerType dimension to include specific members for self-pay classifications within the reporting system.writesDimensionMember - Load VisitType DimensionMembersql
load_dimension_members__load_visittype_dimensionmember.sql✨ Builds or updates visit type dimension members to categorize encounters within the reporting system.writesDimensionMember· readsSourceVisitCodes - Load State DimensionMembersql
load_dimension_members__load_state_dimensionmember.sql✨ Updates state dimensions using facility location data to allow for geographic segmentation of healthcare services and revenue.writesDimensionMember· readsFacility
▶Load-Visitssub-job · 9↗Runs visit and eligibility processing Update [date]: Disabling the CheckVisitGFEComplianceBatch task because it is blowing up processing (ran for >24 hours before being killed) and because no one knows what it does. Can re-enable if it is determined to be necessary and we can inv
- LoadVisitBatchLoadVisitBatchLoad scheduled visits and associated charges into the processing pipeline using custom SQL queries for pricing estimation and quote generation.writes
QuoteBatchVisitBatch· readsPatientTransformUpdatedVisitChargeTransformVisitTransformVisitInsuranceVisitVisitDeltavisitdelta↳ feeds from Sync QuoteBatch,VisitBatch,CustomPropertyMapBatchcustom visit querycustom charge queryauto service type queryauto coverage queryadd zero charge - CalculateVisitsflowCompute the good-faith estimate (CalculateVisits).· reads
DimensionMemberVisitBatch↳ feeds from LoadVisitBatchcustom querycalculate chargesbatch mode ▶Load-Custom-Propertiessub-job · 11↗Load custom properties from Load-Visits
- UpdateVisitCustomPropertyFromQueryUpdateVisitCustomPropertyFromQuerydisabled· reads
InsuranceSearch_ResultTransformVisitInsuranceCoverageStatusVisitBatchcustom visit update custom property queryDISABLED - Custom Properties: OtherActiveCoverageUpdateVisitCustomPropertyFromQuerydisabled· reads
TransformVisitInsuranceCoverageStatusVisitBatchcustom visit update custom property queryDISABLED - Custom Properties: OtherInactiveCoverageUpdateVisitCustomPropertyFromQuerydisabled· reads
TransformVisitInsuranceCoverageStatusVisitBatchcustom visit update custom property queryDISABLED - Custom Properties: Update MostRecentBatch to clear the previous recordsUpdateVisitCustomPropertyFromQuerydisabled· reads
CustomPropertyMapVisitcustom visit update custom property queryDISABLED - Custom Properties: MostRecentBatchUpdateVisitCustomPropertyFromQuerydisabledauto visit update custom property queryDISABLED
- Custom Properties: OAS ReasonUpdateCustomPropertyFromQuerydisabled· reads
CustomPropertyMapsourceappointmentchaintransformcustompropertiesvisitbatchvisitdeltaentity=Visitcustom property key=OASReasonauto querybatch modeDISABLED - Custom Properties: Has BundleUpdateCustomPropertyFromQuerydisabled· reads
CustomPropertyMapTransformVisitChargeVisitBatchvisitdeltaentity=Visitcustom property key=HasBundleauto querybatch modeDISABLED - Custom Properties: GFE ReasonUpdateCustomPropertyFromQuerydisabled· reads
CustomPropertyMaptransformcustompropertiesvisitbatchvisitdeltaentity=Visitcustom property key=GFEReasoncustom querybatch modeDISABLED - Custom Properties: Set LetterPrinted to NoUpdateCustomPropertyFromQuerydisabled· reads
CustomPropertyMapVisitBatchentity=Visitcustom property key=LetterPrintedcustom querybatch modeDISABLED - UpdateCustomPropertyFromQuery (GFEDueDate)UpdateCustomPropertyFromQuerydisabled· reads
SourceEncounterTransformVisitVisitBatchentity=Visitcustom property key=GFEDueDatecustom querybatch modeDISABLED - Custom Properties: HasOBPackageUpdateCustomPropertyFromQuery· reads
TransformVisitInsuranceVisitBatchentity=Visitcustom property key=HasOBPackagecustom querybatch 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
- Generates and sends patient cost estimate letters for visits in the batch table based on configured qualification and communication rules.DISABLED
- Synchronizes 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 removed custom property mapssync visit change event ▶Load-Visit-Factsub-job · 2↗
- Create Visit Factsql
load_visit_fact__create_visit_fact.sql✨ Builds the visit fact table structure to store comprehensive encounter metrics, insurance status, and payment details. - Load Visit Factsql
load_visit_fact__load_visit_fact.sql✨ Loads visit fact data by identifying and refreshing records with recent activity in payments, eligibility, or letters.writesVisitFactVisitFactDelta· readsActivityLogCustomPropertyMapEligibilityStatusMapEligibilityTxnPatientLetterPaymentTxnVisitVisitFactDelta
- UpdateDashboardTablesUpdateDashboardTablesRegenerates optimized aggregate tables for all dashboard reports and updates their definitions to reflect the latest source data.
- Data-Integrity-Reportsub-job
▶Refresh-Reports-Dailysub-job · 1↗
- Refresh UnmatchedEncountersReportsql
refresh_reports_daily__refresh_unmatchedencountersreport.sql✨ Builds a report identifying upcoming patient encounters where diagnosis codes do not match any predefined service bundles.writesUnmatchedEncountersReport· readsDimensionMemberImportSunlifeBundlesPatientSourceEncounterVisit
markers
Why it classified as flow
Front-of-house actions found anywhere in the tree (including nested sub-jobs).