Skip to content

Commit

Permalink
(fix ) Ensure a fixed value field is submitted when nested in obsGroup (
Browse files Browse the repository at this point in the history
#135)

* Ensuring  a fixed value is submitted to the backend whenn the obs is part of an obsgroup

* fixing indentation

* fixing indentation

* fixing indentation
  • Loading branch information
lucyjemutai authored Nov 1, 2023
1 parent 7d4be38 commit 5390d66
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/encounter/ohri-encounter-form.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ export const OHRIEncounterForm: React.FC<OHRIEncounterFormProps> = ({
flattenedFieldsTemp.push(question);
if (question.type == 'obsGroup') {
question.questions.forEach(groupedField => {
if (groupedField.questionOptions.rendering == 'fixed-value' && !groupedField['fixedValue']) {
groupedField['fixedValue'] = groupedField.value;
}
// set group id
groupedField['groupId'] = question.id;
flattenedFieldsTemp.push(groupedField);
Expand Down

0 comments on commit 5390d66

Please sign in to comment.