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

Added new coding schemes to include "Submit for Review" option when s… #1122

Merged
merged 2 commits into from
Sep 16, 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
2 changes: 2 additions & 0 deletions onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,8 @@ public String toString()
//Added: 3-24-2023 R.Blasa
EHRService.get().registerFormType(new DefaultDataEntryFormFactory(EnvironmentalATPFormType.class, this));

//Added: 9-5-2024 R.Blasa
EHRService.get().registerFormType(new DefaultDataEntryFormFactory(BloodDrawFormType.class, this));

//single section forms
EHRService.get().registerSingleFormOverride(new SingleQueryFormProvider(this, "study", "treatment_order", new MedicationsQueryFormSection("study", "Treatment Orders", "Medication/Treatment Orders")));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Copyright (c) 2018-2019 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.labkey.onprc_ehr.dataentry;

import org.labkey.api.ehr.EHRService;
import org.labkey.api.ehr.dataentry.AnimalDetailsFormSection;
import org.labkey.api.ehr.dataentry.BloodDrawFormSection;
import org.labkey.api.ehr.dataentry.DataEntryFormContext;
import org.labkey.api.ehr.dataentry.DrugAdministrationFormSection;
import org.labkey.api.ehr.dataentry.FormSection;
import org.labkey.api.ehr.dataentry.TaskForm;
import org.labkey.api.ehr.dataentry.TaskFormSection;
import org.labkey.api.ehr.dataentry.WeightFormSection;
import org.labkey.api.module.Module;
import org.labkey.api.view.template.ClientDependency;

import java.util.Arrays;
import java.util.List;
import java.util.function.Supplier;

/**
* User: bimber
* Date: 7/29/13
*/
public class BloodDrawFormType extends TaskForm
{
public static final String NAME = "Blood Draws";

public BloodDrawFormType(DataEntryFormContext ctx, Module owner)
{
this(ctx, owner, Arrays.asList(
new TaskFormSection(),
new AnimalDetailsFormSection(),
new BloodDrawFormSection(false),
new WeightFormSection(),
new DrugAdministrationFormSection(EHRService.FORM_SECTION_LOCATION.Body, DrugAdministrationFormSection.LABEL, null)
));
}

public BloodDrawFormType(DataEntryFormContext ctx, Module owner, List<FormSection> sections)
{
super(ctx, owner, NAME, NAME, "Clinical", sections);

addClientDependency(getAddScheduledTreatmentWindowDependency());
addClientDependency(ClientDependency.supplierFromPath("ehr/form/field/SnomedTreatmentCombo.js"));

addClientDependency(ClientDependency.supplierFromPath("ehr/model/sources/BloodDraw.js"));

for (FormSection s : getFormSections())
{
s.addConfigSource("BloodDraw");
}
setDisplayReviewRequired(true);
}

public Supplier<ClientDependency> getAddScheduledTreatmentWindowDependency()
{
return ClientDependency.supplierFromPath("ehr/window/AddScheduledTreatmentWindow.js");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.labkey.api.ehr.dataentry.AbstractFormSection;
import org.labkey.api.ehr.dataentry.BloodDrawFormSection;
import org.labkey.api.ehr.dataentry.DataEntryFormContext;
import org.labkey.api.ehr.dataentry.DefaultDataEntryFormFactory;
import org.labkey.api.ehr.dataentry.FormSection;
import org.labkey.api.ehr.dataentry.TaskForm;
import org.labkey.api.ehr.dataentry.TaskFormSection;
Expand Down Expand Up @@ -72,12 +73,7 @@ public ClinicalRoundsFormType(DataEntryFormContext ctx, Module owner)
addClientDependency(ClientDependency.supplierFromPath("ehr/model/sources/ClinicalDefaults.js"));
addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/ClinicalRounds.js"));







setDisplayReviewRequired(true);


}
Expand Down
15 changes: 15 additions & 0 deletions onprc_ehr/src/org/labkey/onprc_ehr/dataentry/FlagsFormType.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
import org.labkey.api.security.permissions.Permission;
import org.labkey.security.xml.GroupEnumType;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
* User: bimber
Expand All @@ -46,6 +48,19 @@ public FlagsFormType(DataEntryFormContext ctx, Module owner)
new AnimalDetailsFormSection(),
new SimpleGridPanel("study", "flags", "Flags")
));


}


@Override
protected List<String> getButtonConfigs()
{
List<String> defaultButtons = new ArrayList<>();
defaultButtons.add("REVIEW");
defaultButtons.add("SUBMIT");

return defaultButtons;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public MatingFormType(DataEntryFormContext ctx, Module owner)
new AnimalDetailsFormSection(),
new SimpleGridPanel("study", "matings", "Matings")
));

setDisplayReviewRequired(true);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public MedSignoffFormType(DataEntryFormContext ctx, Module owner)
addSection(new MiscChargesFormSection(EHRService.FORM_SECTION_LOCATION.Body));
}

setDisplayReviewRequired(true);

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public MensFormType(DataEntryFormContext ctx, Module owner)

addClientDependency(ClientDependency.supplierFromPath("ehr/model/sources/Menses.js"));

setDisplayReviewRequired(true);

for (FormSection s : getFormSections())
{
s.addConfigSource("Task");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public PregnancyConfirmationFormType(DataEntryFormContext ctx, Module owner)
addClientDependency(ClientDependency.supplierFromPath("ehr/model/sources/ClinicalDefaults.js"));
addClientDependency(ClientDependency.supplierFromPath("ehr/model/sources/PregnancyConfirmation.js"));

setDisplayReviewRequired(true);

for (FormSection s : getFormSections())
{
s.addConfigSource("Task");
Expand Down
2 changes: 2 additions & 0 deletions onprc_ehr/src/org/labkey/onprc_ehr/dataentry/TBFormType.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public TBFormType(DataEntryFormContext ctx, Module owner)
new AnimalDetailsFormSection(),
new TBProcedureFormSection()
));

setDisplayReviewRequired(true);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public TBTestObservationFormType(DataEntryFormContext ctx, Module owner)

addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/form/field/TB_TST_Scores_Type.js"));


setDisplayReviewRequired(true);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public TreatmentsFormType(DataEntryFormContext ctx, Module owner)
s.addConfigSource("TreatmentDrugsClinical");

}

setDisplayReviewRequired(true);

addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/model/sources/TreatmentDrugsClinical.js"));
//Added 4-24-2024 R. Blasa
addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/window/FormTemplateWindow.js"));
Expand Down
11 changes: 11 additions & 0 deletions onprc_ehr/src/org/labkey/onprc_ehr/dataentry/WeightFormType.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.labkey.api.ehr.dataentry.TaskFormSection;
import org.labkey.api.ehr.dataentry.WeightFormSection;
import org.labkey.api.ehr.dataentry.DrugAdministrationFormSection;
import org.labkey.api.ehr.security.EHRClinicalEntryPermission;
import org.labkey.api.module.Module;
import org.labkey.api.security.permissions.AdminPermission;
import org.labkey.api.view.template.ClientDependency;
Expand Down Expand Up @@ -59,6 +60,16 @@ public WeightFormType(DataEntryFormContext ctx, Module owner)
s.addConfigSource("Task");
s.addConfigSource("Weight");
}
setDisplayReviewRequired(true);
}

@Override
protected boolean canInsert()
{
if (!getCtx().getContainer().hasPermission(getCtx().getUser(), EHRClinicalEntryPermission.class))
return false;

return super.canInsert();
}

}