Skip to content
Open
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/editable_lookups.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ ehr_lookups mens_score Clinical Menses Types Clinical observation fixed values.
ehr_lookups mucous_membranes Clinical Mucous Membranes Used in clinical observations.
ehr_lookups musculoskeletal_observations Clinical Musculoskeletal Observations Used in clinical observations.
ehr_lookups necropsy_disposition_codes Colony Management Necropsy Disposition Codes
ehr_lookups necropsy_exam_reason Colony Management Necropsy Exam Reason
ehr_lookups necropsy_organ_appearance Colony Management Necropsy Organ Appearance
ehr_lookups necropsy_organ_appearance Colony Management Necropsy Organ Appearance
ehr_lookups necropsy_organ_systems Colony Management Necropsy Organ Systems
ehr_lookups necropsy_physical_condition Colony Management Necropsy Physical Condition
ehr_lookups necropsy_specimen_condition Colony Management Necropsy Specimen Condition
Expand Down
1 change: 0 additions & 1 deletion nirc_ehr/resources/data/lookup_sets.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ mens_score Menses value
mucous_membranes Mucous Membranes value
musculoskeletal_observations Musculoskeletal Observations value
necropsy_disposition_codes Tissue Disposition Codes value title
necropsy_exam_reason Necropsy Reason value title
necropsy_organ_appearance Appearance value title
necropsy_organ_systems Organ Systems value title
necropsy_physical_condition Physical Condition value title
Expand Down
1 change: 0 additions & 1 deletion nirc_ehr/resources/data/lookupsManifest.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ mens_score
mucous_membranes
musculoskeletal_observations
necropsy_disposition_codes
necropsy_exam_reason
necropsy_organ_appearance
necropsy_organ_systems
necropsy_physical_condition
Expand Down
1 change: 0 additions & 1 deletion nirc_ehr/resources/data/lookupsManifestTest.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ mens_score
mucous_membranes
musculoskeletal_observations
necropsy_disposition_codes
necropsy_exam_reason
necropsy_organ_appearance
necropsy_organ_systems
necropsy_physical_condition
Expand Down
4 changes: 2 additions & 2 deletions nirc_ehr/resources/queries/study/cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Even
error = true;
}

if (!helper.isValidateOnly() && row.caseid && row.enddate && (row.enddate != oldRow.enddate)) {
if (!helper.isValidateOnly() && row.caseid && row.enddate && oldRow && (row.enddate != oldRow.enddate)) {
triggerHelper.closeDailyClinicalObs(row.caseid, row.enddate);
}

Expand All @@ -57,7 +57,7 @@ EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Even
if (oldQc.Label != 'In Progress') {
EHR.Server.Utils.addError(errors, null, 'Cannot save a draft copy of a case already opened or in review.', 'ERROR');
}
} else if (row.category == 'Clinical' && (qc.Label == 'Completed' || qc.Label == 'Review Required') && row.caseid && row.Id && row.performedby && row.taskid) {
} else if (row.category == 'Clinical' && (qc.Label == 'Completed' || qc.Label == 'Review Required') && row.caseid && row.Id && row.performedby && row.taskid && !row.enddate) {
var ordersInTransaction = helper.getProperty('ordersInTransaction');
var oit = [];
if (ordersInTransaction && ordersInTransaction.length) {
Expand Down
15 changes: 15 additions & 0 deletions nirc_ehr/resources/queries/study/deaths.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,21 @@ function onUpsert(helper, scriptErrors, row, oldRow) {
console.log(row.id + " is not a valid animal id");
}
}

if(row.QCStateLabel && EHR.Server.Security.getQCStateByLabel(row.QCStateLabel).PublicData) {
var qcstate = helper.getJavaHelper().getQCStateForLabel(row.QCStateLabel).getRowId();

//add/update weight record
var weightRecord = {
Id: row.Id,
date: row.date,
weight: row.deathWeight,
taskid: row.taskid,
qcstate: qcstate,
performedby: row.performedby
};
triggerHelper.upsertWeightRecord(weightRecord);
}
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion nirc_ehr/resources/queries/study/deaths.query.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<column columnName="date">
<columnTitle>Death Date</columnTitle>
</column>
<column columnName="disposition"/>
<column columnName="reason">
<columnTitle>Disposition</columnTitle>
<fk>
Expand All @@ -17,6 +16,9 @@
<fkDisplayColumnName>title</fkDisplayColumnName>
</fk>
</column>
<column columnName="deathWeight">
<columnTitle>Death Weight (kg)</columnTitle>
</column>
<column columnName="remark" />
<column columnName="performedby" />
<column columnName="description">
Expand Down
1 change: 1 addition & 0 deletions nirc_ehr/resources/queries/study/deaths/.qview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<column name="Id/Demographics/species"/>
<column name="date"/>
<column name="reason"/>
<column name="deathWeight"/>
<column name="remark"/>
<column name="performedBy"/>
</columns>
Expand Down
21 changes: 4 additions & 17 deletions nirc_ehr/resources/queries/study/necropsy.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,16 @@ function onUpsert(helper, scriptErrors, row, oldRow) {
(deathIdMap[row.Id].QCStateLabel.toUpperCase() === 'REQUEST: PENDING' ||
deathIdMap[row.Id].QCStateLabel.toUpperCase() === 'REVIEW REQUIRED')) {

if (!row.examReason)
EHR.Server.Utils.addError(scriptErrors, 'examReason', "'Reason for Examination' is required", 'ERROR');
if (!row.specimenCondition)
EHR.Server.Utils.addError(scriptErrors, 'specimenCondition', "'Condition of Specimen' is required", 'ERROR');
if (!row.physicalCondition)
EHR.Server.Utils.addError(scriptErrors, 'physicalCondition', "'Physical Condition' is required", 'ERROR');
if (!row.diagnosis)
EHR.Server.Utils.addError(scriptErrors, 'diagnosis', "'Diagnosis' is required", 'ERROR');
}

if(row.QCStateLabel && EHR.Server.Security.getQCStateByLabel(row.QCStateLabel).PublicData) {
var qcstate = helper.getJavaHelper().getQCStateForLabel(row.QCStateLabel).getRowId();

//add/update weight record
var weightRecord = {
Id: row.Id,
date: row.date,
weight: row.necropsyWeight,
taskid: row.taskid,
qcstate: qcstate,
performedby: row.performedby
};
triggerHelper.upsertWeightRecord(weightRecord);
if (!row.grossAbnormalities)
EHR.Server.Utils.addError(scriptErrors, 'grossAbnormalities', "'Gross Abnormalities' is required", 'ERROR');
if (!row.accessionNumber)
EHR.Server.Utils.addError(scriptErrors, 'accessionNumber', "'Accession Number' is required", 'ERROR');
}
}
}
Expand Down
11 changes: 0 additions & 11 deletions nirc_ehr/resources/queries/study/necropsy.query.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,12 @@
<column columnName="date">
<columnTitle>Exam Date</columnTitle>
</column>
<column columnName="weight"/>
<column columnName="category">
<columnTitle>Category</columnTitle>
</column>
<column columnName="diagnosis">
<columnTitle>Diagnosis</columnTitle>
</column>
<column columnName="examReason">
<fk>
<fkDbSchema>ehr_lookups</fkDbSchema>
<fkTable>necropsy_exam_reason</fkTable>
<fkColumnName>value</fkColumnName>
</fk>
</column>
<column columnName="specimenCondition">
<fk>
<fkDbSchema>ehr_lookups</fkDbSchema>
Expand All @@ -34,9 +26,6 @@
<fkColumnName>value</fkColumnName>
</fk>
</column>
<column columnName="necropsyWeight">
<columnTitle>Weight</columnTitle>
</column>
<column columnName="project">
<isHidden>true</isHidden>
</column>
Expand Down
2 changes: 0 additions & 2 deletions nirc_ehr/resources/queries/study/necropsy/.qview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
<column name="Id/Demographics/species"/>
<column name="date"/>
<column name="accessionNumber"/>
<column name="examReason"/>
<column name="specimenCondition"/>
<column name="physicalCondition"/>
<column name="necropsyWeight"/>
<column name="relevantHistory"/>
<column name="grossAbnormalities"/>
<column name="diagnosis"/>
Expand Down
Loading