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

(feat) O3-3050: add support for rendering select-concept-answers #214

Merged

Conversation

usamaidrsk
Copy link
Collaborator

@usamaidrsk usamaidrsk commented Apr 24, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

This PR add implementation of the select-concept-answers rendering, that renders select options from the concept setMembers.

Test schema.

{
  "encounterType": "67a71486-1a54-468f-ac3e-7091a9a79584",
  "name": "Who stage test form 1",
  "processor": "EncounterFormProcessor",
  "referencedForms": [],
  "uuid": "7510e26a-d4ea-4ff5-b766-51a9730d5211",
  "version": "1.0",
  "pages": [
    {
      "label": "First Page",
      "sections": [
        {
          "label": "A Section",
          "isExpanded": "true",
          "questions": [
            {
              "label": "Select criteria for new WHO stage:",
              "type": "obs",
              "questionOptions": {
                "concept": "250e87b6-beb7-44a1-93a1-d3dd74d7e372",
                "rendering": "select-concept-answers"
              },
              "required": {
                "type": "conditionalRequired",
                "message": "Patient marked as receiving new WHO stage. Please select stage.",
                "referenceQuestionId": "adultWhoStage",
                "referenceQuestionAnswers": [
                  "a89b2606-1350-11df-a1f1-0026b9348838, a89b26d8-1350-11df-a1f1-0026b9348838, a89b27be-1350-11df-a1f1-0026b9348838, a89b289a-1350-11df-a1f1-0026b9348838"
                ]
              },
              "validators": [],
              "id": "__sq5ELJr7p"
            }
          ]
        }
      ]
    }
  ],
  "description": "test form"
}

Screenshots

image
image

Related Issue

O3-3050

Other

@usamaidrsk usamaidrsk marked this pull request as draft April 24, 2024 12:26
@usamaidrsk usamaidrsk marked this pull request as ready for review April 24, 2024 15:08
@gracepotma
Copy link
Contributor

Keep up the work Usama :D Left some very minor non-technical comments.

@samuelmale
Copy link
Member

@usamaidrsk did you see the conflicts?

Copy link
Member

@samuelmale samuelmale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@usamaidrsk Can we have the build fixed?

src/components/inputs/select/dropdown.component.tsx Outdated Show resolved Hide resolved
src/registry/inbuilt-components/template-component-map.ts Outdated Show resolved Hide resolved
@usamaidrsk usamaidrsk requested a review from samuelmale May 7, 2024 18:01
@usamaidrsk usamaidrsk force-pushed the ft-select-concept-answers-rendering branch from afbd336 to a9ba6c5 Compare May 7, 2024 18:43
Copy link
Member

@samuelmale samuelmale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@samuelmale samuelmale merged commit ab88063 into openmrs:main May 8, 2024
4 checks passed
vasharma05 pushed a commit that referenced this pull request May 27, 2024
* feat: add support for rendering select-concept-answers

* refactor: use concet-set-member-ds

* chore: add unit tests

* chore: rebase branch to main

* fix: fix failed build

* refactor: user ui-select-ext input

* refactor: fix formating prettier

* Fine-tune datasource config during schema preprocessing

---------

Co-authored-by: samuelmale <samuelsmalek@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants