3333import java .util .Collections ;
3434import java .util .Date ;
3535import java .util .GregorianCalendar ;
36+ import java .util .HashSet ;
3637import java .util .List ;
3738import java .util .Objects ;
39+ import java .util .Set ;
3840import java .util .concurrent .atomic .AtomicBoolean ;
3941import java .util .stream .Collectors ;
4042
@@ -117,6 +119,9 @@ public class PersonEditForm extends AbstractEditForm<PersonDto> {
117119 private static final String NATIONAL_HEALTH_ID_WARNING_LABEL = "nationalHealthIdWarningLoc" ;
118120 private static final String GENERAL_COMMENT_LOC = "generalCommentLoc" ;
119121 public static final String HAS_GUARDIAN = "hasGuardian" ;
122+ public static final Set <Disease > PERINATAL_DISEASES =
123+ Collections .unmodifiableSet (new HashSet <>(Arrays .asList (Disease .CONGENITAL_RUBELLA , Disease .RESPIRATORY_SYNCYTIAL_VIRUS )));
124+
120125 //@formatter:off
121126 private static final String HTML_LAYOUT =
122127 loc (PERSON_INFORMATION_HEADING_LOC ) +
@@ -129,7 +134,6 @@ public class PersonEditForm extends AbstractEditForm<PersonDto> {
129134 ) +
130135 fluidRowLocs (PersonDto .PLACE_OF_BIRTH_REGION , PersonDto .PLACE_OF_BIRTH_DISTRICT , PersonDto .PLACE_OF_BIRTH_COMMUNITY ) +
131136 fluidRowLocs (PersonDto .PLACE_OF_BIRTH_FACILITY_TYPE , PersonDto .PLACE_OF_BIRTH_FACILITY , PersonDto .PLACE_OF_BIRTH_FACILITY_DETAILS ) +
132- fluidRowLocs (PersonDto .GESTATION_AGE_AT_BIRTH , PersonDto .BIRTH_WEIGHT ) +
133137 fluidRowLocs (PersonDto .SEX , PersonDto .PRESENT_CONDITION ) +
134138 fluidRow (
135139 oneOfFourCol (PersonDto .DEATH_DATE ),
@@ -157,10 +161,9 @@ public class PersonEditForm extends AbstractEditForm<PersonDto> {
157161 fluidRowLocs (PersonDto .HAS_COVID_APP , PersonDto .COVID_CODE_DELIVERED ) +
158162
159163 loc (PERINATAL_DETAILS_HEADER ) +
160- divsCss (VSPACE_3 ,
161- fluidRowLocs (PersonDto .GESTATIONAL_AGE_CATEGORY , PersonDto .BIRTH_WEIGHT_CATEGORY ) +
162- fluidRowLocs (PersonDto .BIRTH_WEIGHT_VALUE , PersonDto .MULTIPLE_BIRTH )
163- ) +
164+ divsCss (VSPACE_3 ,fluidRowLocs (PersonDto .GESTATIONAL_AGE_CATEGORY ,PersonDto .GESTATION_AGE_AT_BIRTH ) +
165+ fluidRowLocs (PersonDto .BIRTH_WEIGHT_CATEGORY , PersonDto .BIRTH_WEIGHT ) +
166+ fluidRowLocs (PersonDto .MULTIPLE_BIRTH ,"" ))+
164167
165168 loc (OCCUPATION_HEADER ) +
166169 divsCss (VSPACE_3 ,
@@ -383,8 +386,6 @@ protected void addFields() {
383386 // RSV Perinatal Details
384387 ComboBox gestationalAgeCategory = addField (PersonDto .GESTATIONAL_AGE_CATEGORY , ComboBox .class );
385388 ComboBox birthWeightCategory = addField (PersonDto .BIRTH_WEIGHT_CATEGORY , ComboBox .class );
386- TextField birthWeightValue = addField (PersonDto .BIRTH_WEIGHT_VALUE , TextField .class );
387- birthWeightValue .setConversionError (I18nProperties .getValidationError (Validations .onlyIntegerNumbersAllowed , birthWeightValue .getCaption ()));
388389 ComboBox multipleBirth = addField (PersonDto .MULTIPLE_BIRTH , ComboBox .class );
389390
390391 AbstractSelect deathPlaceType = addField (PersonDto .DEATH_PLACE_TYPE , ComboBox .class );
@@ -728,7 +729,7 @@ protected void addFields() {
728729 minimumAdultAge = FacadeProvider .getConfigFacade ().getMinimumAdultAge ();
729730 minimumEmancipatedAge = FacadeProvider .getConfigFacade ().getMinimumEmancipatedAge ();
730731
731- if (disease != null && disease != Disease . RESPIRATORY_SYNCYTIAL_VIRUS ) {
732+ if (disease != null && ! PERINATAL_DISEASES . contains ( disease ) ) {
732733 perinatalDetailsHeader .setVisible (false );
733734 }
734735 }
0 commit comments