ohdsi-studies / PioneerWatchfulWaiting

This study is part of the joint PIONEER - EHDEN - OHDSI studyathon in March 2021, and aims to advance understanding of clinical management and outcomes of watchful waiting in prostate cancer.
Apache License 2.0
7 stars 18 forks source link

Negative values in metrics distributions #47

Closed bdemeulder closed 3 years ago

bdemeulder commented 3 years ago

As seen by Artem in shiny app shiny app issue metrics distribution18062021

This could be an error in how the number of days are substracted in the TimeToEvent or TimeToEventCombined SQL files?

scossin commented 3 years ago

@keesvanbochove @MaximMoinat @Tsemharb @bdemeulder

I introduced this bug when mistranslating the DATEDIFF function that doesn't exist in Oracle: https://github.com/scossin/PioneerWatchfulWaiting/commit/5f3f4f5b1c85a05b0980866bd0a2e31034df10f9

SELECT DATEDIFF(day, '2016/10/19', '2021/04/25') AS DateDiff; -- returns 1649
SELECT ROUND(to_date('2016/10/19', 'YYYY/MM/DD') - to_date('2021/04/25', 'YYYY/MM/DD'), 0) as DateDiff
FROM DUAL -- returns -1649

It's my fault, we can close this issue.

scossin commented 3 years ago

I confirm the bug was only on my side, after the fix: https://github.com/scossin/PioneerWatchfulWaiting/commit/842f91c214f18419f0ddb7f40c68c0d3cdbbd1b4 It's much better

FixDateDiff