diff --git a/nirc_ehr/resources/data/editable_lookups.tsv b/nirc_ehr/resources/data/editable_lookups.tsv
index 23c7d2ac..7f3ba907 100644
--- a/nirc_ehr/resources/data/editable_lookups.tsv
+++ b/nirc_ehr/resources/data/editable_lookups.tsv
@@ -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
diff --git a/nirc_ehr/resources/data/lookup_sets.tsv b/nirc_ehr/resources/data/lookup_sets.tsv
index 749d16c0..cea86af6 100644
--- a/nirc_ehr/resources/data/lookup_sets.tsv
+++ b/nirc_ehr/resources/data/lookup_sets.tsv
@@ -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
diff --git a/nirc_ehr/resources/data/lookupsManifest.tsv b/nirc_ehr/resources/data/lookupsManifest.tsv
index ebf0d0c3..936ec52a 100644
--- a/nirc_ehr/resources/data/lookupsManifest.tsv
+++ b/nirc_ehr/resources/data/lookupsManifest.tsv
@@ -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
diff --git a/nirc_ehr/resources/data/lookupsManifestTest.tsv b/nirc_ehr/resources/data/lookupsManifestTest.tsv
index 8784b08b..fde39961 100644
--- a/nirc_ehr/resources/data/lookupsManifestTest.tsv
+++ b/nirc_ehr/resources/data/lookupsManifestTest.tsv
@@ -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
diff --git a/nirc_ehr/resources/queries/study/cases.js b/nirc_ehr/resources/queries/study/cases.js
index 02dc3b8b..a8e3b6c3 100644
--- a/nirc_ehr/resources/queries/study/cases.js
+++ b/nirc_ehr/resources/queries/study/cases.js
@@ -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);
}
@@ -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) {
diff --git a/nirc_ehr/resources/queries/study/deaths.js b/nirc_ehr/resources/queries/study/deaths.js
index c6a89eea..03b9d2df 100644
--- a/nirc_ehr/resources/queries/study/deaths.js
+++ b/nirc_ehr/resources/queries/study/deaths.js
@@ -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);
+ }
}
}
}
diff --git a/nirc_ehr/resources/queries/study/deaths.query.xml b/nirc_ehr/resources/queries/study/deaths.query.xml
index f16eebcd..35c2e6ae 100644
--- a/nirc_ehr/resources/queries/study/deaths.query.xml
+++ b/nirc_ehr/resources/queries/study/deaths.query.xml
@@ -7,7 +7,6 @@
Death Date
-
Disposition
@@ -17,6 +16,9 @@
title
+
+ Death Weight (kg)
+
diff --git a/nirc_ehr/resources/queries/study/deaths/.qview.xml b/nirc_ehr/resources/queries/study/deaths/.qview.xml
index d04d768b..fdc063c2 100644
--- a/nirc_ehr/resources/queries/study/deaths/.qview.xml
+++ b/nirc_ehr/resources/queries/study/deaths/.qview.xml
@@ -7,6 +7,7 @@
+
diff --git a/nirc_ehr/resources/queries/study/drug/.qview.xml b/nirc_ehr/resources/queries/study/drug/.qview.xml
index 032e214c..3b722685 100644
--- a/nirc_ehr/resources/queries/study/drug/.qview.xml
+++ b/nirc_ehr/resources/queries/study/drug/.qview.xml
@@ -8,9 +8,7 @@
-
-
@@ -22,7 +20,7 @@
-
+
\ No newline at end of file
diff --git a/nirc_ehr/resources/queries/study/drug/Behavior.qview.xml b/nirc_ehr/resources/queries/study/drug/Behavior.qview.xml
new file mode 100644
index 00000000..a9769cb8
--- /dev/null
+++ b/nirc_ehr/resources/queries/study/drug/Behavior.qview.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nirc_ehr/resources/queries/study/necropsy.js b/nirc_ehr/resources/queries/study/necropsy.js
index 05522f36..bbfa3878 100644
--- a/nirc_ehr/resources/queries/study/necropsy.js
+++ b/nirc_ehr/resources/queries/study/necropsy.js
@@ -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');
}
}
}
diff --git a/nirc_ehr/resources/queries/study/necropsy.query.xml b/nirc_ehr/resources/queries/study/necropsy.query.xml
index 73cd38fd..35290a87 100644
--- a/nirc_ehr/resources/queries/study/necropsy.query.xml
+++ b/nirc_ehr/resources/queries/study/necropsy.query.xml
@@ -6,20 +6,12 @@
Exam Date
-
Category
Diagnosis
-
-
- ehr_lookups
- necropsy_exam_reason
- value
-
-
ehr_lookups
@@ -34,9 +26,6 @@
value
-
- Weight
-
true
diff --git a/nirc_ehr/resources/queries/study/necropsy/.qview.xml b/nirc_ehr/resources/queries/study/necropsy/.qview.xml
index b1af3175..2a4be61a 100644
--- a/nirc_ehr/resources/queries/study/necropsy/.qview.xml
+++ b/nirc_ehr/resources/queries/study/necropsy/.qview.xml
@@ -7,10 +7,8 @@
-
-
diff --git a/nirc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml b/nirc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml
index 91ac8907..bc4e8f73 100644
--- a/nirc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml
+++ b/nirc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml
@@ -33,6 +33,7 @@
Alias
+ Records alternative identifiers and aliases assigned to individual primates within the facility.
varchar
@@ -59,6 +60,7 @@
Arrival
+ Tracks the arrival of primates into the research facility, including source, acquisition type, and associated documentation.
entityid
@@ -110,6 +112,7 @@
Project Assignments
+ Records project assignments for individual primates, linking animals to specific research projects with start and end dates.
varchar
@@ -134,6 +137,7 @@
Biopsy
+ Documents biopsy procedures performed on primates, including tissue type and associated pathology reports.
varchar
@@ -160,6 +164,7 @@
Protocol Assignments
+ Tracks the assignment of primates to IACUC-approved research protocols with effective date ranges.
varchar
@@ -183,6 +188,7 @@
Birth
+ Records birth events for primates born within the facility, including location and associated protocols.
entityid
@@ -216,6 +222,7 @@
Blood Draws
+ Tracks blood draw procedures performed on primates, including volume, sample type, tube type, and purpose.
varchar
@@ -262,6 +269,7 @@
Breeder
+ Records breeding evaluations and reproductive assessments for primates in the colony breeding program.
varchar
@@ -292,6 +300,7 @@
Clinical/Behavior Observations
+ Documents clinical and behavioral observations recorded during routine monitoring and veterinary assessments of primates.
varchar
@@ -332,6 +341,7 @@
Clinical Remarks
+ Stores veterinary clinical remarks and SOAP notes associated with primate health assessments and case management.
varchar
@@ -388,6 +398,7 @@
Demographics
+ Contains core demographic information for each primate, including species, sex, parentage, birth and death dates, and colony status.
entityid
@@ -462,6 +473,7 @@
Departure
+ Records the departure of primates from the research facility, including destination information.
entityid
@@ -487,6 +499,7 @@
Deaths
+ Documents primate deaths, including date, cause of death, and terminal body weight.
entityid
@@ -508,10 +521,14 @@
varchar
+
+ double
+
Exemptions
+ Tracks approved exemptions from standard care or procedural requirements for individual primates.
varchar
@@ -560,9 +577,11 @@
Animal Record Flags
+ Stores active record flags and status indicators applied to individual primates for colony management purposes.
Histopathology
+ Records histopathology findings from tissue examinations performed on primates, including diagnoses and associated reports.
varchar
@@ -614,9 +633,11 @@
Historical Other
+ Captures miscellaneous historical health and research records for primates that do not fit other specific categories.
Housing
+ Tracks housing assignments and location transfers for primates within the research facility.
varchar
@@ -677,9 +698,11 @@
Inbreeding Coefficients
+ Records calculated inbreeding coefficients for primates to support genetic management of the colony.
Necropsy
+ Documents necropsy (postmortem) examination findings for primates, including gross and histological observations, diagnoses, and reports.
varchar
@@ -693,9 +716,6 @@
http://cpas.labkey.com/Study#VisitDate
http://cpas.labkey.com/Study#VisitDate
-
- double
-
Category
varchar
@@ -704,10 +724,6 @@
Accession Number
varchar
-
- Reason for Examination
- varchar
-
Condition of Specimen
varchar
@@ -744,6 +760,7 @@
Gross Pathology
+ Records gross pathology findings observed during necropsy examinations of primates.
varchar
@@ -768,6 +785,7 @@
Tissue Disposition
+ Tracks the disposition of tissue samples collected during necropsy of primates.
varchar
@@ -791,6 +809,7 @@
Pairings
+ Records social pairing and group housing arrangements for primates, including formation type, compatibility observations, and separation details.
varchar
@@ -843,6 +862,7 @@
Physical Exam
+ Documents physical examination findings and measurements recorded during veterinary assessments of primates.
varchar
@@ -878,6 +898,7 @@
Procedures
+ Records research and veterinary procedures performed on primates, including procedure type, category, and associated case information.
varchar
@@ -918,6 +939,7 @@
Procedure Orders
+ Tracks scheduled procedure orders for primates, including ordering veterinarian and scheduling windows.
varchar
@@ -957,6 +979,7 @@
Serology
+ Records serological test results for primates, used for infectious disease screening and colony health monitoring.
varchar
@@ -980,6 +1003,7 @@
Problem List
+ Maintains the active and historical problem list for individual primates, supporting ongoing veterinary case management.
varchar
@@ -1006,6 +1030,7 @@
Drug Administration
+ Records drug and medication administrations for primates, including dosage, route, concentration, and ordering clinician.
varchar
@@ -1080,6 +1105,7 @@
Treatment Cases
+ Tracks veterinary treatment cases for primates, supporting clinical case management from opening through resolution.
varchar
@@ -1145,6 +1171,7 @@
Treatment Orders
+ Stores standing treatment orders for primates, including medication details, dosing frequency, and prescribing veterinarian.
varchar
@@ -1268,9 +1295,11 @@
Vital Signs
+ Records vital sign measurements for primates, including temperature, heart rate, respiration rate, blood pressure, and pulse oximetry.
Weight
+ Tracks body weight measurements for primates, used for health monitoring and drug dosage calculations.
varchar
diff --git a/nirc_ehr/resources/reports/additionalReports.tsv b/nirc_ehr/resources/reports/additionalReports.tsv
index af1b5ab5..98acfbe0 100644
--- a/nirc_ehr/resources/reports/additionalReports.tsv
+++ b/nirc_ehr/resources/reports/additionalReports.tsv
@@ -13,7 +13,8 @@ notes Colony Management query Notes true study notes false false qcstate/pu
activeClinTreatmentOrders Clinical query Active Clinical Medication Orders true study treatment_order Clinical Active Treatment Orders date false false qcstate/publicdata This report contains the treatment orders entered for each animal
activeBehaviorTreatmentOrders Behavior query Active Behavior Medication Orders true study treatment_order Behavior Active Treatment Orders date false false qcstate/publicdata This report contains the treatment orders entered for each animal
allTreatments Clinical query All Treatment Orders true study treatment_order false false qcstate/publicdata This report shows all treatment orders
-behTreatments Behavior query All Behavior Medication Orders true study treatment_order behavior false false qcstate/publicdata This report shows all treatment orders
+behTreatments Behavior query All Behavior Medication Orders true study treatment_order behavior false false qcstate/publicdata This report shows all behavior treatment orders
+behDrug Behavior query Behavior Drug Administration true study drug Behavior false false qcstate/publicdata This report shows all behavior drug administrations
FileRepository General js File Repository true study FileRepository false false qcstate/publicdata File Repository for uploading and viewing animal related files
observationSchedule Daily Reports js Today's Observation Schedule true study observationSchedule date false false qcstate/publicdata This report contains a list of today's treatments to be administered
activeClinicalObservationOrders Clinical query Active Clinical Observation Orders true study observation_order Active Clinical Orders date false false qcstate/publicdata This report contains a list of today's treatments to be administered
diff --git a/nirc_ehr/resources/views/clinicalHistoryExport.html b/nirc_ehr/resources/views/clinicalHistoryExport.html
new file mode 100644
index 00000000..8e15e246
--- /dev/null
+++ b/nirc_ehr/resources/views/clinicalHistoryExport.html
@@ -0,0 +1,82 @@
+
\ No newline at end of file
diff --git a/nirc_ehr/resources/views/clinicalHistoryExport.view.xml b/nirc_ehr/resources/views/clinicalHistoryExport.view.xml
new file mode 100644
index 00000000..35f09e39
--- /dev/null
+++ b/nirc_ehr/resources/views/clinicalHistoryExport.view.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/nirc_ehr/resources/views/necropsy.html b/nirc_ehr/resources/views/necropsy.html
index 5b51a70d..2d62d51b 100644
--- a/nirc_ehr/resources/views/necropsy.html
+++ b/nirc_ehr/resources/views/necropsy.html
@@ -59,7 +59,7 @@
schemaName: 'study',
queryName: 'deaths',
filterArray: filterArray,
- columns: 'Id,Id/demographics/species,date,reason,Id/lastProtocol/protocol,Id/lastProject/project',
+ columns: 'Id,Id/demographics/species,date,reason,deathWeight,Id/lastProtocol/protocol,Id/lastProject/project',
},
title: 'Death',
renderTo: 'animalDeath',
diff --git a/nirc_ehr/resources/web/nirc_ehr/model/sources/DeathNecropsy.js b/nirc_ehr/resources/web/nirc_ehr/model/sources/DeathNecropsy.js
index 4be79f4c..1db8b70c 100644
--- a/nirc_ehr/resources/web/nirc_ehr/model/sources/DeathNecropsy.js
+++ b/nirc_ehr/resources/web/nirc_ehr/model/sources/DeathNecropsy.js
@@ -12,12 +12,18 @@ EHR.model.DataModelManager.registerMetadata('DeathNecropsy', {
dateFormat: 'Y-m-d',
timeFormat: 'H:i'
},
+ },
+ deathWeight: {
+ label: 'Weight (kg)',
+ allowBlank: false,
+ nullable: false,
+ },
+ reason: {
+ allowBlank: false,
+ nullable: false,
}
},
'study.necropsy': {
- necropsyWeight: {
- label: 'Weight (kg)'
- },
date: {
label: 'Exam Date',
xtype: 'xdatetime',
diff --git a/nirc_ehr/resources/web/nirc_ehr/model/sources/NIRCDefault.js b/nirc_ehr/resources/web/nirc_ehr/model/sources/NIRCDefault.js
index 15cdd8bd..eee4923b 100644
--- a/nirc_ehr/resources/web/nirc_ehr/model/sources/NIRCDefault.js
+++ b/nirc_ehr/resources/web/nirc_ehr/model/sources/NIRCDefault.js
@@ -14,6 +14,10 @@ EHR.model.DataModelManager.registerMetadata('Default', {
allowBlank: true,
defaultValue: LABKEY.Security.currentUser.id,
getInitialValue: function (v, rec) {
+ if (Number.isInteger(v)){
+ return v;
+ }
+
return LABKEY.Security.currentUser.id;
},
editorConfig: {
@@ -136,6 +140,10 @@ EHR.model.DataModelManager.registerMetadata('Default', {
sort: 'Type,DisplayName'
},
getInitialValue: function (v, rec) {
+ if (Number.isInteger(v)){
+ return v;
+ }
+
return LABKEY.Security.currentUser.id;
},
editorConfig: {
diff --git a/nirc_ehr/resources/web/nirc_ehr/nircReports.js b/nirc_ehr/resources/web/nirc_ehr/nircReports.js
index ad3f1e12..9a7aab31 100644
--- a/nirc_ehr/resources/web/nirc_ehr/nircReports.js
+++ b/nirc_ehr/resources/web/nirc_ehr/nircReports.js
@@ -181,7 +181,7 @@ EHR.reports.clinicalHistory = function(panel, tab, showActionsBtn, includeAll){
});
toAdd.push({
- xtype: 'ehr-clinicalhistorypanel',
+ xtype: 'nirc_ehr-clinicalhistorypanel',
border: true,
subjectId: s,
autoLoadRecords: true,
diff --git a/nirc_ehr/resources/web/nirc_ehr/panel/CaseHistoryPanel.js b/nirc_ehr/resources/web/nirc_ehr/panel/CaseHistoryPanel.js
new file mode 100644
index 00000000..517352c6
--- /dev/null
+++ b/nirc_ehr/resources/web/nirc_ehr/panel/CaseHistoryPanel.js
@@ -0,0 +1,19 @@
+
+/**
+ * @cfg caseId
+ * @cfg maxGridHeight
+ * @cfg autoLoadRecords
+ */
+Ext4.define('NIRC_EHR.panel.CaseHistoryPanel', {
+ extend: 'NIRC_EHR.panel.ClinicalHistoryPanel',
+ alias: 'widget.nirc_ehr-casehistorypanel',
+
+ getStoreConfig: function(){
+ return {
+ type: 'ehr-clinicalhistorystore',
+ containerPath: this.containerPath,
+ actionName: 'getCaseHistory',
+ sorters: [{property: 'group'}, {property: 'timeString'}]
+ };
+ }
+});
diff --git a/nirc_ehr/resources/web/nirc_ehr/panel/ClinicalHistoryPanel.js b/nirc_ehr/resources/web/nirc_ehr/panel/ClinicalHistoryPanel.js
new file mode 100644
index 00000000..50f151d9
--- /dev/null
+++ b/nirc_ehr/resources/web/nirc_ehr/panel/ClinicalHistoryPanel.js
@@ -0,0 +1,144 @@
+
+/**
+ * @cfg subjectId
+ * @cfg minDate
+ * @cfg maxDate
+ * @cfg maxGridHeight
+ * @cfg autoLoadRecords
+ * @cfg hideExportBtn
+ * @cfg sortMode
+ * @cfg checkedItems
+ * @cfg showMaxDate
+ * @cfg redacted
+ * @cfg printMode
+ */
+Ext4.define('NIRC_EHR.panel.ClinicalHistoryPanel', {
+ extend: 'EHR.panel.ClinicalHistoryPanel',
+ alias: 'widget.nirc_ehr-clinicalhistorypanel',
+
+ showMaxDate: false,
+
+ getGridConfig: function(){
+ return {
+ xtype: 'grid',
+ border: this.printMode ? false : true,
+ minHeight: 100,
+ minWidth: this.width - 50,
+ cls: 'ldk-grid',
+ maxHeight: this.maxGridHeight,
+ height: this.gridHeight,
+ hideHeaders: true,
+ deferEmptyText: true,
+ viewConfig : {
+ emptyText: this.minDate ? 'No records found since: ' + Ext4.util.Format.date(this.minDate, LABKEY.extDefaultDateFormat): 'There are no records to display',
+ deferEmptyText: true,
+ enableTextSelection: true,
+ border: false,
+ stripeRows : true
+ },
+ columns: this.getColumnConfig(),
+ features: [this.getGroupingFeature()],
+ store: this.getStoreConfig(),
+ itemId: 'gridPanel',
+ width: this.width,
+ subjectId: this.subjectId,
+ caseId: this.caseId,
+ minDate: this.minDate,
+ maxDate: this.maxDate,
+ tbar: this.hideGridButtons ? null : {
+ border: true,
+ items: [{
+ xtype: 'datefield',
+ fieldLabel: 'Min Date',
+ itemId: 'minDate',
+ labelWidth: 80,
+ width: 200,
+ value: this.minDate
+ },{
+ xtype: 'datefield',
+ fieldLabel: 'Max Date',
+ itemId: 'maxDate',
+ labelWidth: 80,
+ width: 200,
+ hidden: this.showMaxDate,
+ value: this.maxDate
+ },{
+ xtype: 'button',
+ text: 'Reload',
+ handler: function(btn){
+ var panel = btn.up('ehr-clinicalhistorypanel');
+ panel.doReload();
+ }
+ },{
+ text: 'Show/Hide Types',
+ scope: this,
+ handler: function(btn){
+ this.showFilterPanel();
+ }
+ },{
+ text: 'Collapse All',
+ hidden: this.printMode,
+ collapsed: false,
+ handler: function(btn){
+ var grid = btn.up('grid');
+ var feature = grid.getView().getFeature('historyGrouping');
+
+ if (btn.collapsed){
+ feature.expandAll();
+ btn.setText('Collapse All');
+ }
+ else {
+ feature.collapseAll();
+ btn.setText('Expand All')
+ }
+
+ btn.collapsed = !btn.collapsed;
+ }
+ },{
+ hidden: this.printMode,
+ text: (this.sortMode == 'type' ? 'Group By Date' : 'Group By Type'),
+ sortMode: this.sortMode == 'type' ? 'date' : 'type',
+ scope: this,
+ handler: function(btn){
+ //toggle the button
+ if (btn.sortMode == 'type'){
+ btn.setText('Group By Date');
+ btn.sortMode = 'date';
+ this.changeMode('type');
+ }
+ else {
+ btn.setText('Group By Type');
+ btn.sortMode = 'type';
+ this.changeMode('date');
+ }
+ }
+ },{
+ text: 'Print Version',
+ hidden: this.hideExportBtn || this.printMode,
+ scope: this,
+ handler: function(btn){
+ var params = {
+ hideGridButtons: true
+ };
+ if (this.subjectId)
+ params.subjectId = [this.subjectId];
+ if (this.caseId)
+ params.caseId = this.caseId;
+ if (this.minDate)
+ params.minDate = Ext4.util.Format.date(this.minDate, LABKEY.extDefaultDateFormat);
+ if (this.maxDate)
+ params.maxDate = Ext4.util.Format.date(this.maxDate, LABKEY.extDefaultDateFormat);
+ if (this.sortMode)
+ params.sortMode = this.sortMode;
+ if (this.checkedItems && this.checkedItems.length)
+ params.checkedItems = this.checkedItems.join(';');
+
+ var url = LABKEY.ActionURL.buildURL('nirc_ehr', 'clinicalHistoryExport', null, params);
+ window.open(url, '_blank');
+ }
+ }]
+ }
+ };
+ }
+});
+
diff --git a/nirc_ehr/resources/web/nirc_ehr/panel/NarrowSnapshotPanel.js b/nirc_ehr/resources/web/nirc_ehr/panel/NarrowSnapshotPanel.js
new file mode 100644
index 00000000..15d1f4c3
--- /dev/null
+++ b/nirc_ehr/resources/web/nirc_ehr/panel/NarrowSnapshotPanel.js
@@ -0,0 +1,37 @@
+
+Ext4.define('NIRC_EHR.panel.NarrowSnapshotPanel', {
+ extend: 'NIRC_EHR.panel.SnapshotPanel',
+ alias: 'widget.nirc_ehr-narrowsnapshotpanel',
+
+ showLocationDuration: false,
+ showExtendedInformation: true,
+
+ minWidth: 800,
+
+ initComponent: function(){
+
+ this.defaultLabelWidth = 120;
+ this.callParent();
+ },
+
+ getItems: function() {
+ var items = this.getBaseItems();
+
+ //combine the first and second columns
+ var secondCol = items[0].items[1].items[1];
+ var extended = this.getExtendedItems();
+
+ var index = items[0].items[1].items.indexOf(secondCol);
+ if (index !== -1) {
+ items[0].items[1].items = items[0].items[1].items.splice(index, 1);
+ }
+
+ items[0].items[1].items = items[0].items[1].items.concat(extended[0].items[1].items[0]);
+ items[0].items[1].items[1].items = items[0].items[1].items[1].items.concat(extended[0].items[1].items[1].items[0]);
+
+ items[0].items[1].items[0].columnWidth = 0.45;
+ items[0].items[1].items[1].columnWidth = 0.55;
+
+ return items;
+ }
+});
\ No newline at end of file
diff --git a/nirc_ehr/resources/web/nirc_ehr/panel/SnapshotPanel.js b/nirc_ehr/resources/web/nirc_ehr/panel/SnapshotPanel.js
index 708d6b57..16bc553c 100644
--- a/nirc_ehr/resources/web/nirc_ehr/panel/SnapshotPanel.js
+++ b/nirc_ehr/resources/web/nirc_ehr/panel/SnapshotPanel.js
@@ -291,7 +291,7 @@ Ext4.define('NIRC_EHR.panel.SnapshotPanel', {
var html = '';
var sep = '';
Ext4.each(animals, function(id) {
- html += sep + '' + LABKEY.Utils.encodeHtml(id) + '';
+ html += sep + '' + encodeURIComponent(id) + '';
sep = ', ';
});
toSet['cagemates'] = html;
@@ -346,4 +346,44 @@ Ext4.define('NIRC_EHR.panel.SnapshotPanel', {
}
}]);
},
+
+ appendParentageResults: function(toSet, results){
+ if (results){
+ var parentMap = {};
+ Ext4.each(results, function(row){
+ var parent = row.parent;
+ var relationship = row.relationship;
+
+ if (parent && relationship){
+ var text = LABKEY.Utils.encodeHtml(relationship + ' - ' + parent);
+
+ if (!parentMap[text])
+ parentMap[text] = [];
+
+ var method = row.method;
+ if (method){
+ parentMap[text].push(LABKEY.Utils.encodeHtml(method));
+ }
+ }
+ }, this);
+
+ var values = [];
+ Ext4.Array.forEach(Ext4.Object.getKeys(parentMap).sort(), function(text){
+ parentMap[text] = Ext4.unique(parentMap[text]);
+ var subject = text;
+ var textParts = text.split(' - ');
+ if (textParts.length > 1){
+ subject = textParts[1];
+ }
+
+ values.push('' + encodeURIComponent(subject) + '');
+ }, this);
+
+ if (values.length)
+ toSet['parents'] = values.join('
');
+ }
+ else {
+ toSet['parents'] = 'No data';
+ }
+ },
});
\ No newline at end of file
diff --git a/nirc_ehr/resources/web/nirc_ehr/window/NIRCCaseHistoryWindow.js b/nirc_ehr/resources/web/nirc_ehr/window/NIRCCaseHistoryWindow.js
index 16e82a21..b95e5db7 100644
--- a/nirc_ehr/resources/web/nirc_ehr/window/NIRCCaseHistoryWindow.js
+++ b/nirc_ehr/resources/web/nirc_ehr/window/NIRCCaseHistoryWindow.js
@@ -30,7 +30,7 @@ Ext4.define('NIRC_EHR.window.CaseHistoryWindow', {
items[1].items[0].title = 'Entire History';
items[1].items.splice(1, 0, {
title: 'Case History',
- xtype: 'ehr-casehistorypanel',
+ xtype: 'nirc_ehr-casehistorypanel',
containerPath: this.containerPath,
border: true,
width: 1180,
diff --git a/nirc_ehr/resources/web/nirc_ehr/window/NIRCClinicalHistoryWindow.js b/nirc_ehr/resources/web/nirc_ehr/window/NIRCClinicalHistoryWindow.js
index e2974882..76c53870 100644
--- a/nirc_ehr/resources/web/nirc_ehr/window/NIRCClinicalHistoryWindow.js
+++ b/nirc_ehr/resources/web/nirc_ehr/window/NIRCClinicalHistoryWindow.js
@@ -45,7 +45,7 @@ Ext4.define('NIRC_EHR.window.ClinicalHistoryWindow', {
},{
xtype: 'tabpanel',
items: [{
- xtype: 'ehr-clinicalhistorypanel',
+ xtype: 'nirc_ehr-clinicalhistorypanel',
title: 'History',
border: true,
width: 1230,
diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/NIRC_EHRModule.java b/nirc_ehr/src/org/labkey/nirc_ehr/NIRC_EHRModule.java
index badf9d5a..f2413357 100644
--- a/nirc_ehr/src/org/labkey/nirc_ehr/NIRC_EHRModule.java
+++ b/nirc_ehr/src/org/labkey/nirc_ehr/NIRC_EHRModule.java
@@ -101,10 +101,14 @@ protected void init()
ehrService.registerClientDependency(ClientDependency.supplierFromPath("nirc_ehr/window/NIRCRecentRemarksWindow.js"), this);
ehrService.registerClientDependency(ClientDependency.supplierFromPath("ehr/sharedReports.js"), this);
ehrService.registerClientDependency(ClientDependency.supplierFromPath("nirc_ehr/panel/SnapshotPanel.js"), this);
+ ehrService.registerClientDependency(ClientDependency.supplierFromPath("nirc_ehr/panel/NarrowSnapshotPanel.js"), this);
ehrService.registerClientDependency(ClientDependency.supplierFromPath("nirc_ehr/panel/BloodSummaryPanel.js"), this);
ehrService.registerClientDependency(ClientDependency.supplierFromPath("nirc_ehr/panel/AnimalDetailsPanel.js"), this);
ehrService.registerClientDependency(ClientDependency.supplierFromPath("nirc_ehr/window/NIRCClinicalHistoryWindow.js"), this);
ehrService.registerClientDependency(ClientDependency.supplierFromPath("nirc_ehr/window/NIRCCaseHistoryWindow.js"), this);
+ ehrService.registerClientDependency(ClientDependency.supplierFromPath("nirc_ehr/panel/ClinicalHistoryPanel.js"), this);
+ ehrService.registerClientDependency(ClientDependency.supplierFromPath("nirc_ehr/panel/CaseHistoryPanel.js"), this);
+
}
@Override
diff --git a/nirc_ehr/test/src/org.labkey.test/tests.nirc_ehr/NIRC_EHRTest.java b/nirc_ehr/test/src/org.labkey.test/tests.nirc_ehr/NIRC_EHRTest.java
index 00e81d9b..2c0d4a67 100644
--- a/nirc_ehr/test/src/org.labkey.test/tests.nirc_ehr/NIRC_EHRTest.java
+++ b/nirc_ehr/test/src/org.labkey.test/tests.nirc_ehr/NIRC_EHRTest.java
@@ -160,7 +160,7 @@ public void importFolderByPath(File path, String containerPath, int finishedJobs
{
setPipelineRoot(path.getPath(), false);
- beginAt(WebTestHelper.getBaseURL() + "/pipeline-status/" + containerPath + "/begin.view");
+ beginAt(WebTestHelper.getBaseURL() + "/" + containerPath + "/pipeline-status-begin.view");
clickButton("Process and Import Data", defaultWaitForPage);
_fileBrowserHelper.expandFileBrowserRootNode();
_fileBrowserHelper.checkFileBrowserFileCheckbox("folder.xml");
@@ -358,6 +358,18 @@ private void addNIRCEhrLinks()
(new PortalHelper(this)).addWebPart("NIRC EHR Links");
}
+ @Override
+ protected String getMale()
+ {
+ return "3";
+ }
+
+ @Override
+ protected String getFemale()
+ {
+ return "2";
+ }
+
@Test
public void testSetup()
{
@@ -841,7 +853,8 @@ public void testDeathNecropsyForm() throws IOException, CommandException
setFormElement(Locator.name("Id"), aliveAnimalId);
_ext4Helper.selectComboBoxItem("Disposition:", "Euthaniasia (project)");
-
+ waitForElement(Locator.name("deathWeight"));
+ setFormElement(Locator.name("deathWeight"), "23");
Assert.assertFalse(isElementPresent(Locator.linkWithText("Submit Necropsy for Review")));
Assert.assertFalse(isElementPresent(Locator.linkWithText("Submit Final")));
submitForm("Submit Death", "Confirm");
@@ -865,12 +878,10 @@ public void testDeathNecropsyForm() throws IOException, CommandException
beginAt(url);
Ext4GridRef necropsy = _helper.getExt4GridForFormSection("Necropsy");
necropsy.expand();
- waitForElement(Locator.name("necropsyWeight"));
- setFormElement(Locator.name("necropsyWeight"), "23");
scrollIntoView(Locator.linkContainingText("More Actions"));
_ext4Helper.selectComboBoxItem("Physical Condition:", "Excellent");
- _ext4Helper.selectComboBoxItem("Reason for Examination:", "Natural Death");
_ext4Helper.selectComboBoxItem("Condition of Specimen:", "Fresh");
+ _helper.setDataEntryField("accessionNumber", "123");
scrollIntoView(Locator.name("diagnosis"));
_helper.setDataEntryField("identification", "Extra information");
_helper.setDataEntryField("grossAbnormalities", "Extra leg");