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

Add an option to hide the jurisdiction fields from cases and use default values [5] #12550

Closed
8 tasks done
MateStrysewske opened this issue Sep 20, 2023 · 3 comments · Fixed by #12618
Closed
8 tasks done
Assignees
Labels
android-app Affects the Android app backend Affects the web backend cases feature A new feature to be developed (ticket type) lu Adaptations requested by or implemented for Luxembourg qa-verified Issue has been tested and verified by QA ready Issue fulfills the definition of ready and can be implemented vaadin-app Affects the Vaadin application

Comments

@MateStrysewske
Copy link
Contributor

MateStrysewske commented Sep 20, 2023

Feature Description

For epidemiological surveillance right now, Luxembourg does not divide the country into several jurisdictions like e.g. Nigeria or Germany do. Because of that, the case jurisdiction fields are redundant and actually would be more of a hassle to be used by the users there. Therefore, a feature configuration is to be added to the system that hides the jurisdiction fields from cases (and other entities that are directly connected to cases and that aren't a separate feature) and automatically fills them with a default option.

Please note that it's not necessary to implement most of this in the mobile app, except for adding the new field to the infrastructure entities and the database for consistency reasons.

Added Value/Benefit

Users in countries that don't divide the country/area in which SORMAS is used into several jurisdictions won't have to bother with the jurisdiction fields, easing and speeding up their workflow.

Acceptance Criteria

  • A feature type property HIDE_JURISDICTION_FIELDS has been added to the CASE_SURVEILANCE feature, disabled by default
  • The InfrastructureAdo and InfrastructureDto classes, and all infrastructure tables in the database have been extended with a boolean default field, false by default; this also needs to be applied to the mobile app
  • All infrastructure create/edit forms in the UI have been extended with a checkbox for the new field (caption: "Default jurisdiction"); only show this field when the new feature type property is enabled
  • Upon saving an infrastructure with the checkbox checked, there's a backend validation that ensures that there is not already another default jurisdiction of the same type in the database; if there is, a ValidationRuntimeException with the text "There already is another default {entity name} in the database. Only one default {entity name} is allowed." is thrown
  • Add a private DTO defaultInfrastructure field to AbstractInfrastructureFacadeEjb, and a method called getDefaultInfrastructure that checks whether the field is already filled; if yes, return its value, otherwise query the database for the first entry of the ADO type with default == true; make sure that this method doesn't fail if there are no or multiple default entries; basically, this field should work like a cache so that we only have to query for default jurisdictions once and not every time a user requests those
  • If the new feature property is enabled:
    • In the case creation and edit forms, hide all jurisdiction fields (and related fields, e.g. the "Place of stay differs from responsible jursidiction" checkbox) up to facility and automatically fill the region, district, and community fields with the respective default options by using the new getDefaultInfrastructure method; health facility fields will remain visible
    • In the location form, hide the region, district, and community fields and automatically fill them with the respective default options

Implementation Details

No response

Mockups

No response

Additional Information

No response

@MateStrysewske MateStrysewske added android-app Affects the Android app cases backend Affects the web backend vaadin-app Affects the Vaadin application feature A new feature to be developed (ticket type) lu Adaptations requested by or implemented for Luxembourg labels Sep 20, 2023
@MateStrysewske MateStrysewske self-assigned this Sep 20, 2023
@MateStrysewske MateStrysewske added the ready Issue fulfills the definition of ready and can be implemented label Sep 25, 2023
@MateStrysewske MateStrysewske removed their assignment Sep 27, 2023
@markusmann-vg markusmann-vg changed the title Add an option to hide the jurisdiction fields from cases and use default values Add an option to hide the jurisdiction fields from cases and use default values [5] Sep 28, 2023
@MateStrysewske MateStrysewske self-assigned this Oct 5, 2023
@bernardsilenou
Copy link

@MateStrysewske

  • Will this change not affect most of the management processes and rights that we have in the system? OR if future management rules based on the default administrative units are added to the system, then how will Lixemburg benefit?
  • Since Lux has cantons as Administrative unit 0, and Communities as Administrative unit 1, what about adding a mapping rule + translations to map cartoons to regions and communities to districts? when country server is Lux?

@MateStrysewske
Copy link
Contributor Author

@bernardsilenou Possibly, this feature is kind of experimental, but I don't see any country except Luxembourg using it, and Luxembourg will only use case surveillance for now, no contact tracing, immunization management, event surveillance, etc. I don't really see a reason to invent complex mapping rules in favour of this.

MateStrysewske added a commit that referenced this issue Oct 10, 2023
MateStrysewske added a commit that referenced this issue Oct 17, 2023
- Only regions, districts and communities can be made default
- Add parent validation to make sure that e.g. a district from another region than the default region can be set as default
- Add column to grids
MateStrysewske added a commit that referenced this issue Oct 26, 2023
sergiupacurariu added a commit that referenced this issue Oct 26, 2023
…urisdiction_fields

#12550 - Hide jurisdiction fields when configured
@abrudanancuta abrudanancuta self-assigned this Nov 3, 2023
@abrudanancuta
Copy link
Contributor

Validated on local machine with the version 1.91.0-SNAPSHOT (a0c405b)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android-app Affects the Android app backend Affects the web backend cases feature A new feature to be developed (ticket type) lu Adaptations requested by or implemented for Luxembourg qa-verified Issue has been tested and verified by QA ready Issue fulfills the definition of ready and can be implemented vaadin-app Affects the Vaadin application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants