Condition entity naming, plural or singular?

Tags: #<Tag:0x00007f8282bc5f50> #<Tag:0x00007f8282bc5e88>

Hi all,

Whilst we (so, @luis.oliveira) are working on extending HFE support for recording conditions (HTML-745, HTML-746, HTML-747), I’m left wondering about a couple naming choices around the Condition entity…

(Q1) Why is the table named conditions (plural)?
This is at odd with other table names: allergy, concept, drug, order, … but then: conditions.

(Q2) Should it be additional detail or additional details?
Obviously the former implies that this field is intended to record one additional detail, was that the intent?

I wonder if anyone can recollect why the above happened, and whether we should bother ourselves with normalizing the situation. I think we should, but this is typically the kind of stuff that takes a lot more work than what most people/groups are willing to put in for a very small return.

Cc @burke @dkayiwa @jteich @mseaton

FYI your responses will matter because of this: https://github.com/openmrs/openmrs-module-htmlformentry/pull/197#pullrequestreview-501288920

Re: Q1, the hbm.xml file from emrapi says that the plural was used because “condition” is a MySQL reserved word (it’s used in MySQL’s error handling). That’s probably a good enough reason for the deviation from standard.

1 Like

Thanks @ibacher, yes indeed.

Hi Dimitri,

(Q1) I agree that consistency would dictate using singular or plural for all of these. Given that it’s a table, I’d actually have expected to see “allergies”, “orders”, “conditions”, etc., since the table is about the entire collection of each of these items. Certainly, in the UI such a table would have “Conditions”, “Allergies”, etc., as its title.

One extra consideration for “Condition” is that it has an extra, more common meaning if it’s singular, and that is the patient’s current overall condition – usually an enum of Stable, Good, Fair, Poor, Critical. Every admission order set starts with declaration of “Condition”. Here’s a legitimate conversation: “What is the patient’s condition?” “He’s in critical condition.” “Okay, and what are the patient’s active conditions?” “Kidney failure, pneumonia, …” – So, there is some possibility of misuse if you use the singular term.

That, and also what @ibacher just wrote above while I was writing this.

(Q2) I think of “detail” in this sense as not one detail, but a collective noun, as in “Give me some more detail.” However, “details” would be a bit less ambiguous, especially considering what I just said above.

1 Like

Thanks @jteich for the detailed answer as always, that’s really helpful.

I’ll let others weigh in but as it seems, we should stick to additional detail then :+1:

1 Like

In the data model, our convention is lowercase, underscores, and singular form for table names except when it’s a reserved word in SQL (e.g., the case for orders, conditions, users).

1 Like