I’m working on a data warehouse for a pharmacy business process and need some advice on determining the appropriate grain for the fact table.
The business process is as follows:
- A pharmacy provides consultations to patients. Each consultation might involve multiple assessments.
- A patient can have one initial consultation and multiple follow-up consultations.
- There are multiple pharmacy locations, and each location has several pharmacists.
- A consultation can result in a prescription, which may include one or more drugs being prescribed.
Given this scenario, what would be the most suitable grain for the fact table? Should it be at the consultation level, prescription level, or even down to the line item level of each prescribed drug?
I think the grain of the fact table should be at the prescription line-item level. Each row in the fact table will represent a single line item, which is part of a prescription. Every prescription is associated with one consultation.
What do you think of the following schema:
Would this schema be appropriate for capturing the data at the required grain? Any feedback or suggestions would be appreciated!