Skip to content

Commit

Permalink
rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pirupius committed Apr 24, 2024
1 parent d8b8f74 commit c053147
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 799 deletions.
15 changes: 14 additions & 1 deletion src/components/encounter/encounter-form.component.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Dispatch, SetStateAction, useCallback, useEffect, useMemo, useState } from 'react';
import { SessionLocation, showToast, useLayoutType, Visit } from '@openmrs/esm-framework';
import { ConceptFalse, ConceptTrue } from '../../constants';
import { codedTypes, ConceptFalse, ConceptTrue } from '../../constants';
import {
FormField,
FormPage as FormPageProps,
Expand Down Expand Up @@ -263,6 +263,19 @@ export const EncounterForm: React.FC<EncounterFormProps> = ({
const matchingConcept = findConceptByReference(field.questionOptions.concept, concepts);
field.questionOptions.concept = matchingConcept ? matchingConcept.uuid : field.questionOptions.concept;
field.label = field.label ? field.label : matchingConcept?.display;
if (
codedTypes.includes(field.questionOptions.rendering) &&
!field.questionOptions.answers?.length &&
matchingConcept?.conceptClass?.display === 'Question' &&
matchingConcept?.answers?.length
) {
field.questionOptions.answers = matchingConcept.answers.map((answer) => {
return {
concept: answer?.uuid,
label: answer?.display,
};
});
}
field.meta = {
concept: matchingConcept,
};
Expand Down
Loading

0 comments on commit c053147

Please sign in to comment.