I'm helping out a community in the US designing a database webapp to hold information on medlab tests and similar.
and ... I'm running into some design issues that have meant I haven't progressed for a while.
Some background
1. i design apps so that there is a mapping between classes and entities.
2. entities typically (but not always) map to database tables
3. entities typically map to web-forms.
4. statistical analysis on the data is vital to the usefulness of the app. both per lab result and across all lab results. So using serialised arrays for storing arbitrary data is not viable.
5. not all lab-results have a single data point. take, for example, blood pressure. for that you must record the diastolic, systolic and pulse. For urine analysis you need both the value of the measurement (e.g. norepinephrine) and the quantity of urine excreted. The number of data points is different for each lab-test.
6. the lab-test must also have the reference range available for them (if they are not supplied by the lab or entered by the user). Reference ranges are often a simple minimum and maximum; but are sometimes only ascertainable by an analysis of the person's gender and age (and sometimes other factors).
7. there are potentially hundreds of lab-tests that must be mapped.
8. i'm doing this for free so want to have an easy life.
I'm coming up with nothing when trying to deal with 1-8 inclusive. I have not come up with a decent paradigm to handle everything at once.
The choice at the moment seems to be:
A. a different table and a different class for each type of reading.
B. a single base class for readings and for those with 'oddities' a class that can inherit from the base PLUS a single table that has multiple columns (say four) for the measurement data
An alternative possibility is to adopt a wordpress-stype options table where the measurement values are stored in a key-value pair in a three column table
[ignore]
[table readings]
readingID,
userID,
readingDate,
readingTypeID,
labRefMin,
labRefMax,
readingLabels //(e.g. diastolic, systolic, pulse) - serialised array
[table readingTypes]
readingTypeID,
readingType //(e.g. Serum Na+, Serum K+, Serum Cl-)
[table readingValues]
readingID,
readingName,
readingValue
[/ignore]
Does anyone have any thoughts on what might be the most useful model? possibly a hybrid of B + alternative may be the best?
tia,
Justin
and ... I'm running into some design issues that have meant I haven't progressed for a while.
Some background
1. i design apps so that there is a mapping between classes and entities.
2. entities typically (but not always) map to database tables
3. entities typically map to web-forms.
4. statistical analysis on the data is vital to the usefulness of the app. both per lab result and across all lab results. So using serialised arrays for storing arbitrary data is not viable.
5. not all lab-results have a single data point. take, for example, blood pressure. for that you must record the diastolic, systolic and pulse. For urine analysis you need both the value of the measurement (e.g. norepinephrine) and the quantity of urine excreted. The number of data points is different for each lab-test.
6. the lab-test must also have the reference range available for them (if they are not supplied by the lab or entered by the user). Reference ranges are often a simple minimum and maximum; but are sometimes only ascertainable by an analysis of the person's gender and age (and sometimes other factors).
7. there are potentially hundreds of lab-tests that must be mapped.
8. i'm doing this for free so want to have an easy life.
I'm coming up with nothing when trying to deal with 1-8 inclusive. I have not come up with a decent paradigm to handle everything at once.
The choice at the moment seems to be:
A. a different table and a different class for each type of reading.
B. a single base class for readings and for those with 'oddities' a class that can inherit from the base PLUS a single table that has multiple columns (say four) for the measurement data
An alternative possibility is to adopt a wordpress-stype options table where the measurement values are stored in a key-value pair in a three column table
[ignore]
[table readings]
readingID,
userID,
readingDate,
readingTypeID,
labRefMin,
labRefMax,
readingLabels //(e.g. diastolic, systolic, pulse) - serialised array
[table readingTypes]
readingTypeID,
readingType //(e.g. Serum Na+, Serum K+, Serum Cl-)
[table readingValues]
readingID,
readingName,
readingValue
[/ignore]
Does anyone have any thoughts on what might be the most useful model? possibly a hybrid of B + alternative may be the best?
tia,
Justin