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-2163: Add support for editing end visit data/time on current visits #1712

Conversation

usamaidrsk
Copy link
Member

@usamaidrsk usamaidrsk commented Mar 4, 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 provisions the adding of end date to current visits

Screenshots

add-end-visit-field-on-edit-visit-.mp4

Related Issue

O3-2163

Other

@usamaidrsk usamaidrsk marked this pull request as draft March 4, 2024 19:41
@usamaidrsk usamaidrsk marked this pull request as ready for review March 5, 2024 13:38
Copy link
Contributor

@brandones brandones left a comment

Choose a reason for hiding this comment

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

Thanks for this, @usamaidrsk . Can you confirm that the start visit validator on lines 151-154 make sense? I don't really understand why if there is an existing visit then it's fine if the start date is in the future.

        (value) => {
          const today = dayjs();
          const startDate = dayjs(value);
          return displayVisitStopDateTimeFields ? true : startDate.isSameOrBefore(today, 'day');
        },

Please add unit tests for the end date behavior. The logic of how we decide to show these fields or not is a little funny, so it would be very good to make the intention explicit in tests.

@denniskigen
Copy link
Member

@vasharma05 @usamaidrsk could you guys sync up to figure out how to move this forward?

@brandones
Copy link
Contributor

Ping @usamaidrsk @vasharma05

@brandones
Copy link
Contributor

Ping @usamaidrsk

@usamaidrsk usamaidrsk force-pushed the ft-show-dat-time-field-on-editing-active-visit branch from 1991130 to a3631a1 Compare October 16, 2024 14:39
Copy link
Contributor

@brandones brandones left a comment

Choose a reason for hiding this comment

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

Looks like we have a failing E2E test, and it is being caused by this work. Please fix the E2E test.

@usamaidrsk usamaidrsk force-pushed the ft-show-dat-time-field-on-editing-active-visit branch from f030f2c to 5d5ac23 Compare October 22, 2024 23:28
@usamaidrsk usamaidrsk requested a review from brandones October 22, 2024 23:34
? z
.string()
.refine((value) => value.match(time12HourFormatRegex), t('invalidTimeFormat', 'Invalid time format'))
: z.string().optional(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this optional one also have the refine clause?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, it should have one. Thanks for the catch

@usamaidrsk usamaidrsk force-pushed the ft-show-dat-time-field-on-editing-active-visit branch from 93c6325 to 7106630 Compare November 4, 2024 10:19
@usamaidrsk usamaidrsk requested a review from brandones November 4, 2024 10:20
@brandones brandones merged commit d17d51d into openmrs:main Nov 4, 2024
6 checks passed
senthil-athiban pushed a commit to senthil-athiban/openmrs-esm-patient-chart that referenced this pull request Nov 19, 2024
@denniskigen denniskigen mentioned this pull request Dec 17, 2024
3 tasks
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