Thank you all for your inputs and for dedicating your time and offering valuable suggestions.
Let me provide some additional background information below; my apologies for not sharing many details in the initial post.
No, but it is indirectly related to this issue. The primary goal was to simplify the allergy form, as described in this ticket: O3-2614 and this epic: O3-2561. So, yes, we aimed to remove the groupings from the UI and display it on a single list. During my work on this, I observed that when we submit an allergy through the API, there’s a required field to submit the type of the allergen along with the allergen. For instance, if I submit an allergy for a patient for Fish, I need to explicitly add another property to the payload stating that Fish is a food allergen. Regardless of which property the client sends, it saves the allergen type as it is sent by the client. If the client sends the allergen type for “fish” as “drug,” it saves it as is; there’s no backend validation for this type, relying heavily on the client.
Even if we remove the categories from the allergy form UI and display it on a single list, it’s still feasible to fetch allergen categories somehow and send them along with the payload. However, my question remains: do we really need to store it in the first place if we don’t use it?
When I said we couldn’t find a utilization in the system, the only places I found are here, which seems no longer in use as the functionality has been moved to the core and rest api module. Additionally, I found it in the FHIR2 module where it translates the type to FHIR’s optional field AllergyIntolerance.category
. A full list of usage can be found here. If we check the source codes, all the usage is to store the allergen type but not to use it.
Apart from that yes, this don’t seems contributed to any rendering. This is how it displays in allergies tables.
On a side note, here’s how the table looks; as you can see, the allergen type is stored as a non-null varchar.
Checking the structure, the allergen type can vary for different allergy records. Correct me if I’m wrong, but as per my understanding, the type of the allergen is agnostic from the patient or allergy record. i.e., “fish” is a food allergen regardless of the patient. If I’m correct, the relationship between allergen and allergy type should be 1…1. The allergen type, to me, is a derived attribute that shouldn’t be stored in the allergy table.
However, this might be a result of an implementation due to limitations with dealing with concept codes.
It seems I have two options here:
- To keep it as it is and send the allergen type while creating an allergy.
- To make the field optional.
Let me know what you think.
I’m not sure I fully understand your question. But, it stores only the code in the table. When fetching from FHIR API it fetch the concepts improted previously from the following three:
- https://app.openconceptlab.org/#/orgs/CIEL/sources/CIEL/concepts/162552/
- https://app.openconceptlab.org/#/orgs/CIEL/sources/CIEL/concepts/162554/
- https://app.openconceptlab.org/#/orgs/CIEL/sources/CIEL/concepts/162553/
The stored allergen types are FOOD
, DRUG
, ENVIRONMENT
, and OTHER
.