Hospital data warehouse
Gathering a hospital's scattered data, cleaning it, protecting patient identity, then showing it in a dashboard for doctors and management.
CESI · Big Data · Team project (3 people)

- Role
- Data extraction with Talend, performance measurements, Power BI dashboard
- Team
- 3 students
- Data
- 6 sources, including 25 million death records. Partly fictional, not published
- Environment
- A single simulated computer (virtual machine) with 8 GB of memory
The dashboard in pictures
Four pages, for two audiences: practitioners and management. Filters (year, region, age, sex) make it possible to look at only part of the data. Screenshots of the report, which is in French, on the course data, partly fictional.
1/4 · Summary: the eight indicators, practitioners' on top and management's below
Key points
- Six sources in different formats brought together in one place, then cleaned and organised
- Patient names are removed from the start, and a figure is never shown if it could let someone be recognised
- A dashboard for two audiences, doctors and management, answering eight questions
- Every technical choice was measured: the same question drops from 185 seconds to under a second
How it works
- 1
The sources
A hospital keeps its data in several ways: a database (patients, consultations, doctors) and spreadsheet-style files (facilities, hospital stays, a satisfaction survey, deaths). Deaths alone weigh 25 million rows. These sources do not talk to each other.
- 2
Bronze, the raw copy
A data transfer tool (Talend) copies each source as it is into a large storage space spread over several machines, called a data lake. Names are removed at this stage, and each patient gets a code in place of their identifier: without the key, kept apart, the person cannot be traced. This is pseudonymisation.
- 3
Silver, the cleaning
Every column gets a type (number, date, text), duplicates are removed and invalid rows are set aside in a separate table. The sources are then linked together. At every step, counters check that nothing was lost on the way, and processing stops if the figures do not add up.
- 4
Gold, organised to answer
The data is arranged as a star: at the centre, the events (consultations, hospital stays, deaths, survey answers), and around them, the reference lists (dates, patients, facilities, diagnoses). A question only has one link to make, which makes it much faster.
- 5
The dashboard
A query engine (Impala) answers in a few seconds at most. Power BI, the dashboard software, puts its questions to it every time a page is shown, without copying the data. The report has four pages and eight indicators, for doctors and for management.
The assignment
A university hospital (CHU) produces data in very different formats, and nobody can look at them together. The project gathers them in a data warehouse, that is a single place where they are cleaned and organised, then shows them in a dashboard. It serves two audiences. Practitioners want to know, for example, which diagnoses and specialities come up most. Management wants to compare facilities and follow deaths and patient satisfaction region by region. Eight indicators, named B1 to B8 in the reports, answer these questions. The data supplied for the course is partly fictional and is not published: the repository holds the code, the reports and the measurements, not the data.
Design choices
Every choice rests on a measurement or a constraint, never on habit.
- Three layers rather than one, named Bronze, Silver and Gold: the raw copy, the cleaning, then the shaping to answer questions. If a cleaning rule changes, the following layers are replayed without going back to the sources
- Two complementary tools: Hive for big loads, Impala for fast answers. Hive takes about 40 seconds at every step whatever the amount of data, which suits a load but not a dashboard
- A star arrangement rather than the original tables: a question that needed four links between tables now needs one
- A dashboard that queries the storage directly (Power BI's DirectQuery mode), copying nothing: with 100 million consultations, everything would have had to be imported into Power BI
- We also tested a classic database (PostgreSQL), where the results would have been copied. It answers fast at small scale, but it forces the data out of the lake, and on a single machine it slows down markedly as volume and number of users grow: with 50 users, opening the dashboard went from 0.45 seconds at 1 million consultations to 70 seconds at 50 million. We therefore set it aside
Measuring before choosing
For every choice, the project measures what it brings by changing only one thing at a time. The chart follows a single question, “how many consultations per region?”, asked four ways: it goes from 185 seconds to under a second.

- Every test is run four times, the first one cold, and the median of the next three is kept
- Every variant of a test must give exactly the same result, checked by a fingerprint of the answer: a faster variant giving a different figure proves nothing
- That check paid off: Impala showed 71.59 instead of 71.60 for Martinique, because it truncated a division, while Hive gave 71.60. The query was corrected
- Failed runs stay in the repository, with their log
Protecting patients
Health data is only shown to those who need it, and only as far as they need it.
- Names and other direct identifiers are removed at extraction, and each patient is referred to by a code. Without the key, kept outside the repository, nobody can trace the person
- The dashboard never receives this code: it cannot even read it
- A rate computed on fewer than ten patients is not shown. With several filters, a cell may match only one or two patients, who could then be recognised: this is statistical secrecy
- Each user only sees their own scope: a demo role limits the whole report to Brittany, for example
What did not work and what is left to do
- The Parquet format (a column-oriented file format) changed nothing on the tested question: 57 seconds against 52 as text, because its tables are small. It pays off on the 25 million deaths, where Hive reads 18 times less data
- A trial with another computing engine (Spark) could not start, for lack of memory on the virtual machine. It is recorded as such rather than presented as a result
- Our small test machine stalls when many people open the dashboard at once on very large volumes: some queries fail with Impala, and PostgreSQL takes 70 seconds. Only a real group of machines could confirm that the chosen approach holds at that scale
- Deaths are scaled to population, but without accounting for age: an older region has more deaths. Comparing at equal age is still to do
- The data is partly fictional: the most frequent diagnosis weighs only 0.02% of consultations, so two indicators bring out no dominant illness
What I took away
- Measure every choice before defending it, and keep the measurements that contradict intuition
- Why two tools complement each other: one to load large volumes, the other to answer fast
- Building a processing chain that checks itself: counters, rejected rows kept apart, automatic stop when a figure does not add up
- Designing data protection from the start rather than at the end
- Handing a result over to a team so that everyone starts from the same data, on their own machine



