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-3007: Add support for saving patient identifiers in forms #202

Merged
merged 4 commits into from
Apr 25, 2024

Conversation

kajambiya
Copy link
Collaborator

@kajambiya kajambiya commented Apr 23, 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 introduces support to save patient identifier as part of a form. At form submission, the identifier is added to the patient's identifiers.

Screenshots

Screen.Recording.2024-04-24.at.17.19.08.mov

Related Issue

Other

@samuelmale samuelmale changed the title O3-3007 Add support for saving patient identifiers in forms (feat) O3-3007: Add support for saving patient identifiers in forms Apr 23, 2024
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.

I've noticed you have a couple of formatting issues, kindly have those fixed.

src/api/api.ts Outdated Show resolved Hide resolved
src/components/encounter/ohri-encounter-form.component.tsx Outdated Show resolved Hide resolved
src/components/encounter/ohri-encounter-form.component.tsx Outdated Show resolved Hide resolved
src/components/encounter/ohri-encounter-form.component.tsx Outdated Show resolved Hide resolved
src/components/encounter/ohri-encounter-form.component.tsx Outdated Show resolved Hide resolved
src/components/encounter/ohri-encounter-form.component.tsx Outdated Show resolved Hide resolved
src/utils/patientIdentifierProcessor.ts Outdated Show resolved Hide resolved
src/utils/patientIdentifierProcessor.ts Outdated Show resolved Hide resolved
src/registry/registry.ts Outdated Show resolved Hide resolved
@kajambiya
Copy link
Collaborator Author

I've noticed you have a couple of formatting issues, kindly have those fixed.

Hi @samuelmale
I've addressed the comments. Kindly review again and revert.

@kajambiya kajambiya force-pushed the petienrIfentifier branch 2 times, most recently from 3b6db1b to b860f08 Compare April 24, 2024 15:48
@denniskigen
Copy link
Member

denniskigen commented Apr 25, 2024

@kajambiya You can test the validation aspect using this question from the AMPATH HTS Initial Form.

@denniskigen
Copy link
Member

So, as mentioned in the demos earlier today, the two expectations would be that:

  • You should see success notifications after submitting the form that shows which identifiers were created.
  • You should be able to see validation in the input based on any logic provided to failsWhenExpression (when available). See this question for reference.

@kajambiya kajambiya force-pushed the petienrIfentifier branch 2 times, most recently from b482677 to b9cd626 Compare April 25, 2024 10:18
@kajambiya
Copy link
Collaborator Author

So, as mentioned in the demos earlier today, the two expectations would be that:

  • You should see success notifications after submitting the form that shows which identifiers were created.
  • You should be able to see validation in the input based on any logic provided to failsWhenExpression (when available). See this question for reference.

Hi @denniskigen
So the failsWhenExpression validator works fine, however we don't have the doesNotMatchExpression expression helper. I've decided to create a different ticket for here since its not specific to patientIdentifier

@kajambiya kajambiya reopened this Apr 25, 2024
@pirupius
Copy link
Member

@kajambiya please add some sample json on how someone can use this. It will help in the documentation

Copy link
Member

@pirupius pirupius left a comment

Choose a reason for hiding this comment

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

Would be nice to backfill this with tests as well

@pirupius pirupius merged commit 7c35750 into openmrs:main Apr 25, 2024
4 checks passed
arodidev pushed a commit to arodidev/openmrs-form-engine-lib that referenced this pull request Apr 29, 2024
…penmrs#202)

* Add support for saving patient identifiers in forms

* Address review comments

* resolve conflicts

* fix failing tests
samuelmale added a commit that referenced this pull request May 1, 2024
* resolving logic

* Failsafe incase display object doesn't exist

* Failsafe incase display object doesn't exist

* linting

* (feat) O3-3007: Add support for saving patient identifiers in forms (#202)

* Add support for saving patient identifiers in forms

* Address review comments

* resolve conflicts

* fix failing tests

* (feat) O3-3109 deprecate type within inbuiltControls (#229)

* (test) Fix intermittently failing tests (#231)

* (feat) Update AFE transformer to handle aliases (#221)

* (chore) Switch @carbon/react to peer dependency (#236)

* (fix) fix tooltip alignment on obsGroup (#235)

* fix tooltip styles on obsGroup

* cleanup

* (feat) Fetch all concept references of the the form with SWR Infinite (#241)

* Fetching all concepts references with useSWRInfinite

* Fixed failing tests

* Failsafe incase display object doesn't exist

* linting

---------

Co-authored-by: Jovan Ssebaggala <jssebaggala@outlook.com>
Co-authored-by: Pius Rubangakene <piruville@gmail.com>
Co-authored-by: Samuel Male <samuelsmalek@gmail.com>
Co-authored-by: Vineet Sharma <sharmava05@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.

None yet

4 participants