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

fix bug in MeasurementValue.sql #281

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion inst/sql/sql_server/MeasurementValue.sql
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ FROM (

{@temporal_sequence} ? {

FLOOR(DATEDIFF(@time_part, measurement_date, cohort.cohort_start_date)*1.0/@time_interval ) as time_id
FLOOR(DATEDIFF(@time_part, measurement_date, cohort.cohort_start_date)*1.0/@time_interval ) as time_id,
ROW_NUMBER() OVER (PARTITION BY cohort.@row_id_field, measurement.measurement_concept_id, FLOOR(DATEDIFF(@time_part, measurement_date, cohort.cohort_start_date)*1.0/@time_interval ) ORDER BY measurement_date DESC, measurement.unit_concept_id, value_as_number) AS rn,

} : {
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-GetCovariatesTemporalSequence.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ test_that("getDbCovariateData works with createTemporalSequenceCovariateSettings
useDemographicsAgeGroup = T,
useConditionEraGroupStart = T,
useDrugEraStart = T,
useMeasurement = T,
useMeasurementValue = T,
timePart = "month",
timeInterval = 1,
sequenceEndDay = -1,
Expand Down
Loading