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
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ SELECT
count(*) as totalTests,
cast('POS' as varchar) as result,
cast('SBT' as varchar) as assaytype,
a.analysisId.readset.libraryType as librarytype,
group_concat(DISTINCT a.analysisId.readset.libraryType, ',') as librarytype,
sum(a.result) / (SELECT count(DISTINCT a2.analysisId) as total FROM assay.GenotypeAssay.Genotype.Data a2 WHERE a2.subjectId = a.subjectId AND a2.run.assayType = 'SBT' ) AS score,

FROM assay.GenotypeAssay.Genotype.Data a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<columns>
<column columnName="employeeId">
<fk>
<fkFolderPath>/ONPRC/Admin/Compliance</fkFolderPath>
<fkDbSchema>ehr_compliancedb</fkDbSchema>
<fkTable>employees</fkTable>
<fkColumnName>employeeId</fkColumnName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

var console = require("console");
var LABKEY = require("labkey");
var ldkUtils = require("ldk/Utils").LDK.Server.Utils;

var helper = org.labkey.ldk.query.LookupValidationHelper.create(LABKEY.Security.currentContainer.id, LABKEY.Security.currentUser.id, 'ehr_compliancedb', 'requirements');

Expand All @@ -27,19 +28,7 @@ function beforeUpdate(row, oldRow, errors){
}

function beforeUpsert(row, errors){
var lookupFields = ['type'];
for (var i=0;i<lookupFields.length;i++){
var f = lookupFields[i];
var val = row[f];
if (!LABKEY.ExtAdapter.isEmpty(val)){
var normalizedVal = helper.getLookupValue(val, f);

if (LABKEY.ExtAdapter.isEmpty(normalizedVal))
errors[f] = 'Unknown value for field: ' + f + '. Value was: ' + val;
else
row[f] = normalizedVal; //cache value for purpose of normalizing case
}
}
ldkUtils.normalizeLookupFields(helper, row, errors, ['type']);
}

function afterUpdate(row, oldRow, errors){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

var LABKEY = require("labkey");
var ldkUtils = require("ldk/Utils").LDK.Server.Utils;

var helper = org.labkey.ldk.query.LookupValidationHelper.create(LABKEY.Security.currentContainer.id, LABKEY.Security.currentUser.id, 'onprc_ehr_compliancedb', 'requirementsperemployee');

Expand All @@ -24,17 +25,5 @@ function beforeUpdate(row, oldRow, errors){
}

function beforeUpsert(row, errors){
var lookupFields = ['employeeid', 'requirementname'];
for (var i=0;i<lookupFields.length;i++){
var f = lookupFields[i];
var val = row[f];
if (!LABKEY.ExtAdapter.isEmpty(val)){
var normalizedVal = helper.getLookupValue(val, f);

if (LABKEY.ExtAdapter.isEmpty(normalizedVal))
errors[f] = 'Unknown value for field: ' + f + '. Value was: ' + val;
else
row[f] = normalizedVal; //cache value for purpose of normalizing case
}
}
ldkUtils.normalizeLookupFields(helper, row, errors, ['employeeid', 'requirementname']);
}
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ Ext4.define('onprc_ehr.panel.ManageTreatmentsPanel', {
columns: 'lsid,objectid,Id,date,enddate,project,category,remark,performedby,code,route,frequency,frequency/meaning,amountAndVolume,modifiedby/DisplayName,modified,enddateTimeCoalesced',
filterArray: [
LABKEY.Filter.create('Id', this.animalId, LABKEY.Filter.Types.EQUAL),
LABKEY.Filter.create('enddateTimeCoalesced', xdate, LABKEY.Filter.Types.GTE)//Modified: 6-28-2018 R.Blasa
LABKEY.Filter.create('QCState/Label', 'Completed', LABKEY.Filter.Types.EQUAL),
LABKEY.Filter.create('enddateTimeCoalesced', xdate, LABKEY.Filter.Types.GTE)
],
autoLoad: true,
listeners: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ protected SimpleFilter getFilter(Collection<String> ids)
roundedMax = DateUtils.truncate(roundedMax, Calendar.DATE);

SimpleFilter filter = super.getFilter(ids);
filter.addCondition(FieldKey.fromString("isActive"), true, CompareType.EQUAL);
filter.addCondition(FieldKey.fromString("qcstate/publicData"), true, CompareType.EQUAL);
filter.addCondition(FieldKey.fromString("enddateTimeCoalesced"),roundedMax, CompareType.GTE);
filter.addCondition(FieldKey.fromString("category"), "Husbandry", CompareType.NEQ_OR_NULL);

Expand Down
15 changes: 2 additions & 13 deletions onprc_ssu/resources/queries/onprc_ssu/schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

var console = require("console");
var LABKEY = require("labkey");
var ldkUtils = require("ldk/Utils").LDK.Server.Utils;

var helper = org.labkey.ldk.query.LookupValidationHelper.create(LABKEY.Security.currentContainer.id, LABKEY.Security.currentUser.id, 'onprc_ssu', 'schedule');

Expand All @@ -27,17 +28,5 @@ function beforeUpdate(row, oldRow, errors){
}

function beforeUpsert(row, errors){
var lookupFields = ['projectName'];
for (var i=0;i<lookupFields.length;i++){
var f = lookupFields[i];
var val = row[f];
if (!LABKEY.ExtAdapter.isEmpty(val)){
var normalizedVal = helper.getLookupValue(val, f);

if (LABKEY.ExtAdapter.isEmpty(normalizedVal))
errors[f] = 'Unknown value for field: ' + f + '. Value was: ' + val;
else
row[f] = normalizedVal; //cache value for purpose of normalizing case
}
}
ldkUtils.normalizeLookupFields(helper, row, errors, ['projectName']);
}
Loading