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

persist values of disabled ecrffield, listentrytag, inquiry #301

Merged
merged 5 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,10 @@ private void addUpdateInquiryValue(InquiryValueInVO inquiryValueIn, Proband prob
InquiryValueJsonVO resultJs = null;
JournalEntryDao journalEntryDao = this.getJournalEntryDao();
if (id == null) {
if (inquiry.isDisabled()) {
inquiryValueIn = ServiceUtil.createPresetInquiryInValue(inquiry, proband.getId(), this.getInputFieldSelectionSetValueDao());
}
// override disabled values with preset:
//if (inquiry.isDisabled()) {
// inquiryValueIn = ServiceUtil.createPresetInquiryInValue(inquiry, proband.getId(), this.getInputFieldSelectionSetValueDao());
//}
checkInquiryValueInput(inquiryValueIn, proband, inquiry);
ServiceUtil.addAutocompleteSelectionSetValue(inquiry.getField(), inquiryValueIn.getTextValue(), now, user, this.getInputFieldSelectionSetValueDao(), journalEntryDao);
InquiryValue inquiryValue = inquiryValueDao.inquiryValueInVOToEntity(inquiryValueIn);
Expand All @@ -211,8 +212,9 @@ private void addUpdateInquiryValue(InquiryValueInVO inquiryValueIn, Proband prob
}
} else {
InquiryValue originalInquiryValue = CheckIDUtil.checkInquiryValueId(id, inquiryValueDao);
if (!inquiry.isDisabled()
&& !ServiceUtil.inquiryValueEquals(inquiryValueIn, originalInquiryValue.getValue(), force)) {
if (//!inquiry.isDisabled()
// &&
!ServiceUtil.inquiryValueEquals(inquiryValueIn, originalInquiryValue.getValue(), force)) {
checkInquiryValueInput(inquiryValueIn, proband, inquiry);
ServiceUtil.addAutocompleteSelectionSetValue(inquiry.getField(), inquiryValueIn.getTextValue(), now, user, this.getInputFieldSelectionSetValueDao(),
journalEntryDao);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,10 +624,11 @@ private void addUpdateEcrfFieldValue(ECRFFieldValueInVO ecrfFieldValueIn, ECRFSt
ProbandListEntry listEntry = ecrfStatusEntry.getListEntry();
boolean isAuditTrail = ecrfField.isAuditTrail() && ecrfStatusEntry.getStatus().isAuditTrail();
if (id == null) {
if (ecrfField.isDisabled()) {
ecrfFieldValueIn = ServiceUtil.createPresetEcrfFieldInValue(ecrfField, listEntry.getId(), visit != null ? visit.getId() : null, ecrfFieldValueIn.getIndex(),
this.getInputFieldSelectionSetValueDao());
}
// override disabled values with preset:
//if (ecrfField.isDisabled()) {
// ecrfFieldValueIn = ServiceUtil.createPresetEcrfFieldInValue(ecrfField, listEntry.getId(), visit != null ? visit.getId() : null, ecrfFieldValueIn.getIndex(),
// this.getInputFieldSelectionSetValueDao());
//}
checkEcrfFieldValueInputUnlockedForFieldStatus(ecrfFieldValueIn, ecrfStatusEntry, visit, ecrfField);
checkEcrfFieldValueInput(ecrfFieldValueIn, ecrfStatusEntry, ecrfField);
ServiceUtil.addAutocompleteSelectionSetValue(ecrfField.getField(), ecrfFieldValueIn.getTextValue(), now, user, this.getInputFieldSelectionSetValueDao(),
Expand Down Expand Up @@ -662,9 +663,10 @@ private void addUpdateEcrfFieldValue(ECRFFieldValueInVO ecrfFieldValueIn, ECRFSt
ecrfFieldValueIn.getIndex()))) {
throw L10nUtil.initServiceException(ServiceExceptionCodes.ENTITY_WAS_MODIFIED_SINCE, originalEcrfFieldValue.getModifiedUser().getName());
}
if (!ecrfField.isDisabled()
&& (!CommonUtil.isEmptyString(ecrfFieldValueIn.getReasonForChange())
|| !ServiceUtil.ecrfFieldValueEquals(ecrfFieldValueIn, originalEcrfFieldValue.getValue(), force))) {
if (//!ecrfField.isDisabled()
// &&
(!CommonUtil.isEmptyString(ecrfFieldValueIn.getReasonForChange())
|| !ServiceUtil.ecrfFieldValueEquals(ecrfFieldValueIn, originalEcrfFieldValue.getValue(), force))) {
checkEcrfFieldValueInputUnlockedForFieldStatus(ecrfFieldValueIn, ecrfStatusEntry, visit, ecrfField);
checkEcrfFieldValueInput(ecrfFieldValueIn, ecrfStatusEntry, ecrfField);
ServiceUtil.addAutocompleteSelectionSetValue(ecrfField.getField(), ecrfFieldValueIn.getTextValue(), now, user, this.getInputFieldSelectionSetValueDao(),
Expand Down Expand Up @@ -739,9 +741,10 @@ private void addUpdateProbandListEntryTagValue(ProbandListEntryTagValueInVO prob
ProbandListEntryTagValueJsonVO resultJs = null;
JournalEntryDao journalEntryDao = this.getJournalEntryDao();
if (id == null) {
if (listEntryTag.isDisabled()) {
probandListEntryTagValueIn = ServiceUtil.createPresetProbandListEntryTagInValue(listEntryTag, listEntry.getId(), this.getInputFieldSelectionSetValueDao());
}
// override disabled values with preset:
//if (listEntryTag.isDisabled()) {
// probandListEntryTagValueIn = ServiceUtil.createPresetProbandListEntryTagInValue(listEntryTag, listEntry.getId(), this.getInputFieldSelectionSetValueDao());
//}
checkProbandListEntryTagValueInput(probandListEntryTagValueIn, listEntry, listEntryTag);
ServiceUtil.addAutocompleteSelectionSetValue(listEntryTag.getField(), probandListEntryTagValueIn.getTextValue(), now, user, this.getInputFieldSelectionSetValueDao(),
journalEntryDao);
Expand All @@ -768,8 +771,9 @@ private void addUpdateProbandListEntryTagValue(ProbandListEntryTagValueInVO prob
}
} else {
ProbandListEntryTagValue originalListEntryTagValue = CheckIDUtil.checkProbandListEntryTagValueId(id, probandListEntryTagValueDao);
if (!listEntryTag.isDisabled()
&& !ServiceUtil.probandListEntryTagValueEquals(probandListEntryTagValueIn, originalListEntryTagValue.getValue(), force)) {
if (//!listEntryTag.isDisabled()
// &&
!ServiceUtil.probandListEntryTagValueEquals(probandListEntryTagValueIn, originalListEntryTagValue.getValue(), force)) {
boolean isEqual = ServiceUtil.probandListEntryTagValueEquals(probandListEntryTagValueIn, originalListEntryTagValue.getValue(), false);
checkProbandListEntryTagValueInput(probandListEntryTagValueIn, listEntry, listEntryTag); // access original associations before evict
ServiceUtil.addAutocompleteSelectionSetValue(listEntryTag.getField(), probandListEntryTagValueIn.getTextValue(), now, user,
Expand Down Expand Up @@ -5983,7 +5987,7 @@ protected ECRFFieldValuesOutVO handleGetEcrfFieldValue(AuthenticationVO auth, Lo
throws Exception {
CheckIDUtil.checkProbandListEntryId(probandListEntryId, this.getProbandListEntryDao());
ECRFField ecrfField = CheckIDUtil.checkEcrfFieldId(ecrfFieldId, this.getECRFFieldDao());
if (visitId == null) {
if (visitId != null) {
CheckIDUtil.checkVisitId(visitId, this.getVisitDao());
}
checkEcrfFieldValueIndex(ecrfField, probandListEntryId, visitId, ecrfFieldId, index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ protected void addMessages() {
Messages.addLocalizedMessage(FacesMessage.SEVERITY_WARN, MessageCodes.TRIAL_LOCKED);
} else if (probandListEntry != null && !probandListEntry.getTrial().getStatus().getEcrfValueInputEnabled()) {
Messages.addLocalizedMessage(FacesMessage.SEVERITY_INFO, MessageCodes.ECRF_VALUE_INPUT_DISABLED_FOR_TRIAL, probandListEntry.getTrial().getStatus().getName());
} else if (ecrf != null && ecrf.getDisabled()) {
Messages.addLocalizedMessage(FacesMessage.SEVERITY_INFO, MessageCodes.ECRF_VALUE_INPUT_DISABLED_FOR_ECRF);
} else if (probandListEntry != null && probandListEntry.getLastStatus() != null && !probandListEntry.getLastStatus().getStatus().getEcrfValueInputEnabled()) {
Messages.addLocalizedMessage(FacesMessage.SEVERITY_INFO, MessageCodes.ECRF_VALUE_INPUT_DISABLED_FOR_PROBAND_LIST_ENTRY, probandListEntry.getLastStatus().getStatus()
.getName());
Expand Down Expand Up @@ -182,6 +184,8 @@ public boolean isEditable() {
return false;
} else if (WebUtil.isProbandLocked(probandListEntry)) {
return false;
} else if (ecrf != null && ecrf.getDisabled()) {
return false;
} else if (probandListEntry != null && !probandListEntry.getTrial().getStatus().getEcrfValueInputEnabled()) {
return false;
} else if (probandListEntry.getLastStatus() != null && !probandListEntry.getLastStatus().getStatus().getEcrfValueInputEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,8 @@ public boolean getEditable(boolean unlockValue) {
return false;
} else if (WebUtil.isProbandLocked(probandListEntry)) {
return false;
} else if (ecrf.getDisabled()) {
return false;
} else if (!probandListEntry.getTrial().getStatus().getEcrfValueInputEnabled()) {
return false;
} else if (probandListEntry.getLastStatus() != null && !probandListEntry.getLastStatus().getStatus().getEcrfValueInputEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,14 @@ public boolean isDisabled() {
return false;
}

@Override
public boolean isEditable() {
if (ecrfField != null) {
return !ecrfField.getEcrf().getDisabled();
}
return true;
}

@Override
public boolean isDummy() {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public interface MessageCodes {
public static final String MASS_MAIL_LOCKED = "mass_mail_locked";
public static final String ECRF_VALUE_INPUT_DISABLED_FOR_PROBAND_LIST_ENTRY = "ecrf_value_input_disabled_for_proband_list_entry";
public static final String ECRF_VALUE_INPUT_DISABLED_FOR_TRIAL = "ecrf_value_input_disabled_for_trial";
public static final String ECRF_VALUE_INPUT_DISABLED_FOR_ECRF = "ecrf_value_input_disabled_for_ecrf";
public static final String ECRF_FIELD_VALUES_LOCKED_STATUS = "ecrf_field_values_locked_status";
public static final String ECRF_FIELD_STATUS_LOCKED_STATUS = "ecrf_field_status_locked_status";
public static final String CRITERION_LIST_NULL = "criterion_list_null";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ mass_mail_locked=mass mail is locked
inquiry_value_input_disabled=inquiry input is disabled
ecrf_value_input_disabled_for_proband_list_entry=eCRFs are locked for this proband (enrollment status: {0})
ecrf_value_input_disabled_for_trial=eCRFs are locked for this trial (trial status: {0})
ecrf_value_input_disabled_for_ecrf=eCRF is disabled
ecrf_field_values_locked_status=inputs are locked for this eCRF (eCRF status: {0})
ecrf_field_status_locked_status=issues are locked for this eCRF (eCRF status: {0})
no_new_ecrf_field_status=no new eCRF issues ({0}) to manually create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ mass_mail_locked=Massenmail ist gesperrt
inquiry_value_input_disabled=Eingabe von Erhebungen ist gesperrt
ecrf_value_input_disabled_for_proband_list_entry=eCRFs f\u00FCr diesen Probanden sind gesperrt (Enrollment Status\: {0})
ecrf_value_input_disabled_for_trial=eCRFs f\u00FCr diese Studie sind gesperrt (Studienstatus\: {0})
ecrf_value_input_disabled_for_ecrf=eCRF ist deaktiviert
ecrf_field_values_locked_status=Eingaben dieses eCRF''s sind gesperrt (eCRF Status: {0})
ecrf_field_status_locked_status=Issues dieses eCRF''s sind gesperrt (eCRF Status: {0})
no_new_ecrf_field_status=keine neuen eCRF Issues ({0}) manuell erstellbar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ proband_list_entry_tag_title=Input field title
proband_list_entry_tag_title_tooltip=The input field title can be overridden.

proband_list_entry_tag_disabled_label=Disabled:
proband_list_entry_tag_disabled_tooltip=Input is disabled, existing or preset value cannot be edited.
proband_list_entry_tag_disabled_tooltip=Input cannot be edited manually.

proband_list_entry_tag_excel_value_label=Excel value:
proband_list_entry_tag_excel_value_tooltip=Show attribute (value) in exported proband lists.
Expand Down Expand Up @@ -921,7 +921,7 @@ inquiry_title=Input field title
inquiry_title_tooltip=The input field title can be overridden.

inquiry_disabled_label=Disabled:
inquiry_disabled_tooltip=Input is disabled, existing or preset value cannot be edited.
inquiry_disabled_tooltip=Input cannot be edited manually.

inquiry_active_label=Display:
inquiry_active_tooltip=Show/hide this inquiry in the inquiry form.
Expand Down Expand Up @@ -994,7 +994,7 @@ ecrf_active_label=Display:
ecrf_active_tooltip=Show/hide this eCRF in the data capture tab.<br/>Only the most recent eCRF revision should be visible.

ecrf_disabled_label=Disabled:
ecrf_disabled_tooltip=All form inputs are disabled, existing or preset values cannot be edited.
ecrf_disabled_tooltip=All form inputs are readonly.

ecrf_groups_label=Groups:
ecrf_groups=Groups
Expand Down Expand Up @@ -1105,7 +1105,7 @@ ecrffield_optional_label=Optional:
ecrffield_optional_tooltip=Input is mandatory or not.

ecrffield_disabled_label=Disabled:
ecrffield_disabled_tooltip=Input is disabled, existing or preset value cannot be edited.
ecrffield_disabled_tooltip=Input cannot be edited manually.

ecrffield_js_variable_name_label=Variable name:
ecrffield_js_variable_name=Variable name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ proband_list_entry_tag_title=Eingabefeld Titel
proband_list_entry_tag_title_tooltip=Den Titel des Eingabefeldes \u00FCberschreiben.

proband_list_entry_tag_disabled_label=Deaktiviert:
proband_list_entry_tag_disabled_tooltip=Eingabefeld ist deaktiviert, aktueller Wert bzw. Voreinstellungswert<br/>kann nicht bearbeitet werden.
proband_list_entry_tag_disabled_tooltip=Eingabefeld kann nicht bearbeitet werden.

proband_list_entry_tag_js_variable_name_label=Variablenname:
proband_list_entry_tag_js_variable_name=Variablenname
Expand Down Expand Up @@ -921,7 +921,7 @@ inquiry_title=Eingabefeld Titel
inquiry_title_tooltip=Den Titel des Eingabefeldes \u00FCberschreiben.

inquiry_disabled_label=Deaktiviert:
inquiry_disabled_tooltip=Eingabefeld ist deaktiviert, aktueller Wert bzw. Voreinstellungswert<br/>kann nicht bearbeitet werden.
inquiry_disabled_tooltip=Eingabefeld kann nicht bearbeitet werden.

inquiry_active_label=Anzeigen:
inquiry_active_tooltip=Eingabefeld im Erhebungsformular ausblenden.
Expand Down Expand Up @@ -994,7 +994,7 @@ ecrf_active_label=Anzeigen:
ecrf_active_tooltip=Das eCRF im Datenerfassungsreiter einblenden/ausblenden.<br/>Nur die aktuelle eCRF Version sollte sichtbar sein.

ecrf_disabled_label=Deaktiviert:
ecrf_disabled_tooltip=Alle Eingabefelder sind deaktiviert,<br/>Eingaben k\u00F6nnen nicht bearbeitet werden.
ecrf_disabled_tooltip=Alle Eingabefelder sind schreibgesch\u00FCtzt.

ecrf_groups_label=Gruppen:
ecrf_groups=Gruppen
Expand Down Expand Up @@ -1105,7 +1105,7 @@ ecrffield_optional_label=Optional:
ecrffield_optional_tooltip=Eingabe zwingend erforderlich oder nicht.

ecrffield_disabled_label=Deaktiviert:
ecrffield_disabled_tooltip=Eingabefeld ist deaktiviert, aktueller Wert bzw. Voreinstellungswert<br/>kann nicht bearbeitet werden.
ecrffield_disabled_tooltip=Eingabefeld kann nicht bearbeitet werden.

ecrffield_js_variable_name_label=Variablenname:
ecrffield_js_variable_name=Variablenname
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@
oncomplete="handleUpdateInputFieldTabTitles(xhr, status, args);FieldCalculation.handleInitInputFieldVariables(xhr, status, args)"
icon="ui-icon ui-icon-help" ajax="true"
disabled="#{!dummyInputFieldValueBean.created}"
update="input_dummy_input" />
update="input_dummy_input">
<f:param name="includeDisabled" value="true" />
</p:commandButton>
<p:commandButton process="@this"
value="#{labels.load_button_label}"
actionListener="#{dummyInputFieldValueBean.load}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@
oncomplete="handleUpdateProbandTabTitles(xhr, status, args);FieldCalculation.handleUpdateInputFieldVariables(xhr, status, args)"
icon="ui-icon ui-icon-disk" ajax="true"
disabled="#{!inquiryValueBean.editable}"
update="inquiriestrial,inquiry_input_grid" />
update="inquiriestrial,inquiry_input_grid">
<f:param name="includeDisabled" value="true" />
</p:commandButton>
<p:commandButton process="@this"
value="#{labels.load_button_label}"
actionListener="#{inquiryValueBean.load}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,9 @@
oncomplete="FieldCalculation.handleUpdateInputFieldVariables(xhr, status, args);handleUpdateProbandTabTitles(xhr, status, args)"
icon="ui-icon ui-icon-disk" ajax="true"
disabled="#{!probandEcrfStatusEntryBean.ecrfFieldValueBean.editable and !probandEcrfStatusEntryBean.ecrfFieldValueBean.sectionUnlockValueMap[section]}"
update=":tabView:probandecrfstatusentry_form:probandecrfstatus_ecrf_list,:tabView:probandecrfstatusentry_form:section_filter,:tabView:probandecrfstatusentry_form:field_query,:tabView:probandecrfstatusentry_form:ecrf_detail,:tabView:probandecrfstatusentry_form:ecrf_title,:tabView:probandecrfstatusentry_form:ecrffield_input_grid" />
update=":tabView:probandecrfstatusentry_form:probandecrfstatus_ecrf_list,:tabView:probandecrfstatusentry_form:section_filter,:tabView:probandecrfstatusentry_form:field_query,:tabView:probandecrfstatusentry_form:ecrf_detail,:tabView:probandecrfstatusentry_form:ecrf_title,:tabView:probandecrfstatusentry_form:ecrffield_input_grid">
<f:param name="includeDisabled" value="true" />
</p:commandButton>

</p:toolbarGroup>
</p:toolbar>
Expand Down Expand Up @@ -636,7 +638,9 @@
oncomplete="FieldCalculation.handleUpdateInputFieldVariables(xhr, status, args);handleUpdateProbandTabTitles(xhr, status, args)"
icon="ui-icon ui-icon-disk" ajax="true"
rendered="#{probandEcrfStatusEntryBean.ecrfFieldValueBean.editable}"
update="probandecrfstatus_ecrf_list,section_filter,field_query,ecrf_detail,ecrf_title,ecrffield_input_grid" />
update="probandecrfstatus_ecrf_list,section_filter,field_query,ecrf_detail,ecrf_title,ecrffield_input_grid">
<f:param name="includeDisabled" value="true" />
</p:commandButton>



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,9 @@
oncomplete="FieldCalculation.handleUpdateInputFieldVariables(xhr, status, args);trialParticipationList.unselectAllRows();trialParticipationList.filter()"
icon="ui-icon ui-icon-disk" ajax="true"
disabled="#{!trialParticipationBean.probandListEntryTagValueBean.editable}"
update="tagvalue_input_grid" />
update="tagvalue_input_grid">
<f:param name="includeDisabled" value="true" />
</p:commandButton>
<p:commandButton process="@this"
value="#{labels.load_button_label}"
actionListener="#{trialParticipationBean.probandListEntryTagValueBean.load}"
Expand Down
Loading
Loading