dwh_patient_stay

Description

This table records each encounter or visit a person has with the healthcare system and serves as a central link to other clinical events.

CNIL compliant warehouse

This data model was published before the CNIL referential for health data warehouse. Some fields are not used to comply with the obligation to separate directly identifying data from clinical data (SEC-LOG-4)

Columns

Field User Guide ETL Conventions Datatype Required Primary Key Foreign Key FK Table
stay_num Unique identifier bigint(64) Yes Yes No
encounter_num Unique identifier of the patient visit, as recorded in the source hospital information system null in CNIL compliant warehouse varchar(300) Yes No No
patient_num bigint(64) Yes No Yes dwh_patient
entry_date Admission date timestamptz Yes No No
out_date Discharge date out_date should be greater or equal than entry_date timestamptz No No No
entry_mode Indicates where a person was admitted from Values are not standardized yet.
Example values : Transfert, Domicile, Mutation
varchar(500) No No No
out_mode Indicates where a person was discharged to after a visit Values are not standardized yet.
Example values : Transfert, Domicile, Mutation, Décès
varchar(500) No No No
type_dos Represents the kind of visit that took place (inpatient, outpatient, emergency, etc.) Consultation, HDJ, HAD, Urgence, Hospitalisation, Ambulatoire, Externes varchar(50) No No No
instance_stay_id Code of the healthcare center, see hospital_instance for more informations varchar(40) No No No
stay_origin_code Indicate source software for this stay varchar(300) No No No
stay_pid Pseudo identifier of the stay. Use in correspondence table to retrieve patient identity when needed. varchar(300) No No No
stay_salt Salt for hash algorithm varchar(300) No No No
upload_id Identifier of the pipeline integration run, used to differentiate each batch of integrated data. Defined at the start of the pipeline as datetime.now().strftime("%Y%m%d%H%M%S").
For example a batch integrated on 15/09/2025 at 00:00:00 has upload_id = 20250915000000.
bigint(64) No No No
update_date Date and time of the record’s last update. timestamptz No No No