Skip to content

Commit 6d1ab8b

Browse files
committed
Add column to MCC to exclude shipped/duplicated IDs
1 parent a175b55 commit 6d1ab8b

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

mcc/resources/queries/mcc/aggregatedDemographics.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ LEFT JOIN (SELECT
3737
o."medical_history::observation" as medical_history,
3838
FROM "/data/Colonies/SNPRC/".study.mostRecentObservationsPivoted o
3939
) o ON (o.Id = d.Id)
40+
WHERE (d.excludeFromCensus IS NULL or d.excludeFromCensus = false)
4041

4142
UNION ALL
4243

@@ -79,6 +80,7 @@ FROM "/data/Colonies/WNPRC/".study.demographics d
7980
o."medical_history::observation" as medical_history,
8081
FROM "/data/Colonies/WNPRC/".study.mostRecentObservationsPivoted o
8182
) o ON (o.Id = d.Id)
83+
WHERE (d.excludeFromCensus IS NULL or d.excludeFromCensus = false)
8284

8385
UNION ALL
8486

@@ -118,6 +120,7 @@ FROM "/data/Colonies/UCSD/".study.demographics d
118120
o."medical_history::observation" as medical_history,
119121
FROM "/data/Colonies/UCSD/".study.mostRecentObservationsPivoted o
120122
) o ON (o.Id = d.Id)
123+
WHERE (d.excludeFromCensus IS NULL or d.excludeFromCensus = false)
121124

122125
UNION ALL
123126

@@ -156,4 +159,5 @@ FROM "/data/Colonies/Other/".study.demographics d
156159
o."fertility_status::observation" as fertility_status,
157160
o."medical_history::observation" as medical_history,
158161
FROM "/data/Colonies/Other/".study.mostRecentObservationsPivoted o
159-
) o ON (o.Id = d.Id)
162+
) o ON (o.Id = d.Id)
163+
WHERE (d.excludeFromCensus IS NULL or d.excludeFromCensus = false)

mcc/resources/queries/study/demographics.query.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
<column columnName="source">
4242
<columnTitle>Source Colony</columnTitle>
4343
</column>
44+
<column columnName="excludeFromCensus">
45+
<columnTitle>Exclude From Census?</columnTitle>
46+
</column>
4447
<column columnName="project">
4548
<isHidden>true</isHidden>
4649
</column>

mcc/resources/referenceStudy/study/datasets/datasets_metadata.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,9 @@
676676
<column columnName="alternateIds">
677677
<datatype>varchar</datatype>
678678
</column>
679+
<column columnName="excludeFromCensus">
680+
<datatype>boolean</datatype>
681+
</column>
679682
</columns>
680683
<tableTitle>Demographics</tableTitle>
681684
</table>

mcc/resources/web/mcc/window/MarkShippedWindow.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ Ext4.define('MCC.window.MarkShippedWindow', {
141141

142142
var commands = [];
143143
if (!row['Id/MostRecentDeparture/MostRecentDeparture']) {
144+
//TODO: make this update demographics.colony
144145
commands.push({
145146
command: 'insert',
146147
schemaName: 'study',
@@ -190,6 +191,17 @@ Ext4.define('MCC.window.MarkShippedWindow', {
190191
}]
191192
});
192193

194+
commands.push({
195+
command: 'update',
196+
containerPath: null, //Use current folder
197+
schemaName: 'study',
198+
queryName: 'Demographics',
199+
rows: [{
200+
Id: newId,
201+
excludeFromCensus: true
202+
}]
203+
});
204+
193205
LABKEY.Query.saveRows({
194206
commands: commands,
195207
scope: this,

0 commit comments

Comments
 (0)