Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Horizontal layout support for radio buttons in the datacapture library #542

Closed
shoaibmushtaq25 opened this issue Jun 8, 2021 · 10 comments · Fixed by #586
Closed

Horizontal layout support for radio buttons in the datacapture library #542

shoaibmushtaq25 opened this issue Jun 8, 2021 · 10 comments · Fixed by #586
Assignees
Labels
type:enhancement New feature or request

Comments

@shoaibmushtaq25
Copy link
Contributor

shoaibmushtaq25 commented Jun 8, 2021

Radio group/buttons horizontal layout is not supported in the datacapture library
I added a patient gender as horizontal radio group with the choiceOrientation as horizontal in Patient questionnaire on implementer app but I found out the horizontal layout is not supported yet in datacapture library

{
  "linkId": "1.0",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",
      "valueCodeableConcept": {
        "coding": [
          {
            "system": "http://hl7.org/fhir/questionnaire-item-control",
            "code": "radio-button",
            "display": "Radio Button"
          }
        ]
      }
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/questionnaire-choiceOrientation",
      "valueCode": "horizontal"
    }
  ],
  "definition": "http://hl7.org/fhir/StructureDefinition/Patient#Patient.gender",
  "type": "choice",
  "text": "Gender:",
  "answerOption": [
    {
      "valueCoding": {
        "code": "F",
        "display": "Female"
      }
    },
    {
      "valueCoding": {
        "code": "M",
        "display": "Male"
      }
    }
  ]
}

Solution
We need to implement http://hl7.org/fhir/R4/extension-questionnaire-choiceorientation.html for radio-buttons

Alternatives
For now, I have made radio group as default vertical layout on implementer app

Screenshot
Expected result:
Screenshot from 2021-06-08 13-44-21

Actual result:
Screenshot from 2021-06-07 18-17-24

Would you like to work on the issue?
I am open to work on it or anyone else can pick it up

cc: @jingtang10 @ekigamba

@shoaibmushtaq25 shoaibmushtaq25 added the type:enhancement New feature or request label Jun 8, 2021
@FikriMilano
Copy link
Collaborator

@shoaibmushtaq25 may I?

@shoaibmushtaq25
Copy link
Contributor Author

@shoaibmushtaq25 may I?

@FikriMilano Yeah sure, you can pick it up. Thanks for it. 👍

@shoaibmushtaq25
Copy link
Contributor Author

@FikriMilano One thing I am also thinking about it that this may apply to all choice type questions (radio buttons, check boxes). You can have a chat with @jingtang10 on this if we need to re-phrase the issue title or its scope.

@jingtang10
Copy link
Collaborator

Use the choice orientation extension:

http://hl7.org/fhir/uv/sdc/2019May/rendering.html#control-appearance

@ekigamba ekigamba changed the title Horizontal layout support for radio buttons in SDC Horizontal layout support for radio buttons in datacapture Jun 8, 2021
@ekigamba
Copy link
Contributor

ekigamba commented Jun 8, 2021

@jingtang10 Correct, I have updated the issue with the correct details. Are you OK with this? Should this be implemented to all choice type questions

@ekigamba ekigamba changed the title Horizontal layout support for radio buttons in datacapture Horizontal layout support for radio buttons in the datacapture library Jun 8, 2021
@FikriMilano
Copy link
Collaborator

Use the choice orientation extension:

http://hl7.org/fhir/uv/sdc/2019May/rendering.html#control-appearance

Ok, I will use this

@FikriMilano
Copy link
Collaborator

@jingtang10 Correct, I have updated the issue with the correct details. Are you OK with this? Should this be implemented to all choice type questions

I think we might as well implement this for all choice type questions. I'm open for further suggestions though. @ekigamba @jingtang10 @shoaibmushtaq25

@FikriMilano
Copy link
Collaborator

As mentioned here,

URL = http://hl7.org/fhir/StructureDefinition/questionnaire-choiceOrientation
choiceOrientation: Identifies the desired orientation when rendering a list of choices (typically radio-box or check-box lists).

Therefore, I plan to add horizontal layout support for radio-button and check-box.

@jingtang10
Copy link
Collaborator

As mentioned here,

URL = http://hl7.org/fhir/StructureDefinition/questionnaire-choiceOrientation
choiceOrientation: Identifies the desired orientation when rendering a list of choices (typically radio-box or check-box lists).

Therefore, I plan to add horizontal layout support for radio-button and check-box.

yeah that's fine. thanks for taking this up.

@FikriMilano
Copy link
Collaborator

cc @f-odhiambo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants