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-Visits
27 tasks · SSR
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-Source-Visit-Tablessub-job · 18↗
- Load Appointment Deltasql
load_source_visit_tables__load_appointment_delta.sql✨ Identifies new or updated future appointments and unscheduled visits since the last data load for processing.writesTempAppointmentDelta - Load TempVisitAggregatesql
load_source_visit_tables__load_tempvisitaggregate.sql✨ Groups appointment changes by patient, facility, and date to prepare for visit-level aggregation and processing.writesTempVisitAggregate· readsSourcePatientAppointmentTempAppointmentDelta↳ feeds from Load Appointment Delta - Load TempNewVisitAppointmentMapsql
load_source_visit_tables__load_tempnewvisitappointmentmap.sql✨ Maps changed appointments to their existing visit identifiers to track relationships between appointments and visits.writesTempNewVisitAppointmentMap - Load TempNewVisitAppointmentMatchsql
load_source_visit_tables__load_tempnewvisitappointmentmatch.sql✨ Identifies visits where all associated appointments share consistent patient, facility, and scheduling details.writesTempNewVisitAppointmentMatch - Update VisitID on TempVisitAggregatesql
load_source_visit_tables__update_visitid_on_tempvisitaggregate.sql✨ Assigns existing visit identifiers to the aggregated appointment data based on matching patient and facility details.· readsTempNewVisitAppointmentMatchTempVisitAggregate↳ feeds from Load TempNewVisitAppointmentMatch, Load TempVisitAggregate - Load TempVisitMatchsql
load_source_visit_tables__load_tempvisitmatch.sql✨ Matches new appointment aggregates to existing visits based on patient, facility, and scheduling status.writesTempVisitMatch - Update TempVisitAggregate with matched VisitIDsql
load_source_visit_tables__update_tempvisitaggregate_with_matched_visitid.sql✨ Updates the temporary visit aggregate table with matched visit identifiers using date and order status to prioritize the best match.· readsSourceVisitTempVisitAggregateTempVisitMatch↳ feeds from Load SourceVisit, Load TempVisitAggregate, Load TempVisitMatch - Load TempVisitAppointmentMapsql
load_source_visit_tables__load_tempvisitappointmentmap.sql✨ Builds a temporary mapping table between visit aggregates and source appointments based on patient, date, facility, and status.writesTempVisitAppointmentMap - Load TempSourceVisitsql
load_source_visit_tables__load_tempsourcevisit.sql✨ Loads a temporary source visit table by aggregating appointment details, arrival times, and determining insurance categories for each visit.writesTempSourceVisit - Load SourceVisitsql
load_source_visit_tables__load_sourcevisit.sql✨ Loads new visit records into the main source visit table for entries that do not yet have an assigned identifier.writesSourceVisit· readsTempSourceVisitTempVisitAggregate↳ feeds from Load TempSourceVisit, Load TempVisitAggregate - Update SourceVisitsql
load_source_visit_tables__update_sourcevisit.sql✨ Updates existing source visit records with the latest scheduling, facility, and insurance information from the temporary source table.· readsSourceVisitTempSourceVisitTempVisitAggregate↳ feeds from Load SourceVisit, Load TempSourceVisit, Load TempVisitAggregate - Update TempAggregate VisitID for new Visitssql
load_source_visit_tables__update_tempaggregate_visitid_for_new_visits.sql✨ Updates the temporary aggregate table with visit identifiers for newly created records to ensure consistency across the pipeline.· readsSourceVisitTempVisitAggregate↳ feeds from Load SourceVisit, Load TempVisitAggregate - Load SourceVisitAppointmentMapsql
load_source_visit_tables__load_sourcevisitappointmentmap.sql✨ Loads the permanent visit-to-appointment mapping table by replacing existing records with updated data from the temporary mapping table.writesSourceVisitAppointmentMap· readsTempVisitAggregateTempVisitAppointmentMap↳ feeds from Load TempVisitAggregate, Load TempVisitAppointmentMap - Update Visit Statussql
load_source_visit_tables__update_visit_status.sql✨ Updates visit statuses based on appointment priority and archives any visits that are no longer associated with an active appointment.· readsSourcePatientAppointmentSourceVisitSourceVisitAppointmentMapTempAppointmentDeltaVisitStatusMap↳ feeds from Load Appointment Delta, Load SourceVisit, Load SourceVisitAppointmentMap - Load SourceVisitChargessql
load_source_visit_tables__load_sourcevisitcharges.sql✨ Builds the source visit charge table by mapping appointment procedures and additional charges to standardized service types for each visit.writesSourceVisitCharge· readsChargeTypeSourcePatientAppointmentSourceVisitAppointmentMapTempVisitAggregate↳ feeds from Load SourceVisitAppointmentMap, Load TempVisitAggregate - *DISABLED-ARCHIVED* Load SourceVisitChargessql
load_source_visit_tables__disabled_archived_load_sourcevisitcharges.sqldisabled✨ Populates visit charges using exam-specific data and hardcoded service type logic for various imaging procedure categories.writesSourceVisitCharge· readsChargeTypeSourceExamsSourcePatientAppointmentSourceVisitAppointmentMapTempVisitAggregate - Load SourceVisitInsurancesql
load_source_visit_tables__load_sourcevisitinsurance.sql✨ Loads primary and secondary insurance details for visits, including member IDs, group numbers, and coordination of benefits information.writesSourceVisitInsurance· readsSourceCarrierMapSourcePatientAppointmentSourceVisitSourceVisitAppointmentMapTempVisitAggregate↳ feeds from Load SourceVisit, Load SourceVisitAppointmentMap, Load TempVisitAggregate - *DISABLED - MOVED TO LOAD-VISITS* Insert to VisitLoadHistorysql
load_source_visit_tables__disabled_moved_to_load_visits_insert_to_visitloadhistory.sqldisabled✨ Records the current timestamp to track when the visit data loading process was last executed.writesVisitLoadHistory
- Load TempVisitDeltasql
load_visits__load_tempvisitdelta.sql✨ Builds a temporary list of unique visit identifiers to track which records require processing or updates in the current batch.writesTempVisitDelta - Match Manually-Created Visits to SourceVisitsUpdateEntitieswrites
Visit· readsPatientSourceVisitTempVisitDeltaVisit↳ feeds from Load TempVisitDelta, Sync Batchentity type=Visitcustom query - Log Insert Time for VisitBatchsql
load_visits__log_insert_time_for_visitbatch.sql✨ Captures the start time of the current visit batch processing for logging and performance monitoring purposes.writesTempVisitBatchInsertTime - Load TempVisitServiceTypesql
load_visits__load_tempvisitservicetype.sql✨ Determines the appropriate eligibility service type for each visit based on insurance provider and associated charge information.writesTempVisitServiceType - LoadVisitsLoadVisitsLoad scheduled visits and associated charges into the processing pipeline using custom SQL queries for pricing estimation and quote generation.writes
QuoteBatchVisitBatch· readsPatientSourceVisitSourceVisitChargeSourceVisitInsuranceTempVisitDeltaTempVisitServiceTypeVisit↳ feeds from Load TempVisitDelta, Load TempVisitServiceType, Match Manually-Created Visits to SourceVisits, Sync Batchcustom visit queryauto charge querycustom service type querycustom coverage queryadd zero charge - Load TempBatchVisitssql
load_visits__load_tempbatchvisits.sqldisabled✨ Builds a temporary table of scheduled visits with insurance details and batch flags to determine eligibility check requirements.writesTempBatchVisits - CheckBenefitsflowVerifies insurance eligibility and retrieves detailed benefits information for visits by making real-time API calls to insurance providers.auto query
- Wait for 30 secondssql
load_visits__wait_for_30_seconds.sqldisabled✨ Pauses the pipeline execution for thirty seconds to allow preceding processes or external dependencies to complete. - Verifies insurance eligibility and retrieves detailed benefits information for visits by making real-time API calls to insurance providers.· reads
CommonDataEligibilityTxnTempBatchVisitsTempVisitBatchInsertTimecustom queryDISABLED - AutoApplyBenefitsAutoApplyBenefitsPopulates insurance benefits like copays and deductibles on batch visits using data from eligibility verification transactions.
- CalculateVisitsflowCompute the good-faith estimate (CalculateVisits).· reads
DimensionMemberTempVisitDeltaVisitBatch↳ feeds from Load TempVisitDelta, Load Visitscustom querycalculate chargesupdate dimensionsbatch mode - Load TempAuthFlagssql
load_visits__load_tempauthflags.sql✨ Builds a temporary table flagging visits that require or have obtained prior authorization based on appointment and visit data.writesTempAuthFlags - Load TempVisitCoverageFlagsql
load_visits__load_tempvisitcoverageflag.sql✨ Builds a temporary table identifying the most recent insurance coverage and eligibility status for upcoming scheduled visits.writesTempVisitCoverageFlag· readsEligibilityStatusMapEligibilityTxnSourceVisitInsuranceTempVisitDeltaVisitBatch↳ feeds from Load TempVisitDelta, Load Visits - ExportBatchVisitEligibilityflowPush the batch to the app / export results.· reads
EligibilityTxnvisitbatch↳ feeds from Load Visitsauto querytable name=BatchVisitEligibility - Update-Visit-Customproperties-PrimaryCoverageStatusUpdate-Visit-Customproperties-PrimaryCoverageStatus· reads
CustomPropertyMapEligibilityTxnVisitBatchVisitCoverageBatch↳ feeds from Load Visits, Sync Batchentity=Visitcustom property key=PrimaryCoverageStatuscustom querybatch mode - Update-Visit-Customproperties-SecondaryCoverageStatusUpdate-Visit-Customproperties-SecondaryCoverageStatus· reads
CustomPropertyMapEligibilityTxnVisitBatchVisitCoverageBatch↳ feeds from Load Visits, Sync Batchentity=Visitcustom property key=SecondaryCoverageStatuscustom querybatch mode - Update-Visit-Customproperties-AuthorizationStatusUpdate-Visit-Customproperties-AuthorizationStatus· reads
TempAuthFlagsVisitBatch↳ feeds from Load TempAuthFlags, Load Visitsentity=Visitcustom property key=AuthorizationStatuscustom querybatch mode - Update-Visit-Customproperties-HasMedicarePartCCoverageUpdate-Visit-Customproperties-HasMedicarePartCCoverage· reads
EligibilityTxnVisitBatch↳ feeds from Load Visitsentity=Visitcustom property key=HasMedicarePartCCoveragecustom querybatch mode - Update-Visit-Customproperties-HasMismatchedMemberIDUpdate-Visit-Customproperties-HasMismatchedMemberID· reads
BatchVisitEligibilityEligibilityTxnVisitBatch↳ feeds from Load Visitsentity=Visitcustom property key=HasMismatchedMemberIDcustom querybatch mode - AutoSendLettersAutoSendLettersGenerates and sends patient cost estimate letters for visits in the batch table based on configured qualification and communication rules.
- Sync BatchSyncBatchSynchronizes processed data from batch staging tables to production tables, updating visits, quotes, and custom property mappings.writes
CustomPropertyMapQuoteVisitVisitChangeEvent· readsCustomPropertyMapBatchQuoteBatchVisitBatchVisitChangeEventBatch↳ feeds from Load Visitssync quotesync visitsync custom property mapsync visit change event - Extract Detailed Benefit ReturnflowPush the batch to the app / export results.· reads
EligibilityTxnSourceBenefitDetail↳ feeds from Load SourceBenefitDetailcustom querytable name=TempBenefitDetail - Load SourceBenefitDetailsql
load_visits__load_sourcebenefitdetail.sql✨ Loads detailed insurance benefit information into the source table and ranks eligibility transactions by their most recent status.writesSourceBenefitDetail· readsEligibilityTxnSourceBenefitDetailTempBenefitDetailVisit↳ feeds from Match Manually-Created Visits to SourceVisits, Sync Batch - Load VisitLoadHistorysql
load_visits__load_visitloadhistory.sql✨ Records the current timestamp to track when the visit data loading process was last executed.writesVisitLoadHistory ▶Load-Visit-Factsub-job · 2↗
- Create Visit Factsql
load_visit_fact__create_visit_fact.sql✨ Creates the VisitFact table to store aggregated visit data, including scheduling, insurance, and payment status, if it does not exist. - Load Visit Factsql
load_visit_fact__load_visit_fact.sql✨ Updates the visit fact table with recent activity regarding payments, eligibility requests, and patient letters for reporting and analysis.writesVisitFact· readsEligibilityStatusMapEligibilityTxnPatientLetterPaymentTxnVisit
- UpdateDashboardTablesUpdateDashboardTablesRegenerates optimized aggregate tables for all dashboard reports and updates their definitions to reflect the latest source data.