Skip to content

Commit e83d7e3

Browse files
committed
update housing overlaps columns
1 parent 92d7801 commit e83d7e3

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

ehr/resources/views/housingOverlaps.html

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,23 @@
211211
}
212212
else {
213213
// Group by Id - have to build custom SQL
214+
config.sql = 'SELECT i.Id, \n' +
215+
'i.Id.Dataset.Demographics.gender, \n' +
216+
'i.Id.Demographics.species, \n' +
217+
'i.Id.Demographics.calculated_status, \n' +
218+
'i.Id.Demographics.birth, \n' +
219+
'i.Id.Demographics.death, \n' +
220+
'i.Id.curLocation.room AS CurrentRoom, \n' +
221+
'i.Id.curLocation.cage AS CurrentCage, \n' +
222+
'i.Id.MostRecentWeight.MostRecentWeight, \n' +
223+
'i.Id.MostRecentWeight.MostRecentWeightDate \n' +
224+
'FROM ('
225+
214226
if (type === 'date') {
215-
config.sql = 'SELECT Id FROM HousingOverlapsReportDateOnly';
227+
config.sql += 'SELECT Id FROM HousingOverlapsReportDateOnly';
216228
}
217229
else {
218-
config.sql = 'SELECT Id FROM HousingOverlapsReport';
230+
config.sql += 'SELECT Id FROM HousingOverlapsReport';
219231
}
220232

221233
if ((rooms && rooms.length) || cage) {
@@ -234,9 +246,9 @@
234246

235247
if (filterSql)
236248
config.sql += filterSql;
237-
238-
config.sql += ' GROUP BY Id';
239249
}
250+
251+
config.sql += ' GROUP BY Id) i';
240252
}
241253

242254
const params = {

0 commit comments

Comments
 (0)