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

OHRI-1857 restrict edit to latest mch visit #1772

Draft
wants to merge 14 commits into
base: dev
Choose a base branch
from

Conversation

pirupius
Copy link
Contributor

@pirupius pirupius commented Jan 18, 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 the ticket number in the format OHRI-123 My PR title.
  • My work includes tests or is validated by existing tests.

Summary

This feature should not allow users to go back and edit fields from a previous encounters. E.g if a pregnancy has a first ANC entered and a follow-up ANC encounter/visit added then user should not be able to edit the 1st ANC but editing for the latest follow up encounter/visit should still be possible.

Screenshots

Related Issue

https://ohri.atlassian.net/browse/OHRI-1857

Other

@@ -26,3 +27,22 @@ export function launchEncounterForm(
workspaceWindowSize,
);
}

export const findEncounterLatestDateIndex = (encounters: OpenmrsEncounter[]) => {
if (!encounters || !encounters.length) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You could use the inNull function from lodash

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