openmrs / openmrs-esm-form-engine-lib

React Form Engine library for O3
Other
10 stars 59 forks source link

(feat) O3-3367: Add support for person attributes #329

Closed gitcliff closed 2 weeks ago

gitcliff commented 3 months ago

Requirements

Summary

This PR is adding support for capturing person attributes Here is a sample form schema for capturing person attributes of string attributeType

{
  "name": "New test form ",
  "pages": [
    {
      "label": "newPage ",
      "sections": [
        {
          "label": "New section",
          "isExpanded": "true",
          "questions": [
            {
              "label": "Person attribute (String)",
              "type": "personAttribute",
              "required": false,
              "id": "bloodTyping",
              "questionOptions": {
                "rendering": "text",
                "attributeType": "8d871d18-c2cc-11de-8d13-0010c6dffd0f"
              }
            }
          ]
        }
      ]
    }
  ],
  "processor": "EncounterFormProcessor",
  "encounterType": "dd528487-82a5-4082-9c72-ed246bd49591",
  "referencedForms": [],
  "uuid": "c0112926-506d-4a38-9ae3-10e7f9987028",
  "description": "Form that keeps HIV patient data",
  "version": "1.0"
}

Here is a sample form schema for capturing person attributes with attributeType of coded values

{
  "name": "New test form 2 ",
  "pages": [
    {
      "label": "newPage2 ",
      "sections": [
        {
          "label": "New section",
          "isExpanded": "true",
          "questions": [
            {
              "label": "Person attribute (location drop down)",
              "type": "personAttribute",
              "required": false,
              "id": "bloodTyping",
              "questionOptions": {
                "rendering": "ui-select-extended",
                "attributeType": "8d87236c-c2cc-11de-8d13-0010c6dffd0f",
                "datasource": {
                  "name": "person_attribute_location_datasource"
                }
              },
              "validators": []
            }
          ]
        }
      ]
    }
  ],
  "processor": "EncounterFormProcessor",
  "encounterType": "dd528487-82a5-4082-9c72-ed246bd49591",
  "referencedForms": [],
  "uuid": "e3452e71-16a7-42f1-bb5f-161492c153f8",
  "description": "Form that keeps HIV patient data",
  "version": "1.0"
}

Screenshots

https://www.loom.com/share/c3cfa5abd10b4526aabd4017a9bee0fc

Related Issue

https://openmrs.atlassian.net/browse/O3-3367

Other

samuelmale commented 3 months ago

@gitcliff are you still working on this?

gitcliff commented 3 months ago

@gitcliff are still working on this?

yes @samuelmale.. thanks

brandones commented 2 months ago

@gitcliff Are you addressing @NethmiRodrigo 's feedback?

brandones commented 1 month ago

@gitcliff Please fix the conflicts. And please post a comment when this is ready for review, or click the "Re-request Review" button next to Nethmi's name if that button is available to you:

image

gitcliff commented 1 month ago

@gitcliff Please fix the conflicts. And please post a comment when this is ready for review, or click the "Re-request Review" button next to Nethmi's name if that button is available to you:

image

yes sure ,,, thanks @brandones

brandones commented 4 weeks ago

Ping @gitcliff , what's the status?

samuelmale commented 2 weeks ago

Closing this for now. @gitcliff feel free to resume working on this when you get the suspense.