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

O3-3006 (feat) Introduce Encounter Provider Control #174

Merged
merged 7 commits into from
Apr 8, 2024

Conversation

kajambiya
Copy link
Collaborator

@kajambiya kajambiya commented Mar 12, 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 the Encounter Provider control.
When submitting an encounter, RFE by default picks the provider from the session(logged in user) however there are scenario where the provider is passed as part of the encounter. In this case, the default provider needs to be overridden.

The PR also introduces logic to load default values for encounter-provider, encounter-location and encounter-datetime

Screenshots

Screen.Recording.2024-03-12.at.09.19.59.mov
Screen.Recording.2024-04-02.at.21.32.48.mov

Related Issue

Other

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.

Happy to see this taking shape, just a few early comments

src/components/section/helpers.ts Outdated Show resolved Hide resolved
src/api/api.ts Outdated Show resolved Hide resolved
@denniskigen
Copy link
Member

Very timely, thanks!

@kajambiya kajambiya marked this pull request as ready for review March 14, 2024 05:19
src/api/types.ts Outdated Show resolved Hide resolved
src/components/section/helpers.ts Outdated Show resolved Hide resolved
src/components/section/ohri-form-section.component.tsx Outdated Show resolved Hide resolved
src/datasources/provider-datasource.ts Outdated Show resolved Hide resolved
src/components/section/helpers.ts Outdated Show resolved Hide resolved
src/datasources/provider-datasource.ts Outdated Show resolved Hide resolved
src/hooks/useFormJson.tsx Outdated Show resolved Hide resolved
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'm starting to believe that we need to rethink the forms registry implementation. We could consider powering the registry with an IoC container like inversify. Otherwise thanks for the great work @kajambiya, below are my final comments.

src/registry/registry.ts Outdated Show resolved Hide resolved
src/api/types.ts Outdated Show resolved Hide resolved
src/datasources/provider-datasource.ts Outdated Show resolved Hide resolved
src/registry/inbuilt-components/inbuiltTransformers.ts Outdated Show resolved Hide resolved
src/transformers/AFETransformer.ts Outdated Show resolved Hide resolved
src/transformers/form-schema-transformer.ts Outdated Show resolved Hide resolved
@kajambiya kajambiya changed the title (feat) Introduce Encounter Provider Control O3-3006 (feat) Introduce Encounter Provider Control Mar 28, 2024
@kajambiya
Copy link
Collaborator Author

I'm starting to believe that we need to rethink the forms registry implementation. We could consider powering the registry with an IoC container like inversify. Otherwise thanks for the great work @kajambiya, below are my final comments.

Hi @samuelmale
I've addressed the issues save for the change requested on the getRegisteredFieldSubmissionHandler function for which I need more clarity. I've also included the logic for loading default values for encounterProvider, encounterLocation & encounterDatetime. Please review and revert.

src/api/types.ts Outdated Show resolved Hide resolved
…ter location and encounter datetime. Perform code clean ups
src/registry/registry.ts Outdated Show resolved Hide resolved
src/registry/registry.ts Outdated Show resolved Hide resolved
src/registry/registry.ts Outdated Show resolved Hide resolved
src/registry/registry.ts Outdated Show resolved Hide resolved
@samuelmale samuelmale merged commit ed5dab2 into openmrs:main Apr 8, 2024
5 checks passed
@eudson
Copy link
Contributor

eudson commented Apr 8, 2024

Thank you @samuelmale for you valuable comments on this PR and @kajambiya for your hard work and persistence

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.

5 participants