Skip to content

Commit 6f5b8c8

Browse files
Merge 25.11 to develop
2 parents 355d572 + c18875d commit 6f5b8c8

4 files changed

Lines changed: 25 additions & 7 deletions

File tree

nirc_ehr/resources/queries/study/cases.query.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
</column>
5151
<column columnName="category">
5252
<columnTitle>Category</columnTitle>
53-
<isUserEditable>false</isUserEditable>
53+
<isUserEditable>true</isUserEditable>
5454
<nullable>false</nullable>
5555
<fk>
5656
<fkDbSchema>ehr_lookups</fkDbSchema>
@@ -61,6 +61,9 @@
6161
<column columnName="remark">
6262
<isHidden>true</isHidden>
6363
</column>
64+
<column columnName="caseCategory">
65+
<isUserEditable>false</isUserEditable>
66+
</column>
6467
</columns>
6568
</table>
6669
</tables>

nirc_ehr/resources/queries/study/deaths.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,16 @@ function onUpsert(helper, scriptErrors, row, oldRow) {
7171

7272
if (!helper.isETL()) {
7373

74-
//only allow death record to be created if animal is in demographics table
74+
//skip other checks so that the admins can update a death record
75+
if (helper.getEvent() === 'update' && LABKEY.Security.currentUser.isAdmin) {
76+
return;
77+
}
78+
79+
//only allow death record to be created if the animal is in the demographics table
7580
if (idMap[row.Id]) {
7681

77-
// check if death record already exists for this animal
78-
if (idMap[row.Id].calculated_status.toUpperCase() === 'DEAD' && row.QCStateLabel.toUpperCase() === 'COMPLETED') {
82+
// check if a death record already exists for this animal
83+
if (idMap[row.Id].calculated_status.toUpperCase() === 'DEAD' && deathIdMap[row.Id].QCStateLabel.toUpperCase() === 'COMPLETED') {
7984
EHR.Server.Utils.addError(scriptErrors, 'Id', 'Death record already exists for this animal.', 'ERROR');
8085
}
8186
// check if the animal is at the center

nirc_ehr/resources/views/datasets.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
const config = {displayField: 'Label', headerField: 'categoryId/label', target: webpart.wrapperDivId};
88

9-
const nonFormUpdates = ["Cases", "Procedures", "Drug Administration"];
9+
const nonFormUpdates = ["Treatment Cases", "Procedures", "Drug Administration", "Deaths"];
1010

1111
const hideUpdateRecords = [];
1212

@@ -66,12 +66,22 @@
6666
params.queryUpdateURL = true;
6767

6868
if(EHR.Security.hasPermission('Completed', 'update', {schemaName: 'study', queryName: item.queryName}) && hideUpdateRecords.indexOf(item.queryName) === -1){
69-
cfg.items.push({
69+
70+
if(nonFormUpdates.indexOf(item.queryName) !== -1) {
71+
//adding an item here so that the 'Admin Update Records' link aligns with other links in the same "column"
72+
cfg.items.push({
73+
xtype: 'box',
74+
html: '<span><a class="labkey-text-link" style="cursor: pointer; visibility: hidden;">Update Records</a></span>'
75+
});
76+
}
77+
else {
78+
cfg.items.push({
7079
xtype: 'ldk-linkbutton',
7180
tooltip: item.searchTooltip || 'Click to update records',
7281
href: LABKEY.ActionURL.buildURL('ehr', 'updateQuery', null, params),
7382
text: 'Update Records'
7483
});
84+
}
7585
}
7686

7787
params.queryUpdateURL = true;

nirc_ehr/resources/views/necropsy.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
schemaName: 'study',
6060
queryName: 'deaths',
6161
filterArray: filterArray,
62-
columns: 'Id,Id/demographics/species,date,reason,deathWeight,Id/lastProtocol/protocol,Id/lastProject/project',
62+
columns: 'Id,Id/demographics/species,Id/demographics/gender,date,reason,deathWeight,Id/lastProtocol/protocol,Id/lastProject/project',
6363
},
6464
title: 'Death',
6565
renderTo: 'animalDeath',

0 commit comments

Comments
 (0)