Skip to content

Commit

Permalink
Added a disclaimer when de-identification is enabled in the destinati…
Browse files Browse the repository at this point in the history
…on (under the activation) #8
  • Loading branch information
cicciu committed Nov 4, 2020
1 parent e70600a commit 355855e
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.vaadin.flow.component.checkbox.Checkbox;
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.component.html.Label;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.select.Select;
import com.vaadin.flow.data.binder.Binder;
Expand All @@ -16,6 +17,7 @@ public class LayoutDesidentification extends Div {
private Binder<Destination> destinationBinder;

private Checkbox checkboxDesidentification;
private Label labelDisclaimer;
private Checkbox checkboxUseAsPatientName;
private ProjectDropDown projectDropDown;
private ExtidPresentInDicomTagView extidPresentInDicomTagView;
Expand All @@ -25,6 +27,7 @@ public class LayoutDesidentification extends Div {
private WarningNoProjectsDefined warningNoProjectsDefined;

private final String LABEL_CHECKBOX_DESIDENTIFICATION = "Activate de-identification";
private final String LABEL_DISCLAIMER_DEIDENTIFICATION = "In order to ensure complete de-identification, visual verification of metadata and images is necessary.";

private Select<String> extidListBox;
final String [] extidSentence = {"Pseudonym are generate automatically","Pseudonym is already store in KARNAK", "Pseudonym is in a DICOM tag"};
Expand All @@ -48,7 +51,7 @@ public LayoutDesidentification(Binder<Destination> destinationBinder) {
add(UIS.setWidthFull(new HorizontalLayout(checkboxDesidentification, div)));

if (checkboxDesidentification.getValue()) {
div.add(projectDropDown, desidentificationName, extidListBox);
div.add(labelDisclaimer,projectDropDown, desidentificationName, extidListBox);
}

projectDropDown.addValueChangeListener(event -> {
Expand All @@ -61,6 +64,11 @@ private void setElements() {
checkboxDesidentification.setValue(true);
checkboxDesidentification.setMinWidth("25%");

labelDisclaimer = new Label(LABEL_DISCLAIMER_DEIDENTIFICATION);
labelDisclaimer.getStyle().set("color", "red");
labelDisclaimer.setMinWidth("75%");
labelDisclaimer.getStyle().set("right", "0px");

projectDropDown.setLabel("Choose a project");
projectDropDown.setWidth("100%");

Expand Down Expand Up @@ -100,13 +108,13 @@ private void setEventCheckboxDesidentification(){
if (event.getValue() != null) {
if (event.getValue()) {
if (projectDataProvider.getAllProjects().size() > 0) {
div.add(projectDropDown, desidentificationName, extidListBox);
div.add(labelDisclaimer, projectDropDown, desidentificationName, extidListBox);
setTextOnSelectionProject(projectDropDown.getValue());
} else {
warningNoProjectsDefined.open();
}
} else {
div.remove(projectDropDown, desidentificationName);
div.remove(labelDisclaimer, projectDropDown, desidentificationName);
extidListBox.setValue(extidSentence[0]);
checkboxUseAsPatientName.clear();
extidPresentInDicomTagView.clear();
Expand Down

0 comments on commit 355855e

Please sign in to comment.