Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIMS-1368: Fix incorrectly summed dose for DC groups when filtered #803

Merged
Merged
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
7 changes: 5 additions & 2 deletions api/src/Page/DC.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ function _data_collections($single = null)
dc.c2lens,
dc.objaperture,
dc.magnification,
dc.totalexposeddose as totaldose,
dose.total as totaldose,
CAST(dc.totalabsorbeddose AS DECIMAL(5, 2)) as totalabsdose,
d.detectorpixelsizehorizontal,
d.detectorpixelsizevertical,
Expand Down Expand Up @@ -574,7 +574,7 @@ function _data_collections($single = null)
max(dc.c2lens) as c2lens,
max(dc.objaperture) as objaperture,
max(dc.magnification) as magnification,
sum(dc.totalabsorbeddose) as totaldose,
dose.total as totaldose,
CAST(dc.totalabsorbeddose AS DECIMAL(5, 2)) as totalabsdose,
max(d.detectormanufacturer) as detectormanufacturer,
max(d.detectormodel) as detectormodel,
Expand Down Expand Up @@ -659,6 +659,9 @@ function _data_collections($single = null)
SELECT $extcg $fields
FROM datacollection dc
INNER JOIN datacollectiongroup dcg ON dcg.datacollectiongroupid = dc.datacollectiongroupid
INNER JOIN (
select datacollectiongroupid, sum(totalabsorbeddose) as total from datacollection group by datacollectiongroupid) dose
ON dc.datacollectiongroupid = dose.datacollectiongroupid
INNER JOIN blsession ses ON ses.sessionid = dcg.sessionid
$sample_joins[0]
LEFT OUTER JOIN datacollectioncomment dcc ON dc.datacollectionid = dcc.datacollectionid
Expand Down
Loading