Skip to content

Commit

Permalink
Merge pull request #281 from OHDSI/issue279
Browse files Browse the repository at this point in the history
fix bug in MeasurementValue.sql
  • Loading branch information
ginberg authored Oct 16, 2024
2 parents a1fd914 + c5aa2da commit 631d2eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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

0 comments on commit 631d2eb

Please sign in to comment.