Skip to content

Commit

Permalink
Added barcode to food sample testing for Mpox
Browse files Browse the repository at this point in the history
  • Loading branch information
Flava177 committed Jan 24, 2025
1 parent 4a21423 commit 5b1d8d7
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2882,6 +2882,7 @@ public interface Captions {
String SixtyDay_specifySources = "specifySources";
String SixtyDay_productName = "productName";
String SixtyDay_batchNumber = "batchNumber";
String SixtyDay_barcode = "barcode";
String SixtyDay_dateOfManufacture = "dateOfManufacture";
String SixtyDay_expirationDate = "expirationDate";
String SixtyDay_packageSize = "packageSize";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class SixtyDayDto extends PseudonymizableDto {
public static final String SPECIFY_SOURCES = "specifySources";
public static final String PRODUCT_NAME = "productName";
public static final String BATCH_NUMBER = "batchNumber";
public static final String BARCODE = "barcode";
public static final String DATE_OF_MANUFACTURE = "dateOfManufacture";
public static final String EXPIRATION_DATE = "expirationDate";
public static final String PACKAGE_SIZE = "packageSize";
Expand Down Expand Up @@ -91,6 +92,7 @@ public class SixtyDayDto extends PseudonymizableDto {
private String specifySources;
private String productName;
private String batchNumber;
private String barcode;
private Date dateOfManufacture;
private Date expirationDate;
private String packageSize;
Expand Down Expand Up @@ -405,4 +407,12 @@ public String getSpecifySources() {
public void setSpecifySources(String specifySources) {
this.specifySources = specifySources;
}

public String getBarcode() {
return barcode;
}

public void setBarcode(String barcode) {
this.barcode = barcode;
}
}
1 change: 1 addition & 0 deletions sormas-api/src/main/resources/captions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2702,6 +2702,7 @@ specifyFoodsSources =If Yes, specify food(s)
specifySources =If Yes, specify sources(s)
productName =Product Name
batchNumber =Batch/ Lot Number
barcode =Barcode
dateOfManufacture =Date Of Manufacture
expirationDate =Expiration Date
packageSize =Package Size (Grams/ Milliliters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public class SixtyDay extends AbstractDomainObject {
private String address;
private String foodTel;
private String specifySources;
private String barcode;


public String getPersonExamineCase() {
Expand Down Expand Up @@ -407,4 +408,12 @@ public String getSpecifySources() {
public void setSpecifySources(String specifySources) {
this.specifySources = specifySources;
}

public String getBarcode() {
return barcode;
}

public void setBarcode(String barcode) {
this.barcode = barcode;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public SixtyDay fillOrBuildEntity(SixtyDayDto source, SixtyDay target, boolean c
target.setAddress(source.getAddress());
target.setFoodTel(source.getFoodTel());
target.setSpecifySources(source.getSpecifySources());
target.setBarcode(source.getBarcode());

return target;
}
Expand Down Expand Up @@ -150,6 +151,7 @@ public static SixtyDayDto toDto(SixtyDay sixtyDay) {
target.setAddress(source.getAddress());
target.setFoodTel(source.getFoodTel());
target.setSpecifySources(source.getSpecifySources());
target.setBarcode(source.getBarcode());


return target;
Expand Down
5 changes: 4 additions & 1 deletion sormas-backend/src/main/resources/sql/sormas_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15227,4 +15227,7 @@ ALTER TABLE afpimmunization ADD COLUMN lastdose DATE;
ALTER TABLE afpimmunization ADD COLUMN dateLastOpvDosesReceivedThroughSia DATE;
ALTER TABLE afpimmunization ADD COLUMN dateLastIpvDosesReceivedThroughSia DATE;

INSERT INTO schema_version(version_number, comment) VALUES (722, 'Dropped and added columns in afpimmunization to change types to date');
INSERT INTO schema_version(version_number, comment) VALUES (722, 'Dropped and added columns in afpimmunization to change types to date');

ALTER TABLE sixtyday ADD COLUMN barcode VARCHAR(255);
INSERT INTO schema_version(version_number, comment) VALUES (723, 'Added barcode to sixtyday(food sample testing)');
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class SixtyDayForm extends AbstractEditForm<SixtyDayDto>{
loc(PROVIDE_HEADING_LOC)+
fluidRowLocs(SixtyDayDto.SPECIFY_FOODS_SOURCES, SixtyDayDto.SPECIFY_SOURCES) +
fluidRowLocs(SixtyDayDto.PRODUCT_NAME, SixtyDayDto.BATCH_NUMBER) +
fluidRowLocs(6, SixtyDayDto.BARCODE) +
fluidRowLocs(SixtyDayDto.DATE_OF_MANUFACTURE, SixtyDayDto.EXPIRATION_DATE) +
fluidRowLocs(SixtyDayDto.PACKAGE_SIZE, SixtyDayDto.PACKAGING_TYPE, SixtyDayDto.PACKAGING_TYPE_OTHER) +
fluidRowLocs(SixtyDayDto.PLACE_OF_PURCHASE, SixtyDayDto.NAME_OF_MANUFACTURER) +
Expand Down Expand Up @@ -164,6 +165,7 @@ protected void addFields() {
TextField sources = addField(SixtyDayDto.SPECIFY_SOURCES, TextField.class);
TextField productName = addField(SixtyDayDto.PRODUCT_NAME, TextField.class);
TextField batchNumber = addField(SixtyDayDto.BATCH_NUMBER, TextField.class);
TextField barcode = addField(SixtyDayDto.BARCODE, TextField.class);
DateField dateOfManufacture = addField(SixtyDayDto.DATE_OF_MANUFACTURE, DateField.class);
DateField expirationDate = addField(SixtyDayDto.EXPIRATION_DATE, DateField.class);
TextField packageSize = addField(SixtyDayDto.PACKAGE_SIZE, TextField.class);
Expand All @@ -175,7 +177,7 @@ protected void addFields() {
TextField foodTel = addField(SixtyDayDto.FOOD_TEL, TextField.class);

setVisible(false,
SixtyDayDto.FOOD_AVAILABLE_TESTING, SixtyDayDto.LAB_TEST_CONDUCTED, SixtyDayDto.SPECIFY_FOODS_SOURCES, SixtyDayDto.SPECIFY_SOURCES, SixtyDayDto.PRODUCT_NAME, SixtyDayDto.BATCH_NUMBER, SixtyDayDto.DATE_OF_MANUFACTURE, SixtyDayDto.EXPIRATION_DATE, SixtyDayDto.PACKAGE_SIZE, SixtyDayDto.PACKAGING_TYPE, SixtyDayDto.PACKAGING_TYPE_OTHER, SixtyDayDto.PLACE_OF_PURCHASE, SixtyDayDto.NAME_OF_MANUFACTURER, SixtyDayDto.ADDRESS, SixtyDayDto.FOOD_TEL);
SixtyDayDto.FOOD_AVAILABLE_TESTING, SixtyDayDto.LAB_TEST_CONDUCTED, SixtyDayDto.SPECIFY_FOODS_SOURCES, SixtyDayDto.SPECIFY_SOURCES, SixtyDayDto.PRODUCT_NAME, SixtyDayDto.BATCH_NUMBER, SixtyDayDto.BARCODE, SixtyDayDto.DATE_OF_MANUFACTURE, SixtyDayDto.EXPIRATION_DATE, SixtyDayDto.PACKAGE_SIZE, SixtyDayDto.PACKAGING_TYPE, SixtyDayDto.PACKAGING_TYPE_OTHER, SixtyDayDto.PLACE_OF_PURCHASE, SixtyDayDto.NAME_OF_MANUFACTURER, SixtyDayDto.ADDRESS, SixtyDayDto.FOOD_TEL);


initializeVisibilitiesAndAllowedVisibilities();
Expand Down Expand Up @@ -206,7 +208,7 @@ protected void addFields() {
FieldHelper.setVisibleWhen(
foodAvailable,
Arrays.asList(food, sources, productName, batchNumber, dateOfManufacture, expirationDate, packageSize, packagingType, placeOfPurchase, nameOfManufacturer,
address, foodTel),Arrays.asList(YesNoUnknown.YES),true);
address, foodTel, barcode),Arrays.asList(YesNoUnknown.YES),true);
packagingType.addValueChangeListener(event -> {
boolean isOther = event.getProperty().getValue() == PackagingType.OTHER;
packagingTypeOther.setVisible(isOther);
Expand Down

0 comments on commit 5b1d8d7

Please sign in to comment.