sub-job
SunLife · Load-Visit-Transform-Tables
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 deltas. Hoping this helps with processing timing as well as data integrity. -CW
task tree
What the sub-job 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).
sub-job
Load-Visit-Transform-Tables
8 tasks · SunLife
sub-job / Flow action SQL / native step▶ expand a sub-job inline · ↗ open it as its own page · a typed step opens its doc
- 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