Procedures
⚠️ The French small case policy (currently <11) is active, therefore they are not provided these codes in the dataset.
Step 1
Download CCAM.
Step 2
Import into WampServer.
💡 To prevent WampServer from causing errors, it is recommended to use the PHP method.
Step 3
Remove overseas locations starting from Finess 97 onwards.
DELETE FROM `2020`
WHERE `finessgeo` >= '97';
Step 4
Remove all columns except for finessgeo, actes, nb_actes.
Step 5
Index finessgeo.
Step 6
Rename columns:
actes
nb_actes
Step 7
Insert serial column as MEDIUMINT and populate.
Step 8
Remove unwanted establishments by using the finessgeo 👉 using the tables establishment_wanted and establishments_unwanted that are obtained from processing diagnostics.
DELETE FROM `2024`
WHERE `finess` NOT IN (
SELECT `nofinesset_individual`
FROM `0_national_establishments_wanted`
);
-- and
DELETE FROM `2024`
WHERE `finessgeo`IN (
SELECT `nofinesset`
FROM `0_reference_unwanted_finesses`
);
Step 9
Insert year column as YEAR and populate.
Step 10
Check if there are any unassigned serial numbers with a value of 0 and assess if a new one needs to be generated.
Step 11
Remove the finessgeo column.
Step 12
Deduplicate.
To list duplicates:
SELECT
`year`,
`serial`,
`code`,
COUNT(*) AS duplicate_count
FROM `proc_france_all`
GROUP BY
`year`,
`serial`,
`code`
HAVING COUNT(*) > 1;
Step 13
Identify and rectify any cells that have empty, NULL, or zero values as needed.
Step 14
Build the hospital table for use in PX database (Hostinger).
Step 15
Insert column called region with a structure consisting of VARCHAR 50
Step 16
Populate the region column:
UPDATE `proc_france_all`, `0_hospitals_france`
SET
`proc_france_all`.`region` = `0_hospitals_france`.`region`
WHERE
`proc_france_all`.`serial` = `0_hospitals_france`.`serial`;
Step 17
Build the hospital table:
-- Remove all hospitals with no data from the hospital table
DELETE FROM `0_hospitals_france`
WHERE `serial` NOT IN (
SELECT `serial`
FROM `proc_france_all`
);
-- Check all hospital serials with data are in the hospital table
SELECT DISTINCT hf.serial
FROM proc_france_all AS hf
WHERE hf.serial NOT IN (
SELECT serial
FROM 0_hospitals_france
);
-- Reverse query
SELECT DISTINCT h.serial
FROM 0_hospitals_france AS h
WHERE h.serial NOT IN (
SELECT serial
FROM proc_france_all
);
-- Populate Finess Geo column
UPDATE `0_hospitals_france`, `finess_serial`
SET
`0_hospitals_france`.`finess_geo` = `finess_serial`.`finessgeo`
WHERE
`0_hospitals_france`.`serial` = `finess_serial`.`serial`;
Topic last reviewed: 26/11/25