diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/NIRCOrchardFileGenerator.java b/nirc_ehr/src/org/labkey/nirc_ehr/NIRCOrchardFileGenerator.java index 09278f5a..6d7ba620 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/NIRCOrchardFileGenerator.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/NIRCOrchardFileGenerator.java @@ -1,6 +1,5 @@ package org.labkey.nirc_ehr; -import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.labkey.api.data.CompareType; import org.labkey.api.data.Container; @@ -8,7 +7,6 @@ import org.labkey.api.data.SimpleFilter; import org.labkey.api.data.TableInfo; import org.labkey.api.data.TableSelector; -import org.labkey.api.exp.OntologyManager; import org.labkey.api.module.Module; import org.labkey.api.module.ModuleLoader; import org.labkey.api.module.ModuleProperty; diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/NIRC_EHRManager.java b/nirc_ehr/src/org/labkey/nirc_ehr/NIRC_EHRManager.java index 4ef62e87..a6efa945 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/NIRC_EHRManager.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/NIRC_EHRManager.java @@ -12,7 +12,7 @@ public class NIRC_EHRManager public static final String SIB_OBS_TITLE = "SIB Observations"; public static final List SIB_OBS = List.of("Environmental Change", "Self Biting Observed", "Other Stereotopy", "New Injury Observed", "Special Enrichment", "Wound Status", "Wound Severity"); - private static NIRCOrchardFileGenerator _orchardFileGenerator = new NIRCOrchardFileGenerator(); + private static final NIRCOrchardFileGenerator _orchardFileGenerator = new NIRCOrchardFileGenerator(); public static NIRCOrchardFileGenerator getOrchardFileGenerator() { return _orchardFileGenerator; diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCArrivalFormType.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCArrivalFormType.java index 7c2b9be2..e01e6cb2 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCArrivalFormType.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCArrivalFormType.java @@ -8,8 +8,6 @@ import org.labkey.nirc_ehr.dataentry.section.NIRCAnimalDetailsFormSection; import org.labkey.nirc_ehr.dataentry.section.NIRCArrivalFormSection; import org.labkey.nirc_ehr.dataentry.section.NIRCArrivalInstructionsFormSection; -import org.labkey.nirc_ehr.dataentry.section.NIRCProjectAssignmentFormSection; -import org.labkey.nirc_ehr.dataentry.section.NIRCProtocolAssignmentFormSection; import org.labkey.nirc_ehr.dataentry.section.NIRCTaskFormSection; import org.labkey.nirc_ehr.dataentry.section.NIRCWeightFormSection; diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBirthFormType.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBirthFormType.java index bd170279..96416137 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBirthFormType.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBirthFormType.java @@ -41,7 +41,7 @@ public NIRCBirthFormType (DataEntryFormContext ctx, Module owner) @Override protected List getButtonConfigs() { - List defaultButtons = new ArrayList(); + List defaultButtons = new ArrayList<>(); defaultButtons.add("SAVEDRAFT"); defaultButtons.add("BIRTHARRIVALREVIEW"); defaultButtons.add("BIRTHARRIVALFINAL"); diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBulkBehaviorFormType.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBulkBehaviorFormType.java index f7266105..691f094a 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBulkBehaviorFormType.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBulkBehaviorFormType.java @@ -50,7 +50,7 @@ public NIRCBulkBehaviorFormType(DataEntryFormContext ctx, Module owner) s.addConfigSource("BehaviorDefaults"); s.addConfigSource("TreatmentSchedule"); s.addConfigSource("MedicationEndDate"); - }; + } } @Override diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBulkClinicalFormType.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBulkClinicalFormType.java index e52e24b3..5711d778 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBulkClinicalFormType.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBulkClinicalFormType.java @@ -62,7 +62,7 @@ public NIRCBulkClinicalFormType(DataEntryFormContext ctx, Module owner) s.addConfigSource("BulkClinical"); s.addConfigSource("TreatmentSchedule"); s.addConfigSource("MedicationEndDate"); - }; + } } @Override diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCDeathNecropsyFormType.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCDeathNecropsyFormType.java index 8ab094f6..fbd8c131 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCDeathNecropsyFormType.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCDeathNecropsyFormType.java @@ -45,7 +45,7 @@ public NIRCDeathNecropsyFormType(DataEntryFormContext ctx, Module owner) @Override protected List getButtonConfigs() { - List defaultButtons = new ArrayList(); + List defaultButtons = new ArrayList<>(); boolean isVetTech = getCtx().getContainer().hasPermission(getCtx().getUser(), NIRCEHRVetTechPermission.class); boolean isVet = getCtx().getContainer().hasPermission(getCtx().getUser(), EHRVeterinarianPermission.class); diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCDepartureFormType.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCDepartureFormType.java index 2178a839..103970be 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCDepartureFormType.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCDepartureFormType.java @@ -1,9 +1,7 @@ package org.labkey.nirc_ehr.dataentry.form; import org.labkey.api.ehr.dataentry.DataEntryFormContext; -import org.labkey.api.ehr.dataentry.TaskForm; import org.labkey.api.module.Module; -import org.labkey.api.view.template.ClientDependency; import org.labkey.nirc_ehr.dataentry.section.NIRCAnimalDetailsFormSection; import org.labkey.nirc_ehr.dataentry.section.NIRCDepartureFormSection; import org.labkey.nirc_ehr.dataentry.section.NIRCTaskFormSection; diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCHousingFormType.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCHousingFormType.java index 1b2cc471..b8e3833f 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCHousingFormType.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCHousingFormType.java @@ -3,7 +3,6 @@ import org.labkey.api.ehr.dataentry.DataEntryFormContext; import org.labkey.api.ehr.security.EHRHousingTransferPermission; import org.labkey.api.module.Module; -import org.labkey.api.view.template.ClientDependency; import org.labkey.nirc_ehr.dataentry.section.NIRCAnimalDetailsFormSection; import org.labkey.nirc_ehr.dataentry.section.NIRCHousingFormSection; import org.labkey.nirc_ehr.dataentry.section.NIRCTaskFormSection; diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCWeightFormType.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCWeightFormType.java index 8354aab3..65a0a151 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCWeightFormType.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCWeightFormType.java @@ -2,7 +2,6 @@ import org.labkey.api.ehr.dataentry.DataEntryFormContext; import org.labkey.api.module.Module; -import org.labkey.api.view.template.ClientDependency; import org.labkey.nirc_ehr.dataentry.section.NIRCAnimalDetailsFormSection; import org.labkey.nirc_ehr.dataentry.section.NIRCTaskFormSection; import org.labkey.nirc_ehr.dataentry.section.NIRCWeightFormSection; diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCArrivalFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCArrivalFormSection.java index 151634f6..ee2a63c0 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCArrivalFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCArrivalFormSection.java @@ -3,7 +3,6 @@ import org.json.JSONObject; import org.labkey.api.data.TableInfo; import org.labkey.api.ehr.dataentry.DataEntryFormContext; -import org.labkey.api.ehr.dataentry.forms.NewAnimalFormSection; import org.labkey.api.query.FieldKey; import java.util.List; diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBloodDrawFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBloodDrawFormSection.java index 4da10ed0..f1476c4e 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBloodDrawFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBloodDrawFormSection.java @@ -10,9 +10,9 @@ public class NIRCBloodDrawFormSection extends BloodDrawFormSection { - private boolean _collapsible = false; - private boolean _initCollapsed = false; - private boolean _addCopyFromSection = false; + private boolean _collapsible; + private boolean _initCollapsed; + private boolean _addCopyFromSection; public NIRCBloodDrawFormSection(boolean collapsible, boolean initCollapsed, boolean addCopyFromSection) { @@ -41,6 +41,7 @@ public NIRCBloodDrawFormSection(boolean isChild, String parentQueryName) } } + @Override public List getTbarButtons() { List defaultButtons = super.getTbarButtons(); diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCCasesFormPanelSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCCasesFormPanelSection.java index 6046b1a0..b0ab982d 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCCasesFormPanelSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCCasesFormPanelSection.java @@ -14,10 +14,10 @@ public class NIRCCasesFormPanelSection extends ParentFormPanelSection { - private boolean isVetTech; - private boolean isVet; - private boolean isFolderAdmin; - private boolean isBehavior; + private final boolean isVetTech; + private final boolean isVet; + private final boolean isFolderAdmin; + private final boolean isBehavior; public NIRCCasesFormPanelSection(String label, DataEntryFormContext ctx, boolean isBehavior) { diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCClinicalObservationsFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCClinicalObservationsFormSection.java index bcc5fb36..5dad7dae 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCClinicalObservationsFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCClinicalObservationsFormSection.java @@ -7,7 +7,7 @@ public class NIRCClinicalObservationsFormSection extends BaseFormSection { public static final String LABEL = "Observations"; - private boolean _autoPopulateDailyObs = true; + private boolean _autoPopulateDailyObs; public NIRCClinicalObservationsFormSection(boolean autoPopulateDailyObs, boolean initCollapsed) { diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCClinicalRemarksFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCClinicalRemarksFormSection.java index aaaa5d1c..1b6a5a56 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCClinicalRemarksFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCClinicalRemarksFormSection.java @@ -8,9 +8,9 @@ public class NIRCClinicalRemarksFormSection extends BaseFormSection { public static final String LABEL = "Clinical Remarks"; - private boolean isVetTech; - private boolean isVet; - private boolean isFolderAdmin; + private final boolean isVetTech; + private final boolean isVet; + private final boolean isFolderAdmin; public NIRCClinicalRemarksFormSection(boolean isVetTech, boolean isVet, boolean isFolderAdmin) { diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCDeathFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCDeathFormSection.java index 6b08f7f4..1f93391d 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCDeathFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCDeathFormSection.java @@ -12,6 +12,7 @@ public NIRCDeathFormSection() setSupportFormSort(false); } + @Override public JSONObject toJSON(DataEntryFormContext ctx, boolean includeFormElements) { JSONObject json = super.toJSON(ctx, includeFormElements); diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCExemptionsFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCExemptionsFormSection.java index 3c68ab90..effd42a8 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCExemptionsFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCExemptionsFormSection.java @@ -1,7 +1,5 @@ package org.labkey.nirc_ehr.dataentry.section; -import org.labkey.api.ehr.EHRService; - public class NIRCExemptionsFormSection extends BaseFormSection { public NIRCExemptionsFormSection(String label) diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCFlagsFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCFlagsFormSection.java index 73473e49..16d0ce75 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCFlagsFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCFlagsFormSection.java @@ -1,7 +1,5 @@ package org.labkey.nirc_ehr.dataentry.section; -import org.labkey.api.ehr.EHRService; - public class NIRCFlagsFormSection extends BaseFormSection { public NIRCFlagsFormSection(String label) diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCGrossPathologyFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCGrossPathologyFormSection.java index c028602e..096fcbf8 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCGrossPathologyFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCGrossPathologyFormSection.java @@ -1,7 +1,5 @@ package org.labkey.nirc_ehr.dataentry.section; -import org.json.JSONObject; -import org.labkey.api.ehr.dataentry.DataEntryFormContext; import org.labkey.api.view.template.ClientDependency; import java.util.List; diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCNecropsyFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCNecropsyFormSection.java index 16d98ba7..924ab730 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCNecropsyFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCNecropsyFormSection.java @@ -1,14 +1,10 @@ package org.labkey.nirc_ehr.dataentry.section; import org.json.JSONObject; -import org.labkey.api.data.TableInfo; import org.labkey.api.ehr.dataentry.DataEntryFormContext; import org.labkey.api.ehr.dataentry.SimpleFormPanelSection; -import org.labkey.api.query.FieldKey; import org.labkey.api.view.template.ClientDependency; -import java.util.List; - public class NIRCNecropsyFormSection extends SimpleFormPanelSection { diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCObservationOrdersFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCObservationOrdersFormSection.java index 6fa71f1c..b0eda39b 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCObservationOrdersFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCObservationOrdersFormSection.java @@ -8,7 +8,7 @@ public class NIRCObservationOrdersFormSection extends BaseFormSection { public static final String LABEL = "Observation Orders"; - private String _dailyObsOption; + private final String _dailyObsOption; public NIRCObservationOrdersFormSection(String dailyObsOption, boolean initCollapsed) { diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCWeightFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCWeightFormSection.java index 006bbe0f..40a0dd58 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCWeightFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCWeightFormSection.java @@ -1,6 +1,5 @@ package org.labkey.nirc_ehr.dataentry.section; -import org.labkey.api.ehr.EHRService; import org.labkey.api.view.template.ClientDependency; public class NIRCWeightFormSection extends BaseFormSection diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveAssignmentsDemographicsProvider.java b/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveAssignmentsDemographicsProvider.java index 0d5d20d6..6a6cbffd 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveAssignmentsDemographicsProvider.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveAssignmentsDemographicsProvider.java @@ -35,7 +35,7 @@ public ActiveAssignmentsDemographicsProvider(Module owner) @Override protected Set getFieldKeys() { - Set keys = new HashSet(); + Set keys = new HashSet<>(); keys.add(FieldKey.fromString("lsid")); keys.add(FieldKey.fromString("Id")); keys.add(FieldKey.fromString("project")); diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveCasesDemographicsProvider.java b/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveCasesDemographicsProvider.java index 0c9cccda..228cfacf 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveCasesDemographicsProvider.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveCasesDemographicsProvider.java @@ -21,7 +21,7 @@ public ActiveCasesDemographicsProvider(Module module) @Override protected Set getFieldKeys() { - Set keys = new HashSet(); + Set keys = new HashSet<>(); keys.add(FieldKey.fromString("lsid")); keys.add(FieldKey.fromString("objectid")); keys.add(FieldKey.fromString("Id")); diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveFlagsDemographicsProvider.java b/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveFlagsDemographicsProvider.java index 780a59e0..75eca038 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveFlagsDemographicsProvider.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveFlagsDemographicsProvider.java @@ -39,7 +39,7 @@ public ActiveFlagsDemographicsProvider(Module module) @Override protected Set getFieldKeys() { - Set keys = new HashSet(); + Set keys = new HashSet<>(); keys.add(FieldKey.fromString("lsid")); keys.add(FieldKey.fromString("Id")); keys.add(FieldKey.fromString("date")); diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveTreatmentsDemographicsProvider.java b/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveTreatmentsDemographicsProvider.java index 50f7128e..46089bfd 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveTreatmentsDemographicsProvider.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ActiveTreatmentsDemographicsProvider.java @@ -20,7 +20,7 @@ public ActiveTreatmentsDemographicsProvider(Module owner) @Override protected Set getFieldKeys() { - Set keys = new HashSet(); + Set keys = new HashSet<>(); keys.add(FieldKey.fromString("lsid")); keys.add(FieldKey.fromString("Id")); keys.add(FieldKey.fromString("code")); @@ -60,6 +60,7 @@ public Collection getKeysToTest() return keys; } + @Override protected SimpleFilter getFilter(Collection ids) { SimpleFilter filter = super.getFilter(ids); diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/demographics/NecropsyStatusDemographicsProvider.java b/nirc_ehr/src/org/labkey/nirc_ehr/demographics/NecropsyStatusDemographicsProvider.java index 40298cad..31bbc026 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/demographics/NecropsyStatusDemographicsProvider.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/demographics/NecropsyStatusDemographicsProvider.java @@ -31,13 +31,14 @@ public boolean requiresRecalc(String schema, String query) @Override protected Collection getFieldKeys() { - Set keys = new HashSet(); + Set keys = new HashSet<>(); keys.add(FieldKey.fromString("Id")); keys.add(FieldKey.fromString("necropsy_status")); return keys; } + @Override protected SimpleFilter getFilter(Collection ids) { List qcStates = new ArrayList<>(); diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ProtocolAssignmentDemographicsProvider.java b/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ProtocolAssignmentDemographicsProvider.java index 016159a3..ed2e4176 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ProtocolAssignmentDemographicsProvider.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/demographics/ProtocolAssignmentDemographicsProvider.java @@ -8,7 +8,6 @@ import java.util.Collection; import java.util.HashSet; -import java.util.List; import java.util.Set; public class ProtocolAssignmentDemographicsProvider extends AbstractListDemographicsProvider diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/history/BloodDrawDataSource.java b/nirc_ehr/src/org/labkey/nirc_ehr/history/BloodDrawDataSource.java index fed403ea..5b02b6ed 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/history/BloodDrawDataSource.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/history/BloodDrawDataSource.java @@ -41,12 +41,11 @@ protected Set getColumnNames() @Override protected String getHtml(Container c, Results rs, boolean redacted) throws SQLException { - StringBuilder sb = new StringBuilder(); - sb.append(safeAppend(rs, "Total Quantity", "quantity", " mL")); - sb.append(safeAppend(rs, "Sample Type", "type")); - sb.append(safeAppend(rs, "Remark", "remark")); + String sb = safeAppend(rs, "Total Quantity", "quantity", " mL") + + safeAppend(rs, "Sample Type", "type") + + safeAppend(rs, "Remark", "remark"); - return sb.toString(); + return sb; } } diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/history/BreederDataSource.java b/nirc_ehr/src/org/labkey/nirc_ehr/history/BreederDataSource.java index a8a6364f..2a5d7917 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/history/BreederDataSource.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/history/BreederDataSource.java @@ -32,12 +32,11 @@ public BreederDataSource(Module module) @Override protected String getHtml(Container c, Results rs, boolean redacted) throws SQLException { - StringBuilder sb = new StringBuilder(); - sb.append(safeAppend(rs, "Type", "type")); - sb.append(safeAppend(rs, "Result", "result")); - sb.append(safeAppend(rs, "Remark", "remark")); + String sb = safeAppend(rs, "Type", "type") + + safeAppend(rs, "Result", "result") + + safeAppend(rs, "Remark", "remark"); - return sb.toString(); + return sb; } } diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/history/FosteringDataSource.java b/nirc_ehr/src/org/labkey/nirc_ehr/history/FosteringDataSource.java index b80dd09e..710be254 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/history/FosteringDataSource.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/history/FosteringDataSource.java @@ -40,11 +40,10 @@ protected Set getColumnNames() @Override protected String getHtml(Container c, Results rs, boolean redacted) throws SQLException { - StringBuilder sb = new StringBuilder(); - sb.append(safeAppend(rs, "Type", "type")); - sb.append(safeAppend(rs, "Remark", "remark")); + String sb = safeAppend(rs, "Type", "type") + + safeAppend(rs, "Remark", "remark"); - return sb.toString(); + return sb; } } diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/history/HistopathologyDataSource.java b/nirc_ehr/src/org/labkey/nirc_ehr/history/HistopathologyDataSource.java index 8e5966c6..50254ac6 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/history/HistopathologyDataSource.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/history/HistopathologyDataSource.java @@ -40,11 +40,10 @@ protected Set getColumnNames() @Override protected String getHtml(Container c, Results rs, boolean redacted) throws SQLException { - StringBuilder sb = new StringBuilder(); - sb.append(safeAppend(rs, "Diagnosis", "diagnosis")); - sb.append(safeAppend(rs, "Remark", "remark")); + String sb = safeAppend(rs, "Diagnosis", "diagnosis") + + safeAppend(rs, "Remark", "remark"); - return sb.toString(); + return sb; } } diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/history/NIRCCaseCloseDataSource.java b/nirc_ehr/src/org/labkey/nirc_ehr/history/NIRCCaseCloseDataSource.java index 059c6db6..b7ce3891 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/history/NIRCCaseCloseDataSource.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/history/NIRCCaseCloseDataSource.java @@ -1,6 +1,5 @@ package org.labkey.nirc_ehr.history; -import org.apache.commons.lang3.time.DateUtils; import org.jetbrains.annotations.NotNull; import org.labkey.api.data.CompareType; import org.labkey.api.data.Container; @@ -31,14 +30,12 @@ protected String getHtml(Container c, Results rs, boolean redacted) throws SQLEx { Date start = rs.getDate(FieldKey.fromString("date")); - StringBuilder sb = new StringBuilder(); + String sb = "Opened Date: " + DateUtil.formatDate(c, start) + + "\n" + + safeAppend(rs, "Problem Area", "problemCategory") + + safeAppend(rs, "Close Remark", "closeRemark"); - sb.append("Opened Date: ").append(DateUtil.formatDate(c, start)); - sb.append("\n"); - sb.append(safeAppend(rs, "Problem Area", "problemCategory")); - sb.append(safeAppend(rs, "Close Remark", "closeRemark")); - - return sb.toString(); + return sb; } @Override diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/history/NIRCClinicalObservationsDataSource.java b/nirc_ehr/src/org/labkey/nirc_ehr/history/NIRCClinicalObservationsDataSource.java index c5da7961..ca5eaa5a 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/history/NIRCClinicalObservationsDataSource.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/history/NIRCClinicalObservationsDataSource.java @@ -59,7 +59,7 @@ protected List processRows(Container c, TableSelector ts, final bool rowMap.put("html", html); Date roundedDate = DateUtils.truncate((Date)rowMap.get("date"), Calendar.MINUTE); - String key = results.getString(FieldKey.fromString("taskid")) + "||" + rowMap.get("Id") + "||" + rowMap.get("categoryText") + "||" + rowMap.get("categoryGroup") + "||" + roundedDate.toString(); + String key = results.getString(FieldKey.fromString("taskid")) + "||" + rowMap.get("Id") + "||" + rowMap.get("categoryText") + "||" + rowMap.get("categoryGroup") + "||" + roundedDate; List> obsRows = idMap.get(key); if (obsRows == null) obsRows = new ArrayList<>(); @@ -112,11 +112,8 @@ protected List processRows(Container c, TableSelector ts, final bool } HistoryRow row = new HistoryRowImpl(this, categoryText, categoryGroup, categoryColor, subjectId, date, html.toString(), qcStateLabel, publicData, taskId, taskRowId, formType, objectId); - if (row != null) - { - row.setShowTime(false); - rows.add(row); - } + row.setShowTime(false); + rows.add(row); } return rows; @@ -158,12 +155,12 @@ private String getObservationLine(Results rs, boolean redacted) throws SQLExcept if (rs.getString(FieldKey.fromString("remark")) != null) { - if (sb.length() > 0) + if (!sb.isEmpty()) sb.append(". "); sb.append(PageFlowUtil.filter(rs.getString(FieldKey.fromString("remark")))); } - if (sb.length() > 0) + if (!sb.isEmpty()) sb.append("\n"); return sb.toString(); diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/history/NIRCObservationOrdersDataSource.java b/nirc_ehr/src/org/labkey/nirc_ehr/history/NIRCObservationOrdersDataSource.java index 25f2daee..c177824f 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/history/NIRCObservationOrdersDataSource.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/history/NIRCObservationOrdersDataSource.java @@ -59,7 +59,7 @@ protected List processRows(Container c, TableSelector ts, final bool rowMap.put("html", html); Date roundedDate = DateUtils.truncate((Date)rowMap.get("date"), Calendar.MINUTE); - String key = results.getString(FieldKey.fromString("taskid")) + "||" + rowMap.get("Id") + "||" + rowMap.get("categoryText") + "||" + rowMap.get("categoryGroup") + "||" + roundedDate.toString(); + String key = results.getString(FieldKey.fromString("taskid")) + "||" + rowMap.get("Id") + "||" + rowMap.get("categoryText") + "||" + rowMap.get("categoryGroup") + "||" + roundedDate; List> obsRows = idMap.get(key); if (obsRows == null) obsRows = new ArrayList<>(); @@ -112,11 +112,8 @@ protected List processRows(Container c, TableSelector ts, final bool } HistoryRow row = new HistoryRowImpl(this, categoryText, categoryGroup, categoryColor, subjectId, date, html.toString(), qcStateLabel, publicData, taskId, taskRowId, formType, objectId); - if (row != null) - { - row.setShowTime(false); - rows.add(row); - } + row.setShowTime(false); + rows.add(row); } return rows; @@ -148,12 +145,12 @@ private String getObservationLine(Results rs, boolean redacted) throws SQLExcept if (rs.getString(FieldKey.fromString("remark")) != null) { - if (sb.length() > 0) + if (!sb.isEmpty()) sb.append(". "); sb.append(PageFlowUtil.filter(rs.getString(FieldKey.fromString("remark")))); } - if (sb.length() > 0) + if (!sb.isEmpty()) sb.append("\n"); return sb.toString(); diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/history/ProtocolDataSource.java b/nirc_ehr/src/org/labkey/nirc_ehr/history/ProtocolDataSource.java index cc6c55fe..5449f9c9 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/history/ProtocolDataSource.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/history/ProtocolDataSource.java @@ -48,6 +48,6 @@ private void addRow(StringBuilder sb, String displayLabel, String value) sb.append(displayLabel); sb.append(": "); sb.append(PageFlowUtil.filter(value)); - sb.append("\n");; + sb.append("\n"); } } diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/notification/TriggerScriptNotification.java b/nirc_ehr/src/org/labkey/nirc_ehr/notification/TriggerScriptNotification.java index a8aa8f3a..944708f1 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/notification/TriggerScriptNotification.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/notification/TriggerScriptNotification.java @@ -49,7 +49,7 @@ public static void sendMessage(String subject, String bodyHtml, Collection _cachedDrugFormulary = new HashMap<>(); + private final Map _cachedDrugFormulary = new HashMap<>(); - private SimpleDateFormat _dateFormat; + private final SimpleDateFormat _dateFormat; public NIRC_EHRTriggerHelper(int userId, String containerId) { @@ -144,7 +144,7 @@ else if (enddate == null || enddate.after(deathDate)) nextFilter.addCondition(FieldKey.fromString("taskid"), taskId, CompareType.NEQ); // Don't include the current record TableSelector ts = new TableSelector(ti, PageFlowUtil.set("date"), nextFilter, new Sort("date")); List dates = ts.getArrayList(Date.class); - if (dates.size() > 0) + if (!dates.isEmpty()) enddate = dates.get(0); } @@ -359,7 +359,7 @@ public void clinicalMoveNotification(final String animalId, final String date) // get recipients Set recipients = NotificationService.get().getRecipients(notification, container); - if (recipients.size() == 0) + if (recipients.isEmpty()) { _log.warn("No NIRC recipients set, skipping clinical move notification"); return; @@ -406,7 +406,7 @@ public void sendDeathNotification(final String animalId) throws Exception // get recipients Set recipients = NotificationService.get().getRecipients(new NIRCDeathNotification(), container); - if (recipients.size() == 0) + if (recipients.isEmpty()) { _log.warn("No NIRC recipients set, skipping death notification"); return; @@ -930,7 +930,7 @@ public void sendPregnancyOutcomeNotification(final String animalId, Map() + insertRowsCommand.addRow(new HashMap<>() { { put("code", "NIRC-001"); @@ -853,7 +854,7 @@ public void testClinicalCasesWorkflow() waitForText("Diazepam"); waitForText(animalId); waitForTextToDisappear("Id is required"); - orderGrid = _helper.getExt4GridForFormSection("Medications/Treatments Given"); + _helper.getExt4GridForFormSection("Medications/Treatments Given"); submitForm("Submit Final", "Finalize"); stopImpersonating(); @@ -1099,7 +1100,7 @@ private void verifyOrchardFileGenerated(String animalId) try { // Use Files.walkFileTree to traverse the directory - Files.walkFileTree(orchardFileLocation.toPath(), new SimpleFileVisitor() + Files.walkFileTree(orchardFileLocation.toPath(), new SimpleFileVisitor<>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException