Handbook contents

Learn 07~9 min

Reading model names

Most readers encounter a model name before they encounter its SQL. Reading the name helps you choose what to inspect next.

A model name is a small sentence

Names in this project normally contain three parts: a layer prefix, the domain subject, and a suffix where the model's shape needs to be made explicit.

int_hba1c_latest

modelling block · HbA1c results · the most recent result per person

fct_person_diabetes_register

reporting fact · a person's diabetes state · a disease register

stg_olids_observation

staging model · the OLIDS observation table · universally cleaned

fct_person_sus_uec_recent

reporting fact · a person's urgent and emergency care activity from SUS · a recent time window

PartQuestion it answersExamples
PrefixWhat role does this model play?stg_, int_, fct_
SubjectWhich domain concept is it about?person_diabetes, blood_pressure
SuffixWhich shape or variant does it contain?_all, _latest, _register

Not every name needs all three parts. A staging model mirrors its source, so stg_olids_observation is complete. A canonical dimension such as dim_person needs no suffix.

The grammar spans every dataset the project models, not just OLIDS primary-care records. The same three parts name SUS hospital activity (fct_person_sus_apc_recent), GP appointments (fct_person_gp_recent), waiting-list pathways (int_wl_current) and resource use (fct_person_resource_index). Learning to read it once makes every source's models legible.

Prefix: the model's role

PrefixWhat to expect
raw_A generated one-to-one interface to a landed source table
stg_One source made legible and ready for downstream use
int_A purposeful transformation that prepares data for marts
dim_Descriptive context used to understand and group facts
fct_An event or measurable state at a declared grain
pit_A point-in-time view for retrospective reporting
obt_A wide analytical table composed from established concepts
dq_A data-quality output containing records that need attention

The prefix follows the model's responsibility, not its size or its grain.

The analytical tables chapter explains facts and dimensions through examples. Here, read the prefix as a clue to the intended role. It does not prove the grain or tell you whether the model fits your population.

Suffix: the model's shape

A suffix is useful when it distinguishes models about the same subject or warns that one row means something different.

SuffixWhat it tells the readerExample
_allEvery qualifying event; several rows per person are possibleint_hba1c_all
_latestThe most recent qualifying event at the model's documented grainint_hba1c_latest
_currentThe state effective nowdim_person_current_practice
_historicalThe history of a changing statedim_person_demographics_historical
_registerA defined disease-register populationfct_person_diabetes_register
_summaryA roll-up at the grain named elsewhere in the modelfct_ltc_lcs_practice_summary

Joining int_hba1c_all to a person-grain model can multiply its rows. The _all/_latest pair makes that grain difference visible before the join is written.

Related names make differences easier to spot. Compare a history model with its latest-result model, then check their descriptions to see which date, population and selection rule each uses.

The repository already contains dozens of person dimensions, latest-event models and person-register facts. Looking across one family is often the fastest way to understand its taxonomy because the repeated parts stay fixed while the meaningful differences become visible.

SearchModels you will meetWhat the family teaches
dim_person_dim_person_age, dim_person_ethnicity, dim_person_current_practice, dim_person_demographicsThe person is the described entity; the remaining words identify the attribute, relationship or composed person view.
_latestint_hba1c_latest, int_blood_pressure_latest, int_bmi_latest, int_smoking_status_latestEach model selects one qualifying record from a richer history. Compare it with the matching _all model to see the grain change, selected date and tie-breaking rule.
fct_person_ + _registerfct_person_asthma_register, fct_person_ckd_register, fct_person_diabetes_registerThese are related person-grain clinical facts. Compare their population, reference time, evidence and resolution rules rather than assuming every register is constructed identically.
fct_person_sus_fct_person_sus_uec_recent, fct_person_sus_apc_recent, fct_person_sus_op_recentOne person-grain activity summary per SUS dataset: urgent and emergency care, admitted patient care, outpatients. The shared shape makes the differences worth reading: each dataset has its own attendance, admission and status rules.

Try reading the names

Use this exercise to practise the grammar. Finding a plausible name is the first step; the next chapter shows how to inspect descriptions, tests and lineage before deciding to use it.

Find the model · 1/5

Your analysis needs each person's most recent blood pressure reading.

399 real models from the project · prefix colour = layer

Naming a model of your own

Choose the name after deciding what the model does. Use the same subject vocabulary as neighbouring models. Add a suffix when it distinguishes a time, grain or selection rule; words such as _final and _new tell the next reader very little.

A shared pathway model should describe pathways. A published model can appropriately name its consumer, such as asthma_dashboard_base, because serving that product is its purpose. The naming reference keeps the patterns together for lookup. Finding models now puts the names to work in a complete search.

Read the taxonomy

0/2 answered
  1. 1What is the important difference between int_hba1c_all and int_hba1c_latest?

  2. 2You think a new person-level housebound model is needed. What should happen first?