Skip to content

measurement cohort inf dont work on snowflake #706

@ilovemane

Description

@ilovemane

This bit of code return error on snowflake database, because they can't interpret "inf" in snowflake sql. Is it ok to make it if Inf are used, we dont add the filter <Inf?

cdm[["diastbp"]] <- CohortConstructor::measurementCohort(
  cdm,
  conceptSet = list("diastbp" = measurement_codelist$diastbp),
  valueAsNumber = list("diastbp_over_90" = list(c(90, Inf))),
  subsetCohort = exposure,
  name = "diastbp"
)

Error in `source()`:

! ODBC failed with error 00000 from .

✖ DML operation to table

  XE61619.PA_GERMANY_DA.STUDY_REFERENCE_2."oxford_dsmjr_temp_table" failed on column

  diastbp_over_90 with error: Numeric value 'Infinity' is not recognized

• <SQL> 'CREATE TABLE "PA_GERMANY_DA"."STUDY_REFERENCE_2"."oxford_dsmjr_temp_table" AS

  SELECT

•  "oxford_diastbp".*,

•  CASE WHEN (("value_as_number" >= 90.0 AND "value_as_number" <= 'Infinity')) THEN

  TRUE WHEN NOT (("value_as_number" >= 90.0 AND "value_as_number" <= 'Infinity')) THEN

  FALSE END AS "diastbp_over_90"

• FROM "PA_GERMANY_DA"."STUDY_REFERENCE_2"."oxford_diastbp"'

ℹ From nanodbc/nanodbc.cpp:1802.

Run `rlang::last_trace()` to see where the error occurred.

Called from: signal_abort(cnd, .file)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions