Wiki Spaces
Documentation
Projects
Resources
Get Help from Others
Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack
Value groups (multiple values for a single observation) have a place in our data model, but the openmrs API (as of 1.10 at least) does not yet support multiple values for an observation; rather, there is a valueGroupId
property on observations that can be used to manually link separate observations that represent multiple answers to the same question.
Value Groups are similar to obs groups. The goal of value groups is to answer a single question with multiple answers. Only the answers together make the true answer to the question. At the database level, all obs are represented by a row in the obs table. The value_group_id
column is used to link multiple answers to the same question that belong together . If the obs is not in a value group, value_group_id
is null
. All obs that represent a group of multiple values that belong together will have the same value_group_id
, generally the obs_id
of the first value in the group. By definition, values may only be grouped across observations for the same exact question within the same exact encounter (linking values across different questions and/or across encounters is not valid and not supported).
(please add more examples here)
Grouping values: Concept question is concept id X-RAY, CHEST, RADIOLOGY FINDINGS (2395)
Answers: PULMONARY INFILTRATE (2397), LUNG INFLATION (7912), CAVITARY LESION (6052), INTERSTITIAL LUNG PROCESS(2400), PARENCHYMAL SCARRING/ATELECTASIS (2401), PULMONARY NODULES (2404), RIGHT (5141), LEFT (5139), ..., etc. Please see concept_example_for_value_group.png.
When entering the coded answer of LEFT CAVITARY LESION for question of X-RAY, CHEST, RADIOLOGY FINDINGS, the obs table will look like this:
obs_id |
concept_id |
value_group_id |
value_coded |
---|---|---|---|
1 |
2395 |
null |
null |
2 |
2395 |
1 |
5139 |
3 |
2395 |
1 |
6052 |
In order to get the complete answer, users need to link multiple answers to the same question. The order of linking multiple answers is important as well. For example, it would make more sense to know it should be "LEFT CAVITARY LESION" instead of "CAVITARY LESION LEFT".
(does not exist yet)
For answers which use value group, it's challenging to map their concepts to meaningful coding terminologies since the complete answers are broken down into more than one concept.
For information about when to use obs groups and when to use value groups, please see this wiki page.