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
58 changes: 58 additions & 0 deletions onprc_ehr/resources/queries/study/clinical_observations.query.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="clinical_observations" tableDbType="TABLE">
<tableUrl />
<insertUrl />
<importUrl />
<updateUrl />
<deleteUrl />
<columns>
<column columnName="date">
</column>
<column columnName="category">
<columnTitle>Category</columnTitle>
</column>
<column columnName="area">
<columnTitle>Area</columnTitle>
<fk>
<fkDbSchema>ehr_lookups</fkDbSchema>
<fkTable>observation_areas</fkTable>
<fkColumnName>value</fkColumnName>
<fkDisplayColumnName useRawValue="true"/>
</fk>
</column>
<column columnName="observation">
<columnTitle>Observation/Score</columnTitle>
</column>
<column columnName="parentid">
<fk>
<fkDbSchema>study</fkDbSchema>
<fkTable>encountersParent</fkTable>
<fkColumnName>objectid</fkColumnName>
</fk>
</column>
<column columnName="description">
<isHidden>true</isHidden>
</column>
<column columnName="project">
<isHidden>true</isHidden>
</column>
<column columnName="account">
<isHidden>true</isHidden>
</column>
<column columnName="code">
<columnTitle>Code</columnTitle>
<isHidden>true</isHidden>
</column>
<column columnName="type">
<columnTitle>Type</columnTitle>
</column>
<column columnName="ObsRemarks">
<columnTitle>Observation Remarks</columnTitle>
</column>
</columns>
</table>
</tables>
</metadata>
</query>
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,12 @@
<column columnName="formSort">
<datatype>integer</datatype>
</column>
<column columnName="type">
<datatype>varchar</datatype>
</column>
<column columnName="Obsremarks">
<datatype>varchar</datatype>
</column>
</columns>
<tableTitle>Clinical Observations</tableTitle>
</table>
Expand Down Expand Up @@ -911,6 +917,12 @@
<column columnName="CEG_Plan">
<datatype>varchar</datatype>
</column>
<column columnName="type">
<datatype>varchar</datatype>
</column>
<column columnName="obsScoreremarks">
<datatype>varchar</datatype>
</column>
</columns>
<tableTitle>Clinical Remarks</tableTitle>
</table>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
/*
* Copyright (c) 2014-2019 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
/**
* This is used within the RowEditor in the clinical rounds form
*
* @cfg observationFilterArray
*
*/
Ext4.define('ONPRC_EHR.grid.ObservationsRowEditorGridPanel', {
extend: 'Ext.grid.Panel',
alias: 'widget.onprc_ehr-observationsroweditorgridpanel',

initComponent: function(){
Ext4.apply(this, {
columns: this.getColumns(),
boundRecord: null,
boundRecordId: null,
selModel: {
mode: 'MULTI'
},
plugins: [{
ptype: 'clinicalobservationscellediting',
pluginId: 'cellediting',
clicksToEdit: 1
}],
dockedItems: [{
xtype: 'toolbar',
position: 'top',
items: [{
text: 'Add',
scope: this,
handler: function(btn){
var rec = this.createModel();
if (!rec)
return;

this.store.add(rec);
this.getPlugin('cellediting').startEdit(rec, 0);
}
},{
text: 'Remove',
scope: this,
handler: function(btn){
var recs = this.getSelectionModel().getSelection();
this.store.remove(recs);
}
}]
}]
});

this.callParent();

this.mon(this.remarkStore, 'update', this.onRecordUpdate, this);
},

createModel: function(data){
var form = this.up('window').down('ehr-formpanel');
var br = form.getRecord();
LDK.Assert.assertNotEmpty('No bound record in ObservationsRowEditorGridPanel', br);
if (!br){
Ext4.Msg.alert('Error', 'Unable to find record');
return;
}

LDK.Assert.assertNotEmpty('No animal Id in ObservationsRowEditorGridPanel', br.get('Id'));
if (!br.get('Id')){
Ext4.Msg.alert('Error', 'No animal Id provided');
return;
}

return this.store.createModel(Ext4.apply({
Id: br.get('Id'),
date: new Date(),
caseid: br.get('caseid')
}, data));
},

getColumns: function(){
return [{
header: 'Category',
dataIndex: 'category',
editable: true,
renderer: function(value, cellMetaData, record){
if (Ext4.isEmpty(value)){
cellMetaData.tdCls = 'labkey-grid-cell-invalid';
}

return value;
},
editor: {
xtype: 'labkey-combo',
editable: true,
displayField: 'value',
valueField: 'value',
forceSelection: true,
queryMode: 'local',
anyMaych: true,
store: {
type: 'labkey-store',
schemaName: 'ehr',
queryName: 'observation_types',
filterArray: this.observationFilterArray,
columns: 'value,editorconfig',
autoLoad: true
}
}
},{
header: 'Area',
width: 200,
editable: true,
dataIndex: 'area',
editor: {
xtype: 'labkey-combo',
displayField: 'value',
valueField: 'value',
forceSelection: true,
queryMode: 'local',
anyMaych: true,
value: 'N/A',
store: {
type: 'labkey-store',
schemaName: 'ehr_lookups',
queryName: 'observation_areas',
autoLoad: true
}
}
},{
header: 'Obs Remarks',
width: 130,
dataIndex: 'obs_remark',
editor: {
xtype: 'textarea',
width:280,
height:50
}
},{
header: 'Observation/Score',
width: 200,
editable: true,
dataIndex: 'observation',
renderer: function(value, cellMetaData, record){
if (Ext4.isEmpty(value) && ['Vet Attention'].indexOf(record.get('category')) == -1){
cellMetaData.tdCls = 'labkey-grid-cell-invalid';
}

return value;
},
editor: {
xtype: 'textfield'
}
}]
},

onRecordUpdate: function(store, rec){
if (rec === this.boundRecord){
var newId = rec.get('Id');
var newDate = rec.get('date');

if (rec.get('Id') != this.boundRecordId){
this.store.each(function(r){
//update any record from the bound animal
if (r.get('Id') === this.boundRecordId){
r.set({
Id: newId,
date: newDate
});
}
}, this);
}
}
},

loadRecord: function(rec){
var id = rec.get('Id');

this.boundRecord = rec;
this.boundRecordId = rec.get('Id');

this.store.clearFilter();
this.store.filter('Id', id);
}
});
53 changes: 53 additions & 0 deletions onprc_ehr/resources/web/onprc_ehr/model/sources/SurgicalRounds.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright (c) 2013-2019 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
EHR.model.DataModelManager.registerMetadata('SurgicalRoundsExt', {
allQueries: {
Id: {
editable: false,
columnConfig: {
editable: false
}
}
},
byQuery: {
'study.clinremarks': {
category: {
defaultValue: 'Surgery',
hidden: true
},
hx: {
hidden: true
},
s: {
hidden: true
},
o: {
hidden: true
},
a: {
hidden: true
},
p: {
hidden: true
},
p2: {
hidden: true
}
},

'study.clinical_observations': {
type: {
defaultValue: 'surgery',
hidden: true
}
},
'study.blood': {
reason: {
defaultValue: 'Clinical'
}
}
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Copyright (c) 2013-2014 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.SimpleFormSection;
import org.labkey.api.view.template.ClientDependency;

import java.util.Collections;
import java.util.List;

/**
* User: bimber
* Date: 7/7/13
* Time: 10:36 AM
*/
public class SurgicalAmendedRemarksFormSection extends SimpleFormSection
{
public SurgicalAmendedRemarksFormSection(String label, EHRService.FORM_SECTION_LOCATION location)
{
super("study", "Clinical Remarks", label, "onprc_ehr-surgroundsremarksgridpanel", location);
addClientDependency(ClientDependency.supplierFromPath("ehr/plugin/ClinicalObservationsCellEditing.js")); //No changes here. Not important
addClientDependency(ClientDependency.supplierFromPath("ehr/panel/ClinicalRemarkPanel.js"));
addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/grid/SurgicalRoundsRemarksGridPanel.js")); //points to ONPRC_EHR.plugin.SurgicalRemarksRowEditor
addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/grid/ObservationsRowEditorGridPanel.js")); //Modified //Modified from ehr to onprc_ehr added new clinical observation columns
// MOdified: 8-1-2024 so that contents reset as ehr control types
addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/plugin/SurgicalRemarksRowEditor.js")); //edited //edited points to onprc_ehr.ObservationRowEditorGridPanel.js


addClientDependency(ClientDependency.supplierFromPath("ehr/data/ClinicalObservationsClientStore.js"));
addClientDependency(ClientDependency.supplierFromPath("ehr/buttons/roundsButtons.js"));
addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/form/field/SurgeryEntryField.js"));

setTemplateMode(TEMPLATE_MODE.NONE);
}

@Override
public List<String> getTbarButtons()
{
List<String> defaultButtons = super.getTbarButtons();
defaultButtons.add(0, "ADDSURGICALCASES");
defaultButtons.add("BULK_CHANGE_CASES");

return defaultButtons;
}
}