Closed erictzeng closed 12 years ago
For the Drug model, it might be good to add fields for the unit of measurement (string) and the alert status (boolean). The former is because different drugs may be listed with different units (eg. milligrams vs. packages) which may be an important thing to note, and also may come in handy when displaying amounts. The latter is so that we don't have to constantly do a million comparisons to display alerts; we can update alert status when we get a drug delta and constantly display drugs with an alert level set to true.
DrugDelta actually sounds fine to me. It's descriptive.
I would also consider changing some column headers to be more descriptive/concise (where possible). Suggestions below.
Drug Model: id name quantity units calculated_usage_rate static_usage_rate (this name could still use some work) low_stock_point low_stock_alert
Question: should we use a calculated low_stock_point or one set by the user or both? if both, we should have another field, like we do for usage rate. (calculated_low_stock_point, static_low_stock_point)
Perhaps we should establish the convention that the static value overrides the calculated value unless the static is 0 or nil or something. Thoughts?
On the question of units of measurement, that's a good idea.
OpenMRS has a units field in the drug order table near the bottom right of the image: https://wiki.openmrs.org/download/attachments/589829/openmrs_data_model_1.9.0.png?version=3&modificationDate=1339463802000 taken from https://wiki.openmrs.org/display/docs/Data+Model
Off the top of my head, the only type of log entry for Pharmacy records I can think of is a stock change (either ordered or consumed a certain amount of some drug). This seems to imply the following model organization.
I'm open to name suggestions, since "DrugDelta" seems pretty terrible to me.
Drug would contain information relevant to each type of drug:
DrugDelta would keep track of changes: