diff --git a/pwa/src/components/DiagnosisFields.json b/pwa/src/components/DiagnosisFields.json index 67c6e59..4934d85 100644 --- a/pwa/src/components/DiagnosisFields.json +++ b/pwa/src/components/DiagnosisFields.json @@ -101,11 +101,31 @@ { "name": "Otitis", "id": "otitis", + "radio-buttons": { + "radio-buttons-title": "", + "radio-buttons": [ + { "name": "Right", "id": "right" }, + { "name": "Left", "id": "left" }, + { "name": "Both", "id": "both" } + ] + } + }, + { + "name": "Pneumonia", + "id": "pneumonia", + "radio-buttons": { + "radio-buttons-title": "", + "radio-buttons": [ + { "name": "Right", "id": "right" }, + { "name": "Left", "id": "left" }, + { "name": "Both", "id": "both" } + ] + } + }, + { + "name": "Sinusitis", + "id": "sinusitis", "group-title": "", - "group": [ - { "name": "Pneumonia", "id": "pneumonia" }, - { "name": "Sinusitis", "id": "sinusitis" } - ], "radio-buttons": { "radio-buttons-title": "", "radio-buttons": [ diff --git a/pwa/src/components/DiagnosisForm.tsx b/pwa/src/components/DiagnosisForm.tsx index f86fab5..9361d72 100644 --- a/pwa/src/components/DiagnosisForm.tsx +++ b/pwa/src/components/DiagnosisForm.tsx @@ -1,9 +1,10 @@ import React, { ReactElement, useState } from 'react' -import { List, Checkbox, TextareaItem, WhiteSpace } from 'antd-mobile' +import { List, Checkbox, TextareaItem, WhiteSpace, Radio } from 'antd-mobile' import '../scss/DiagnosisForm.scss' import * as data from './DiagnosisFields.json' const CheckboxItem = Checkbox.CheckboxItem +const RadioItem = Radio.RadioItem /* @@ -47,11 +48,7 @@ export default function DiagnosisForm(): ReactElement { if (field['text-input-title'] != null) { formElements.push( field['text-input-title']}> - + , ) } @@ -80,8 +77,24 @@ export default function DiagnosisForm(): ReactElement { formElements.push() } - // TODO - Radio + // TODO: radio buttons displayed this way are indented badly if (field['radio-buttons'] != null) { + { + field['radio-buttons']['radio-buttons'].map((i) => + formElements.push( + setSex(i.value)} + > + {i.name} + , + ), + ) + } } return <> {formElements}