diff --git a/src/components/repeat/repeat.component.tsx b/src/components/repeat/repeat.component.tsx index fb416dce3..4992f79b2 100644 --- a/src/components/repeat/repeat.component.tsx +++ b/src/components/repeat/repeat.component.tsx @@ -17,6 +17,7 @@ import { ExternalFunctionContext } from '../../external-function-context'; const renderingByTypeMap: Record = { obsGroup: 'group', testOrder: 'select', + diagnosis: 'ui-select-extended', }; const Repeat: React.FC = ({ question, onChange, handler }) => { diff --git a/src/transformers/angular-fe-schema-transformer.ts b/src/transformers/angular-fe-schema-transformer.ts index 67091acb8..58ce2b037 100644 --- a/src/transformers/angular-fe-schema-transformer.ts +++ b/src/transformers/angular-fe-schema-transformer.ts @@ -28,6 +28,9 @@ function handleQuestion(question: FormField, form: FormSchema) { : { hasProgramFields: true }; form.meta = formMeta; } + if (question.type === 'diagnosis') { + handleDiagnosesDataSource(question); + } try { transformByType(question); transformByRendering(question); @@ -177,3 +180,12 @@ function handleQuestionsWithObsComments(sectionQuestions: Array): Arr return augmentedQuestions; } + +function handleDiagnosesDataSource(question: FormField) { + if ('dataSource' in question.questionOptions && question.questionOptions['dataSource'] === 'diagnoses') { + question.questionOptions.datasource = { + name: 'problem_datasource', + }; + delete question.questionOptions['dataSource']; + } +}