Learn 06~7 min
The model taxonomy
Most readers encounter a model name before they encounter its SQL. Learning to read the names turns 1,500 models from a list into a map.
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.
Facts are subjects; dimensions describe them
The difference between the two reporting prefixes is the role a model plays in an analysis. A fact is the subject: the thing being counted or assessed. A dimension describes a subject: its attributes are joined on to group, filter and explain. When unsure which you are looking at, ask what an analyst does with the rows: do they count them? Or use them to break something else down?
The textbook fact is an event — an appointment, an admission. Many of this project's facts are states instead: fct_person_diabetes_register holds one row per person currently meeting the register definition, and analysts count those rows just the same. What the fact records has changed; the roles have not. The fact is still the subject, and dimensions such as dim_person_ethnicity still describe it.
How a role is chosen — when a transformation stays int_, when a subject deserves a supported fct_ or dim_ mart, and why a register is a fact — is design work, covered in Facts, dimensions and the reporting taxonomy.
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.
Families make the project searchable
Consistent names allow one search to enumerate a whole group of related models:
| Pattern | What it finds |
|---|---|
dim_person_* | Person-level attribute models |
fct_person_*_register | Disease registers across conditions |
int_*_all / int_*_latest | Event histories and their latest variants |
int_*_medications_all | Medication events by drug class |
fct_person_sus_* | Person-level activity from each SUS dataset |
stg_{source}_{table} | The staged version of a source table, whatever the source |
Families work because names put the entity first: dim_person_age, dim_person_ethnicity and dim_person_housebound_status sort together, search together and can be compared side by side. A new synonym breaks the family, which is why models reuse the vocabulary already in the project.
Read a family sideways
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. |
Search before you build
Search the domain concept in VS Code, the project documentation and Snowflake. You may find that the model already exists. If it does not, nearby results show the vocabulary and naming family to follow. The next lesson turns this convention into a complete method for finding and evaluating models.
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
The command reference keeps the prefix, suffix and family tables available as a quick lookup. When you come to name a model of your own, Designing models finishes the job: choosing the analytical role, the subject vocabulary and a suffix that carries information.
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?