diff --git a/src/dataEntryApp/components/QuestionGroupFormElement.js b/src/dataEntryApp/components/QuestionGroupFormElement.js index 9ff35d172..45107551b 100644 --- a/src/dataEntryApp/components/QuestionGroupFormElement.js +++ b/src/dataEntryApp/components/QuestionGroupFormElement.js @@ -72,7 +72,7 @@ export default function QuestionGroupFormElement({ concept={childFormElement.concept} obsHolder={obsHolder} value={value} - validationResults={validationResults.filter(itr => itr.questionGroupIndex === questionGroupIndex)} + validationResults={validationResults} uuid={childFormElement.uuid} update={newValue => { updateObs(formElement, newValue, childFormElement, questionGroupIndex); diff --git a/src/dataEntryApp/components/RepeatableQuestionGroupElement.js b/src/dataEntryApp/components/RepeatableQuestionGroupElement.js index 205f9a54d..32923154d 100644 --- a/src/dataEntryApp/components/RepeatableQuestionGroupElement.js +++ b/src/dataEntryApp/components/RepeatableQuestionGroupElement.js @@ -31,8 +31,11 @@ export function RepeatableQuestionGroupElement({ if (hasNoObservation) repeatableQuestionGroup = new RepeatableQuestionGroup(); const repeatableQuestionGroupValue = repeatableQuestionGroup.getValue(); const hasMultipleElements = repeatableQuestionGroupValue.length > 1; + const oneOfTheQuestionGroupObservationsIsEmpty = _.some(repeatableQuestionGroupValue, x => _.isEmpty(x.groupObservations)); return repeatableQuestionGroupValue.map((x, index) => { - const isLastElement = !hasNoObservation && repeatableQuestionGroupValue.length === index + 1; + const isLastElement = + !hasNoObservation && !oneOfTheQuestionGroupObservationsIsEmpty && repeatableQuestionGroupValue.length === index + 1; + const quesGrpValidationResults = validationResults.filter(itr => itr.questionGroupIndex === index); return (