2.6 KiB
2.6 KiB
Template Validation Status
Last reviewed: 2026-05-12
Scope
The reusable SQL templates in folders 01_medicine_lookups through
06_advanced_methods were checked with the Snowflake MCP against live table
metadata and representative parameter values. Templates that use SET
variables were validated by substituting safe example literals into the final
SELECT statement before running describe_query.
The 00_copied_reference folder and docs/training_intro_snowflake_sql are
historic/reference material. They are retained for learning and comparison,
not as the preferred starting point for new analysis.
Live Metadata Checked
REPORTING_DATASETS_ICB.SCRATCHPAD."MEDS__UnifiedPrescribingTable"NATIONAL.GPMED."MedicinesDispensedInPrimarycare"DATA_HUB.DWH."DimMedicineAndDevice"DATA_HUB.DWH."DimOrganisationAndSite"DATA_HUB.DWH."DimPerson"DATA_HUB.PHM."ClinicalCodingClusterSnomedCodes"DATA_HUB.PHM."PrimaryCareClinicalCoding"PRIMARY_CARE.TPP."SRPrimaryCareMedication"PRIMARY_CARE.TPP."SRPatient"
Query Compilation Checks
All files below passed Snowflake MCP describe_query validation:
01_medicine_lookups/medicine_reference_lookup.sql01_medicine_lookups/prescribing_by_vtm.sql01_medicine_lookups/prescribing_by_vmp.sql01_medicine_lookups/dispensing_by_vtm_or_vmp.sql01_medicine_lookups/prescribing_for_patient_pseudonym.sql02_prescribing_analysis/practice_level_bnf_prescribing_summary.sql02_prescribing_analysis/high_prescribing_practices_quintile_template.sql02_prescribing_analysis/prescribing_spend_by_patient_template.sql03_cohorts_and_clinical_coding/cluster_code_lookup.sql03_cohorts_and_clinical_coding/monthly_clinical_event_count_by_practice.sql03_cohorts_and_clinical_coding/prescribing_plus_clinical_code_cohort.sql04_rolling_and_pqs/rolling_period_generator.sql04_rolling_and_pqs/latest_data_dates.sql04_rolling_and_pqs/baseline_vs_evaluation_template.sql04_rolling_and_pqs/dual_source_long_format_measure_template.sql05_audit_detail/human_readable_prescribing_detail.sql06_advanced_methods/product_price_and_quantity_parsing_template.sql
Freshness Probe
The latest_data_dates.sql query was also executed with Snowflake MCP. At the
time of review it returned:
NATIONAL.GPMED."MedicinesDispensedInPrimarycare"latestProcessingPeriodDate:2025-07-01PRIMARY_CARE.TPP."SRPrimaryCareMedication"latestDateEventRecordedwithin the recent-window probe:2026-03-28REPORTING_DATASETS_ICB.SCRATCHPAD."MEDS__UnifiedPrescribingTable"latest non-futureDateMedicationStart:2026-05-12