SORMAS (Surveillance, Outbreak Response Management and Analysis System) is an early warning and management system to fight the spread of infectious diseases.
When creating vaccinations, users can select a vaccine name and the associated vaccine manufacturer. Both the vaccine and vaccine manufacturer are hard-coded into the system. This is inflexible as it doesn't allow server administrators to quickly add new vaccines to the system, and it also means that a lot of vaccines that are actively used in the system can't be selected because it's not feasible to add all of them as default vaccines.
Extend the CustomizableEnumType enum with new types called VACCINE and VACCINE_MANUFACTURER
Refactor the enum classes into actual classes that extend CustomizableEnum
Adjust the entity classes in the web and mobile backend accordingly (e.g. the mobile app needs an additional String field, the web app needs an annotation and two new converters)
Adjust the UI (mobile and web) to use the customizable enum instead of the old enums; this affects all fields that include these values, and also possible filters
Extend both enum classes with a Boolean field called hasDetails that is false by default; extend the setProperties methods of both enums to set the value of the field based on the map that is passed to it (key = name of the property that needs to be checked, value = value of the property that is supposed to be set)
In the UI, manage the visibility of the vaccineNameDetails and vaccineManufacturerDetails fields based on the property of the selected enum value
Extend the Vaccine enum class with a List of Strings OR a List of VaccineManufacturers (depending on what works technically) field called vaccineManufacturers that is empty by default; extend the setProperties method accordingly
In the UI, add a value change listener to the vaccine fields that automatically updates the list of available vaccine manufacturers based on the value of the new field; if the list only contains one value, select it automatically
Write an SQL script that creates entries in the customizableenumvalue table for each vaccine and vaccine manufacturer that we currently have in the system EXCEPT the combination values (ASTRA_ZENECA_COMIRNATY, ASTRA_ZENECA_MRNA_1273, ASTRA_ZENECA_BIONTECH_PFIZER, ASTRA_ZENECA_MODERNA)
See schema version 372 for an example
Use CORONAVIRUS as the disease for all vaccines except OTHER and UNKNOWN
Use no disease for the vaccine manufacturers
Use the default enum captions
Add a hint to the release notes that server admins have to adjust the captions or add translations for their server language
For the Vaccine enums, add content to the properties column that links the vaccine to the respective vaccine manufacturer, and that sets hasDetails to true for OTHER
For the VaccineManufacturer enum, add content to the properties column that sets hasDetails to true for OTHER
Extend the customizable enum guide in the Wiki with a section that explains how properties can be added/changed
Extend the translation logic:
Add an I18N_PREFIX with the value CustomizableEnum to the CustomizableEnum class, and add a method called getI18nPrefix that returns it; override that method in all existing customizable enums to return super (because we don't need specific I18nPrefixes right now)
Add CustomizableEnum.OTHER = Other to captions.properties
Extend the logic in CustomizableEnumFacadeEjb and CustomizableEnumValueDao that retrieves the enum values by language with the following logic:
If there's a specific translation in the database, use it
Otherwise, check if there is a translation available in captions.properties based on the specific I18nPrefix of the enum type
Otherwise, check if there is a translation available in caption.properties based on the I18nPrefix of CustomizableEnum
Extend the customizable enum guide in the Wiki with a hint that there is a generic translation for all customizable enum values that are called "OTHER" that can be overwritten if desired
Problem Description
When creating vaccinations, users can select a vaccine name and the associated vaccine manufacturer. Both the vaccine and vaccine manufacturer are hard-coded into the system. This is inflexible as it doesn't allow server administrators to quickly add new vaccines to the system, and it also means that a lot of vaccines that are actively used in the system can't be selected because it's not feasible to add all of them as default vaccines.
Proposed Change
Turn the Vaccine and the VaccineManufacturer enums into customizable enums. See the
SpecificRisk
customizable enum as a reference for the to-dos below (PR for it: https://github.com/hzi-braunschweig/SORMAS-Project/pull/6185/files)Refactor enums and add property support:
VACCINE
andVACCINE_MANUFACTURER
hasDetails
that is false by default; extend thesetProperties
methods of both enums to set the value of the field based on the map that is passed to it (key = name of the property that needs to be checked, value = value of the property that is supposed to be set)vaccineManufacturers
that is empty by default; extend thesetProperties
method accordinglyhasDetails
to true for OTHERhasDetails
to true for OTHERExtend the translation logic:
CustomizableEnum
to the CustomizableEnum class, and add a method calledgetI18nPrefix
that returns it; override that method in all existing customizable enums to return super (because we don't need specific I18nPrefixes right now)CustomizableEnum.OTHER = Other
to captions.propertiesAcceptance Criteria
Implementation Details
Additional Information