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) Revitalized Immunization Support #1572

Merged
merged 11 commits into from
Jan 18, 2024

Conversation

samuelmale
Copy link
Member

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 pull request addresses and resolves issues related to the Immunization package, which was previously broken and non-functional.

Key Changes

  • Immunization Form Refactoring
  • Detailed Summary Widget Enhancement
  • Test coverage

Screenshots

Demo:

https://www.loom.com/share/ddcf5b602d5244fbbf86ba2739c9bb37?sid=f1294f54-d6ff-4ee5-a7c6-d473168752df

Related Issue

@samuelmale samuelmale closed this Jan 9, 2024
@samuelmale samuelmale reopened this Jan 9, 2024
@samuelmale samuelmale marked this pull request as draft January 9, 2024 21:21
@samuelmale samuelmale marked this pull request as ready for review January 10, 2024 00:48
jest.config.js Outdated Show resolved Hide resolved
Copy link
Member

@ibacher ibacher left a comment

Choose a reason for hiding this comment

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

Thanks @samuelmale! This mostly looks very good, but a few things should be adjusted.

@samuelmale samuelmale force-pushed the revamp/immunizations branch from 81f3ee8 to f09707a Compare January 10, 2024 22:24
@samuelmale
Copy link
Member Author

@ibacher @denniskigen updated

@denniskigen
Copy link
Member

Should None be listed as an option from the Immunization dropdown?

CleanShot 2024-01-15 at 3  36 30@2x

@denniskigen
Copy link
Member

Also, might it make for a better UX to disambiguate between create and edit mode when using the Immunizations form in the workspace? Here I'm editing an existing immunization, yet the workspace title is the same that you'd see when creating an immunization:

edit-mode-for-an-existing-vaccination.mp4

@denniskigen
Copy link
Member

denniskigen commented Jan 15, 2024

You might also need to consider removing this padding so that immunization content in the Datatable is left-aligned to the start of the column (and not indented as you see here):

CleanShot 2024-01-15 at 3  44 59@2x

@samuelmale
Copy link
Member Author

Should None be listed as an option from the Immunization dropdown?

@denniskigen That is an implementation detail; for the RefApp we may have to fix this in CIEL: https://app.openconceptlab.org/#/orgs/CIEL/sources/CIEL/concepts/984/

@samuelmale samuelmale force-pushed the revamp/immunizations branch from aed7af5 to 968a8b0 Compare January 17, 2024 14:17
@samuelmale
Copy link
Member Author

You might also need to consider removing this padding so that immunization content in the Datatable is left-aligned to the start of the column

I'm terrible at CSS; but hopefully, this passes the bar:

Screenshot 2024-01-17 at 17 10 55

Also, might it make for a better UX to disambiguate between create and edit mode when using the Immunizations form in the workspace? Here I'm editing an existing immunization, yet the workspace title is the same that you'd see when creating an immunization:

@denniskigen Do we have a standard way of going about this?

The form title is defined at workspace registration; Qn: Is it possible to change the workspace title during the workspace launch? If not do we want to register two workspaces?

@denniskigen
Copy link
Member

denniskigen commented Jan 17, 2024

You might also need to consider removing this padding so that immunization content in the Datatable is left-aligned to the start of the column

I'm terrible at CSS; but hopefully, this passes the bar:
Screenshot 2024-01-17 at 17 10 55

Also, might it make for a better UX to disambiguate between create and edit mode when using the Immunizations form in the workspace? Here I'm editing an existing immunization, yet the workspace title is the same that you'd see when creating an immunization:

@denniskigen Do we have a standard way of going about this?

The form title is defined at workspace registration; Qn: Is it possible to change the workspace title during the workspace launch? If not do we want to register two workspaces?

Yeah, that'd require more than one workspace registration, which is probably not what you want to do. Also, CSS is fine.

@ibacher
Copy link
Member

ibacher commented Jan 17, 2024

The form title is defined at workspace registration

The title is also overrideable in the call to launchPatientWorkspace() which is how we set the title to the form name when launching the form apps.

Speaking of which, we prefer to use registerWorkspace() rather than extensions for workspaces...

@samuelmale
Copy link
Member Author

samuelmale commented Jan 17, 2024

@ibacher I knew it was possible to override the workspace title (I've done it in the past); Revisiting the workspace API as a refresher I got confused whether it was still supported. I feel like the API isn't explicit enough on the support of overriding the title.

export function launchPatientWorkspace(name: string, additionalProps?: object) {
 // 
}

In the doc, it implies that additionalProps is an arbitrary object passed to the workspace component. Is it ideal to support this through an optional parameter?

@denniskigen
Copy link
Member

Separate from the form title discussion, I've taken the liberty to push a couple of commits on top of your work which fix various issues with styling, @samuelmale.

@ibacher
Copy link
Member

ibacher commented Jan 17, 2024

Well, that's because to the API at that point, additionalProps is a bit of a black box. The implementation that allows the workspace title override is the workspace component itself. The issue is that additionalProps is used to pass properties to just about anything in the workspace registration chain, and we don't necessarily know the types. I guess:

interface WorkspaceAdditionalProps {
  workspaceTitle: string;
  [p: string]: unknown;
}

Kind of works, but is annoying...

@denniskigen
Copy link
Member

denniskigen commented Jan 18, 2024

@samuelmale, have you been able to attempt Ian's suggestion? And, @ibacher, have all the changes you requested been addressed?

@ibacher ibacher merged commit 100ce91 into openmrs:main Jan 18, 2024
6 checks passed
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