Hello everyone,
we have an issue with multiple obs groups nested in multiple obsgroups nested in repeat tag.
We have something like that:
<repeat>
<template>
<div id="{n}-outerDiv">
<obsgroup id="{n}-outerObsGroup" groupingConceptId="XXX">
<div id="{n}-sectionA">
<obs conceptId="ABC" />
<obs conceptId="DEF" />
</div>
<div id="{n}-sectionB">
<div id="innerDiv-1">
<obsgroup id="innerObsGroup-1" groupingConceptId="YYY">
<obs conceptId="GHI" />
<obs conceptId="JKL" />
<obs conceptId="MNO" />
</obsgroup>
</div>
<div id="innerDiv-2">
<obsgroup id="innerObsGroup-2" groupingConceptId="YYY">
<obs conceptId="GHI" />
<obs conceptId="JKL" />
<obs conceptId="MNO" />
</obsgroup>
</div>
<div id="innerDiv-3">
<obsgroup id="innerObsGroup-3" groupingConceptId="YYY">
<obs conceptId="GHI" />
<obs conceptId="JKL" />
<obs conceptId="MNO" />
</obsgroup>
</div>
</div>
</obsgroup>
</div>
</template>
<render n="1" />
<render n="2" />
<render n="3" />
<render n="4" />
<render n="5" />
<render n="6" />
<render n="7" />
<render n="8" />
<render n="9" />
<render n="10" />
</repeat>
It renders 10 sections/divs which each of them contains together 11 obses (2 from ‘sectionA’, and 3x3 from ‘sectionB’).Each ‘package’ of three obses is grouped into obsgroup with groupingConceptId=“YYY” and all these three ‘packages’ + two concepts from sectionA (obs conceptId=“ABC” and obs conceptId=“DEF”) should be grouped into groupingConceptId=“XXX”.
The issue is that sometimes when saving the form in EDIT mode, inner obsgroup (with groupingConceptId=“YYY”) is not assigned to its parent (obsgroup is NULL) therefore obs with conceptIds “GHI”, “JKL”, “MNO” are not displayed on the UI at all. If I assign directly in database proper obsgroup id then ‘packages’ of three obs are displayed correctly.
And another issue is when we fill in for example three templates:
n = 1 → we fill in ABC, DEF and GHI from innerObsGroup-1
n = 2 → we fill in ABC, DEF and GHI from innerObsGroup-1
n = 3 → we fill in ABC, DEF and GHI from innerObsGroup-1
then ABC and DEF obses are assigned and displayed properly (each to own template), but all three “GHI” obses are displayed in the first template and in the second and third template GHI obs is blank (because all is assigned to the first template).
Does anyone know how to solve it or what are we doing wrong? Is this case supported by OpenMRS at all? When we have only one outer obsroup and inside this are multiple obsgroups that probably works fine, but in this case we have multiple outer obsgroups and inside each obsgroup there is multiple obsgroups children.
Thank you in advance for any comments.