Skip to content
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
3 changes: 1 addition & 2 deletions nirc_ehr/resources/data/housing_reason.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ Sale Sale
Scientific Scientific
Social group introduction breeding Social group introduction breeding
Social group introduction non-breeding Social group introduction non-breeding
Veterinary Veterinary
Veterinary social wounding Veterinary social wounding
Veterinary Treatment Veterinary Treatment
Weaning Weaning
2 changes: 1 addition & 1 deletion nirc_ehr/resources/data/observation_types.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Environmental Change Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_looku
Special Enrichment Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"yes_no_order","forceSelection":true,"displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups yes_no_order value
Preferences Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"preferences","displayField":"value","valueField":"value"} ehr_lookups preferences value
Temperament Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"temperament","displayField":"value","valueField":"value"} ehr_lookups temperament value
BCS {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"bcs_score","forceSelection":true,"displayField":"value","valueField":"value"} ehr_lookups bcs_score value
BCS {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"bcs_score","forceSelection":true,"displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups bcs_score value
CRT {"xtype":"textfield","defaultValue":"1-2"}
Mucous Membrane {"xtype":"textfield","defaultValue":"Pink"}
Pain Score {"xtype":"ldk-numberfield","minValue":0,"maxValue":12}
Expand Down
31 changes: 12 additions & 19 deletions nirc_ehr/resources/data/problem_list_category.tsv
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
value description
Behavioral Behavioral issue or concern. Examples include SIB and fecal smearing.
Cardiac Abnormality Abnormalities associated with the cardiac system. Examples include murmurs and dilated cardiomyopathy.
Dermatopathy Abnormalities associated with the dermal system. Examples include alopecia and moist dermatitis.
Endocrinopathy Abnormalities associated with the endocrine system. Diabetes is an example.
GI-Diarrhea Clinical cases presenting for diarrhea, with or without dehydration.
GI-Other Abnormalities associated with the digestive system, excluding diarrhea. Examples include dental extractions, vomiting, and adenocarcinoma.
MS Abnormality Abnormalities associated with the musculoskeletal system. Examples include osteoarthritis, reactive arthritis, and fractures.
Neurologic Abnormality Abnormalities associated with the neurologic system. Seizures are an example.
OBGYN Condition Abnormalities associated with the female reproductive system. Examples include dystocia, vaginal prolapse, and heavy mense.
Ophthalmic Abnormality Abnormalities associated with the ophthalmic system. Examples include blepharospasm and corneal abrasion.
Other For conditions not covered by any other Master Problem. Uncommonly used.
Protocol Associated The primary abnormality is the result of experimental manipulation. Examples include implant abscess, induced anemia, and induced diabetes mellitus.
Research Support The case was opened for a surgery or activity supporting a research project. Examples include lymph node biopsy and BAL.
Respiratory Abnormality Abnormalities associated with the respiratory system. Examples include URI and pneumonia.
Routine or Preventative care Cases opened for routine or preventative care. Physical exam is an example.
Urogenital Abnormalities associated with the urogenital system. Examples include cystitis, testicular or vulvar trauma, or renal amyloidosis.
Weight Loss Cases opened for weight loss, when the etiology is unknown.
Weight Management
Wound Cases opened for a wound.
Monitoring This is used to track animals that need additional monitoring after the initial problem has resolved. This allows the initial problem to be closed while still keeping an active case open.
Trauma Case opened for some type of trauma.
GI abnormality Abnormalities associated with the digestive system.
Neurologic abnormality Abnormalities associated with the neurologic system.
Dermatologic abnormality Abnormalities associated with the dermal system.
Genitourinary abnormality Abnormalities associated with the genitourinary system.
Circulatory abnormality Abnormalities associated with the circulatory system.
Ocular abnormality Abnormalities associated with the ocular system.
Respiratory abnormality Abnormalities associated with the respiratory system.
Oral abnormality Abnormalities associated with the oral cavity.
Musculoskeletal abnormality Abnormalities associated with the musculoskeletal system.
General abnormality Abnormalities that do not fit into any other category.
Study-related surgery Case opened for a surgery or activity supporting a research project.
78 changes: 67 additions & 11 deletions nirc_ehr/resources/data/problem_list_subcategory.tsv
Original file line number Diff line number Diff line change
@@ -1,19 +1,75 @@
value category
Weight Loss Weight Management
Weight Gain Weight Management
Dental GI-Other
Vomiting GI-Other
Liver GI-Other
Alopecia Behavioral
SIB Behavioral
Other Behavioral
Other behavioral Behavioral
Stereotypy Behavioral
Fecal smear Behavioral
Eye poking Behavioral
Urine drinking Behavioral
Copraphagy Behavioral
Minor Laceration/Abrasion Wound
Digit Amputation Wound
Muscle Wound, Minor Wound
Muscle Wound, Major Wound
Rhabdomyolysis Wound
Skin laceration(s) Trauma
Muscle laceration(s) Trauma
Crushing wounds Trauma
Abrasions Trauma
Fracture(s) Trauma
Puncture wounds Trauma
Traumatic amputation(s) Trauma
SIB (self-injurious behavior) Trauma
Other trauma Trauma
Diarrhea GI abnormality
Undercondition GI abnormality
Dehydration GI abnormality
Bloody Stool GI abnormality
Anorexia GI abnormality
Rectal prolapse GI abnormality
Hepatomegaly GI abnormality
Other GI abnormality GI abnormality
Ataxia Neurologic abnormality
Paralysis/Paresis Neurologic abnormality
Head tilt Neurologic abnormality
Other neurologic abnormality Neurologic abnormality
Penile/preputial lesions Dermatologic abnormality
Dermatitis Dermatologic abnormality
Abscess Dermatologic abnormality
Incisional infection Dermatologic abnormality
Skin mass Dermatologic abnormality
Skin lesion(s) Dermatologic abnormality
Other dermatologic abnormality Dermatologic abnormality
Dystocia Genitourinary abnormality
Vaginal prolapse Genitourinary abnormality
Uterine enlargement Genitourinary abnormality
Endometriosis Genitourinary abnormality
Retained placenta Genitourinary abnormality
Hematuria (bloody urine) Genitourinary abnormality
Other genitourinary abnormality Genitourinary abnormality
AV fistula Circulatory abnormality
Heart murmur Circulatory abnormality
Other circulatory abnormality Circulatory abnormality
Conjunctivitis/ocular discharge Ocular abnormality
Blepharospasm Ocular abnormality
Corneal ulcer Ocular abnormality
Other ocular abnormality Ocular abnormality
Dyspnea/Labored breathing Respiratory abnormality
Purulent nasal discharge Respiratory abnormality
Epistaxis/bloody nasal discharge Respiratory abnormality
Other respiratory abnormality Respiratory abnormality
Tooth abscess Oral abnormality
Gingivitis/periodontal disease Oral abnormality
Foreign body in cheek pouch Oral abnormality
Oral mass Oral abnormality
Other oral abnormality Oral abnormality
Lameness Musculoskeletal abnormality
Other musculoskeletal abnormality Musculoskeletal abnormality
Weight loss General abnormality
Edema General abnormality
Abdominal mass General abnormality
Unresponsive/Down General abnormality
Lethargy General abnormality
Orphan/dam neglect General abnormality
Anemia General abnormality
Thrombocytopenia General abnormality
Other general abnormality General abnormality
Jejunal resection Study-related surgery
Liver biopsy Study-related surgery
Spleen biopsy Study-related surgery
Other study-related surgery Study-related surgery
2 changes: 1 addition & 1 deletion nirc_ehr/resources/queries/study/cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Even
if (ordersInTransaction && ordersInTransaction.length) {
oit = ordersInTransaction;
}
triggerHelper.ensureDailyClinicalObservationOrders(row.Id, row.caseid, row.performedby, qc.RowId, row.taskid, oit);
triggerHelper.ensureDailyClinicalObservationOrders(row.Id, row.caseid, row.date, row.performedby, qc.RowId, row.taskid, oit);
}
}
}
Expand Down
10 changes: 9 additions & 1 deletion nirc_ehr/resources/queries/study/housing.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Even
prevAnimalId = row.Id;
prevDate = row.date;
}
else {
if (row.reason === 'Veterinary Treatment' && !row.remark) {
EHR.Server.Utils.addError(scriptErrors, 'remark', 'Reason For Move - Veterinary Treatment requires a remark.', 'ERROR');
}

if (!helper.isValidateOnly() && row.reason === 'Veterinary Treatment' && (!oldRow || oldRow.reason !== 'Veterinary Treatment')) {
triggerHelper.clinicalMoveNotification(row.Id, row.date);
}
}
});

function onComplete(event, errors, helper){
Expand All @@ -34,7 +43,6 @@ function onComplete(event, errors, helper){
var idsToClose = [];
for (var i = 0; i < updateRows.length; i++) {
if (EHR.Server.Security.getQCStateByLabel(updateRows[i].row.QCStateLabel).PublicData && updateRows[i].row.date) {
updateRows[i].row.date.setHours(12); // Necessary to clear EHR warning
idsToClose.push({
Id: updateRows[i].row.Id,
date: EHR.Server.Utils.datetimeToString(updateRows[i].row.date), //stringify to serialize properly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,10 @@
<column columnName="procedure">
<datatype>integer</datatype>
</column>
<column columnName="orderedby">
<columnTitle>Ordered By</columnTitle>
<datatype>varchar</datatype>
</column>
</columns>
</table>
<table tableName="serology" tableDbType="TABLE">
Expand Down
10 changes: 0 additions & 10 deletions nirc_ehr/resources/web/nirc_ehr/model/sources/BehaviorDefaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,12 @@ EHR.model.DataModelManager.registerMetadata('BehaviorDefaults', {
},
},
'study.clinical_observations': {
category: {
lookup: {
filterArray: [LABKEY.Filter.create('category', 'Behavior')]
}
},
type: {
hidden: true,
defaultValue: 'Behavior'
}
},
'study.observation_order': {
category: {
lookup: {
filterArray: [LABKEY.Filter.create('category', 'Behavior')]
}
},
type: {
hidden: true,
defaultValue: 'Behavior'
Expand Down
5 changes: 0 additions & 5 deletions nirc_ehr/resources/web/nirc_ehr/model/sources/BulkBehavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ EHR.model.DataModelManager.registerMetadata('BulkBehavior', {
},
},
'study.clinical_observations': {
category: {
lookup: {
filterArray: [LABKEY.Filter.create('category', 'Behavior')]
}
},
type: {
hidden: true,
defaultValue: 'Behavior'
Expand Down
3 changes: 3 additions & 0 deletions nirc_ehr/src/org/labkey/nirc_ehr/NIRC_EHRModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
import org.labkey.nirc_ehr.demographics.NecropsyStatusDemographicsProvider;
import org.labkey.nirc_ehr.demographics.ProtocolAssignmentDemographicsProvider;
import org.labkey.nirc_ehr.history.*;
import org.labkey.nirc_ehr.notification.NIRCClinicalMoveNotification;
import org.labkey.nirc_ehr.notification.NIRCDeathNotification;
import org.labkey.nirc_ehr.query.NIRC_EHRUserSchema;
import org.labkey.nirc_ehr.security.NIRCEHRVetTechRole;
import org.labkey.nirc_ehr.table.NIRC_EHRCustomizer;
Expand Down Expand Up @@ -186,6 +188,7 @@ protected void doStartupAfterSpringConfig(ModuleContext moduleContext)

registerDataEntry();
NotificationService.get().registerNotification(new NIRCDeathNotification());
NotificationService.get().registerNotification(new NIRCClinicalMoveNotification());

// Ensure N: is mounted if it's configured, as it's being mapped in via a symlink/shortcut, so we can't
// recognize paths using it based solely on their drive letter and mount just-in-time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public NIRCBulkClinicalFormType(DataEntryFormContext ctx, Module owner)
new NIRCClinicalRemarksFormSection(ctx.getContainer().hasPermission(ctx.getUser(), NIRCEHRVetTechPermission.class),
ctx.getContainer().hasPermission(ctx.getUser(), EHRVeterinarianPermission.class),
ctx.getContainer().hasPermission(ctx.getUser(), AdminPermission.class)),
new NIRCProcedureFormSection(),
new NIRCWeightFormSection(true, true),
new NIRCClinicalObservationsFormSection(false, null),
new NIRCObservationOrdersFormSection("NIRC_DAILY_CLINICAL_OBS_ORDERS", false, null),
new NIRCProcedureFormSection(),
new NIRCTreatmentGivenFormSection(),
new NIRCTreatmentOrderFormSection(),
new NIRCWeightFormSection(true, true),
new NIRCVitalsFormSection(),
new NIRCBloodDrawFormSection(true, true, true)
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ public NIRCCasesFormType(DataEntryFormContext ctx, Module owner)
new NIRCCaseTemplateFormSection("Case Template", "Case Template", "nirc_ehr-casetemplatepanel", Arrays.asList(ClientDependency.supplierFromPath("nirc_ehr/panel/CaseTemplatePanel.js"))),
new NIRCCasesFormPanelSection("Clinical Case", ctx, false),
new NIRCClinicalRemarksFormPanelSection(true, "cases", "Clinical Remarks", ctx, false),
new NIRCProcedureFormSection(true, "cases"),
new NIRCWeightFormSection(true, false, true, "cases"),
new NIRCClinicalObservationsFormSection(true, "cases"),
new NIRCObservationOrdersFormSection(null, true, "cases"),
new NIRCProcedureFormSection(true, "cases"),
new NIRCTreatmentGivenFormSection(true, "cases"),
new NIRCTreatmentOrderFormSection(true, "cases"),
new NIRCWeightFormSection(true, false, true, "cases"),
new NIRCVitalsFormSection(true, "cases"),
new NIRCHousingFormSection(true, true, true, "cases"),
new NIRCBloodDrawFormSection(true, "cases")
new NIRCBloodDrawFormSection(true, "cases"),
new NIRCHousingFormSection(true, true, true, "cases")
));

setTemplateMode(AbstractFormSection.TEMPLATE_MODE.NO_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ public NIRCClinicalRoundsFormType(DataEntryFormContext ctx, Module owner)
new NIRCAnimalDetailsFormSection(),
new NIRCCaseTemplateFormSection("Case Template", "Case Template", "nirc_ehr-casetemplatepanel", Arrays.asList(ClientDependency.supplierFromPath("nirc_ehr/panel/CaseTemplatePanel.js"))),
new NIRCCasesFormPanelSection("Clinical Case", ctx, false),
new NIRCProcedureFormSection(true, "cases"),
new NIRCWeightFormSection(true, false, true, "cases"),
new NIRCClinicalObservationsFormSection(true, "cases"),
new NIRCObservationOrdersFormSection(null, true, "cases"),
new NIRCProcedureFormSection(true, "cases"),
new NIRCTreatmentGivenFormSection(true, "cases"),
new NIRCTreatmentOrderFormSection(true,
"cases"),
new NIRCWeightFormSection(true, false, true, "cases"),
new NIRCVitalsFormSection(true, "cases"),
new NIRCHousingFormSection(true, true, true, "cases"),
new NIRCBloodDrawFormSection(true, "cases")
new NIRCBloodDrawFormSection(true, "cases"),
new NIRCHousingFormSection(true, true, true, "cases")
));

setTemplateMode(AbstractFormSection.TEMPLATE_MODE.NO_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected Collection<FieldKey> getFieldKeys()
keys.add(FieldKey.fromString("cage/cage"));
keys.add(FieldKey.fromString("date"));
keys.add(FieldKey.fromString("reason"));

keys.add(FieldKey.fromString("remark"));
keys.add(FieldKey.fromString("location"));

return keys;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package org.labkey.nirc_ehr.notification;

import org.jetbrains.annotations.Nullable;
import org.labkey.api.data.Container;
import org.labkey.api.ehr.notification.AbstractEHRNotification;
import org.labkey.api.security.User;

import java.util.Date;

public class NIRCClinicalMoveNotification extends AbstractEHRNotification
{
@Override
public String getName()
{
return "Clinical Move Notification";
}

@Override
public String getScheduleDescription()
{
return "Sent immediately when a housing transfer is recorded with the reason 'Veterinary Treatment'";
}

@Override
public @Nullable String getMessageBodyHTML(Container c, User u)
{
return "";
}

@Override
public String getDescription()
{
return "The report sends an alert whenever an animal has a housing transfer and the reason for the move is 'Veterinary Treatment'.";
}

@Override
public String getEmailSubject(Container c)
{
return "Clinical Move Alert: " + getDateTimeFormat(c).format(new Date());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.labkey.nirc_ehr;
package org.labkey.nirc_ehr.notification;

import org.labkey.api.data.Container;
import org.labkey.api.ehr.notification.AbstractEHRNotification;
Expand Down
Loading