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
| Part | Question it answers | Examples |
|---|---|---|
| Prefix | What role does this model play? | stg_, int_, fct_ |
| Subject | Which domain concept is it about? | person_diabetes, blood_pressure |
| Suffix | Which 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
| Prefix | What 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.
| Suffix | What it tells the reader | Example |
|---|---|---|
_all | Every qualifying event; several rows per person are possible | int_hba1c_all |
_latest | The most recent qualifying event at the model's documented grain | int_hba1c_latest |
_current | The state effective now | dim_person_current_practice |
_historical | The history of a changing state | dim_person_demographics_historical |
_register | A defined disease-register population | fct_person_diabetes_register |
_summary | A roll-up at the grain named elsewhere in the model | fct_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.
Compare related names
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.
| Search | Models you will meet | What the family teaches |
|---|---|---|
dim_person_ | dim_person_age, dim_person_ethnicity, dim_person_current_practice, dim_person_demographics | The person is the described entity; the remaining words identify the attribute, relationship or composed person view. |
_latest | int_hba1c_latest, int_blood_pressure_latest, int_bmi_latest, int_smoking_status_latest | Each 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_ + _register | fct_person_asthma_register, fct_person_ckd_register, fct_person_diabetes_register | These 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_recent | One 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 answered1What is the important difference between int_hba1c_all and int_hba1c_latest?
2You think a new person-level housebound model is needed. What should happen first?