Primary procedure

From ECHSA Congenital Database
Revision as of 21:14, 28 September 2005 by MaciejBlizinski (talk | contribs)
Jump to navigationJump to search

Primary procedure is the most important, the most significant procedure in specific operation. In most cases, it's the procedure with highest Basic Score.

Usage of primary procedure in database reports

The full database structure employs a model where one patient is exposed to multiple procedures during multiple operation. An example table in a relational database would look like this:

Patient ID Procedure name
Patient1 Procedure1
Patient1 Procedure2
Patient2 Procedure3
Patient2 Procedure2
Patient3 Procedure1
Patient4 Procedure1
Patient4 Procedure2
Patient4 Procedure3

However, this model doesn't allow to perform a "mortality vs procedure" report, because mortality is a property of a patient, and one procedure has to be chosen as the "responsible" procedure. To perform a "mortality vs procedure" report, the above table has to be reduced down to this model, with no repeating "Patient ID" value:

Patient ID Procedure name
Patient1 Procedure1
Patient2 Procedure3
Patient3 Procedure1
Patient4 Procedure1

The reduction is performed in such a way, that each patient-procedure link has an assigned priority, like this:


Patient ID Procedure name Priority
Patient1 Procedure1 1
Patient1 Procedure2 2
Patient2 Procedure3 1
Patient2 Procedure2 2
Patient3 Procedure1 1
Patient4 Procedure1 1
Patient4 Procedure2 2
Patient4 Procedure3 3

To reduce the table, only rows with priority equal to 1 are left, and all others removed:

Patient ID Procedure name Priority
Patient1 Procedure1 1
Patient2 Procedure3 1
Patient3 Procedure1 1
Patient4 Procedure1 1


See also