Skip to content

Conversation

@amosmachora
Copy link
Contributor

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 improves the visit form to correctly handle starting visits for deceased patients. Currently, the functionality introduced here disables the new and ongoing options of the visit type switch. By default, all deceased patient visits will be past visits.

Screenshots

image

Related Issue

https://openmrs.atlassian.net/browse/O3-3364

Other

@amosmachora
Copy link
Contributor Author

Seemed a bit too simple, but it somehow works.

}

export function useVisitFormSchemaAndDefaultValues(visitToEdit: Visit) {
export function useVisitFormSchemaAndDefaultValues(visitToEdit: Visit, config: { isDeceased: boolean }) {
Copy link
Member

@denniskigen denniskigen Aug 11, 2025

Choose a reason for hiding this comment

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

Suggested change
export function useVisitFormSchemaAndDefaultValues(visitToEdit: Visit, config: { isDeceased: boolean }) {
export function useVisitFormSchemaAndDefaultValues(visitToEdit: Visit, options: { isDeceased: boolean }) {

I think it makes sense to name this something other than config to disambiguate it from the config object returned by useConfig (e.g., options).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"options" is a way better name for that. Will change it to that ASAP

@denniskigen denniskigen requested a review from ibacher August 12, 2025 10:21
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.

2 participants